Microsoft MakeCode for Adafruit is a web-based code editor for physical computing. It provides a block editor, similar to Scratch or, and also a JavaScript editor for more advanced users.

If you just want to use MakeCode to build programs, you can visit, and check out our basic guide to MakeCode as well as instructions for using MakeCode with the CircuitPlayground Express.

MakeCode is built on the Microsoft Programming Experience Toolkit (PXT), which powers editors for a variety of hardware platforms.  This guide offers concise instructions for installing the MakeCode for Adafruit project on a system you control.

This guide is just for people who want to do development ON MakeCode, to add more capabilites or maybe just run a local version that does not require 'the cloud'!

If you're using a recent stable Debian or Ubuntu release, you can install and run a development version of of MakeCode directly on your system. (For a more contained solution that should work on Windows or MacOS, skip ahead to the next section of this guide.)

First, open a terminal and create a new directory to contain the PXT code repositories by typing the following commands:

mkdir makecode-adafruit
cd makecode-adafruit

Next, create a file called with nano, or the text editor of your choice:


And paste the following script into the file:


# Install Node.js:
curl -sL | sudo -E bash -
sudo apt-get install -y nodejs

# Install some dependencies:
sudo apt-get install git libsecret-1-dev
sudo npm install -g jake
sudo npm install -g typings
sudo npm install -g pxt

# Clone repos from GitHub:
git clone
git clone
git clone

cd pxt
npm install
typings install

cd ..
cd pxt-common-packages
npm install
sudo npm link ../pxt

cd ..
cd pxt-adafruit
npm install
sudo npm link ../pxt
sudo npm link ../pxt-common-packages

Save the file and exit (in nano, press Ctrl-X, followed by y and Enter to write the file).

The script installs Node.js, the Git version control system, and several other dependencies. It then checks out the latest development versions of the PXT code and installs it.

Run it with:


This should take quite a while to finish.

Now you can run the following at the command prompt:

cd pxt-adafruit
pxt serve --cloud

This step will also take quite a while the first time you run it, since it needs to build various resources.

Eventually, MakeCode should print something like the following...

starting local ws server at 3233...

To launch the editor, open this URL:

opening http://localhost:3232/#local_token=0918998d-feec-4217-3c97-41d14634b51f&wsport=3233

...and then open in your web browser:

You can press Ctrl-C in the terminal to stop the MakeCode process. To start it again, just remember to cd to the project directory and run pxt serve --cloud again:

cd ~/makecode-adafruit/pxt-adafruit
pxt serve --cloud

Vagrant is a tool for managing and configuring virtual machines. You can use it to run a development installation of MakeCode which can build the static version of the MakeCode site, like the one hosted at

First, you'll need to install Vagrant, VirtualBox, and Git.  We have a guide to installing these tools on Windows.

Next, you'll need a copy of the git repository here:

Start Bash, and clone the repository:

git clone
cd Adafruit-PXT-Setup

Start and provision the Vagrant box:

vagrant up

This part will take a while, particularly on a slow connection, since it has to download both the image for the virtual machine and a bunch of dependencies.  When it finishes, you should see the string " completed" as the last message it prints out.

Now you can SSH into the Vagrant box and build MakeCode itself:

vagrant ssh
cd pxt-adafruit
pxt staticpkg -o /var/www/html

This will take a while, and may fail with a long error message on the first attempt.  If so, run pxt staticpkg -o /var/www/html again.  When it finishes, you should see something like:

rendering docs/tutorials/sensors/graph-acceleration.png
rendering docs/tutorials/sensors/graph-lightlevel.png
rendering docs/tutorials/sensors/graphblock.gif
rendering docs/tutorials/sensors/lightlevelblock.gif
rendering docs/tutorials/sensors/
rendering docs/tutorials/
rendering docs/
rendering docs/windows-app-web-link-ref.json
Docs written.

Now, as long as the Vagrant box is running, you should be able to load MakeCode for Adafruit from your local system.  Open up a browser and load the following URL:


...this works because port 8080 on your system is forwarded to port 80 on the Vagrant box, which is running a webserver to serve the generated files.

This guide was first published on May 23, 2018. It was last updated on May 23, 2018.