ESP8266 – building the toolchain for Linux (Ubuntu)

This is a quick tutorial that shows how to build a complete development environment (including FreeRTOS support) for the ESP8266 processors on Linux. These instructions have been tested successfully on Ubuntu 17.04.


  1. [28.10.2019] Take a look at docker version of ESP8266 Toolchain
  2. [05.03.2019] If you want to use FreeRTOS in your project I recommend to install a new version of ESP8266_RTOS_SDK (esp-idf style)

Building Toolchain Step-by-Step

All these steps are based on “Quick Start” from  ESP-OPEN-RTOS.

1. Collect and install tools

sudo apt-get install git make python python-pip

2. Create base directory

mkdir -p $HOME/esp8266

3. Download and install SDK for ESP8266

This step will take a while so be patient!

cd $HOME/esp8266
git clone --recursive
cd esp-open-sdk

4. Install

pip install esptool

5.  Download Open RTOS for ESP8266

cd $HOME/esp8266
git clone --recursive

6. Update ENV variables

Make all tools available on your PATH.

cat << EOF >> $HOME/.bashrc
export PATH=$PATH:$HOME/esp8266/esp-open-sdk/xtensa-lx106-elf/bin
export ESP_OPEN_RTOS_PATH=$HOME/esp8266/esp-open-rtos

Optionally. Refresh your terminal ENV variables.

source $HOME/.bashrc

7. Compile and flash example project

cd $HOME/esp8266/esp-open-rtos/examples/blink
make flash

8. Pulling updates

This is additional, post-installation step to pull updates for latest versions. It can take some time – be patient!

cd $HOME/esp8266/esp-open-sdk
make clean
git pull
git submodule sync
git submodule update --init
cd $HOME/esp8266/esp-open-rtos
git pull

Useful Resources

3 thoughts on “ESP8266 – building the toolchain for Linux (Ubuntu)

    • Your’e right. This line should not force the user to have a github account. Changed.

  1. Cannot seem to get this to work:

    john@john-Latitude-D630:~/esp8266$ git clone
    Cloning into ‘esp-open-sdk’…
    Permission denied (publickey).
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

Leave a Comment