In this guide, you'll learn how to install and use Microsoft's Visual Studio Code on the Raspberry Pi. Visual Studio Code, often shortened to VSCode, is an integrated development environment (IDE) that has a bunch of handy features that make writing code more straightforward, such as syntax highlighting, code completion, easier refactoring, and git built-in.

Setting Up Your Raspberry Pi

The Raspberry Pi Foundation has excellent guides on how to set up your Raspberry Pi Computer to include the cabling, power, and software (Raspberry Pi OS).

Parts

You will want a Raspberry Pi computer, hooked up to a monitor along with a keyboard and mouse. To do this, it is easiest to use one of the full size models such as the Raspberry Pi 3, 3B, or 4. The installation can be on any Raspberry Pi but the newer models will run faster which means better response. The Pi Zero W works also but requires a USB hub to get the mouse and keyboard to both work at the same time. The Raspberry Pi 400 contains a keyboard, only needing a mouse and HDMI monitor.

Did you really think the Raspberry Pi would stop getting better? At this point, we sound like a broken record, extolling on the new Pi’s myriad improvements like we’re...
Out of Stock
The Raspberry Pi 4 Model B is the newest Raspberry Pi computer made, and the Pi Foundation knows you can always make a good thing better! And what could make the Pi 4 better...
Out of Stock
The Raspberry Pi 4 Model B is the newest Raspberry Pi computer made, and the Pi Foundation knows you can always make a good thing better! And what could make the Pi 4 better...
Out of Stock
Raspberry Pi 400 is a complete Raspberry Pi 4-based personal computer, integrated into a keyboard. The Pi 4 is the first computer from the Pi Foundation that really feels 'desktop...
$70.00
In Stock
Raspberry Pi 400 is a complete Raspberry Pi 4-based personal computer, integrated into a keyboard. The Pi 4 is the first computer from the Pi Foundation that really feels 'desktop...
$100.00
In Stock

First, you're going to want to download VSCode from the link below. Any of the 3 buttons marked "ARM" (NOT ARM64) under the Linux section should work, but I prefer installing from a .deb file, so that's what I'll use for this demonstration.

If you are running the 64-bit version of the Raspberry Pi OS on the Raspberry Pi 4, the links in the previous installation won't work. Instead, you can find 64-bit installable version at https://packagecloud.io/swift-arm/vscode

Once you've downloaded the .deb file, open the terminal with ctrl+alt+t, by clicking it from the taskbar, or by navigating through the menu (raspberry pi icon -> Accessories -> Terminal). Then, navigate to the Downloads directory.

cd Downloads

After you're there, you'll want to install it. Your filename might not be the same, so try typing in code_ and then using tab completion to fill the rest of it. The installation usually takes a few minutes.

sudo apt install ./code_1.51.1-1605051085_armhf.deb

The output should look something like this. A good way to make sure that something has been installed is to check the line that I circled below.

If the above didn't work, you can also try installing with a combination of dpkg and apt.

sudo dpkg -i code_1.51.1-1605051085_armhf.deb
sudo apt-get install -f

Then, open VSCode from Menu -> Accessories -> Visual Studio Code. When you open it, it should look something like this, but as long as it opens and you don't get any error messages, you're probably fine.

If you'd like to install the CircuitPython extension, click the extensions tab (circled in red below), type CircuitPython into the search bar, and install the one by joedevivo.

Now you should be ready to use VSCode on your Raspberry Pi. For more information about using VSCode, click on the link labeled "VSCode Documentation" on the sidebar.

This guide was first published on Nov 24, 2020. It was last updated on Nov 24, 2020.