Want to code with Microsoft’s free developer tool, Visual Studio Code, on your Raspberry Pi device? Installing it is easier than ever, and we’ll show you how in this short guide.
VS Code and the Raspberry Pi
Thanks to the addition of an official Microsoft repository to Raspberry Pi OS, downloading and installing Visual Studio Code (commonly known as VS Code) is a cinch.
You may be thinking, haven’t people been using VS Code on the Raspberry Pi for a while now?
It’s true, but what they were using before were builds of Code OSS, which is in fact VS Code without Microsoft’s propriety assets and extensions. Code OSS is completely open source and has a more permissible MIT license than VS Code’s limited “freeware” license.
If you do want pure Code OSS, we have a short video guide to downloading and installing a community build.
Alternatively, if you don’t mind the work of building from source, Microsoft offers the source code on the GitHub repository and a guide to building it.
Simply installing VS Code, however, is far simpler, as we’re about to find out.
How to Install VS Code on Raspberry Pi OS
First, ensure Raspberry Pi OS is up to date by opening the terminal and entering the update command.
sudo apt update
Follow that up with the command to install VS Code.
sudo apt install code -y
Once the install has finished, you’ll find Visual Studio Code in the Programming folder of the Raspberry Pi Menu.
How to Install VS Code on Ubuntu Linux
If you’re running Ubuntu or an Ubuntu-based distro on your Raspberry Pi, you’ll have to take an extra step to get VS Code. The easiest method is through Snap.
snap install code
If you don’t have or don’t want Snap, Microsoft’s official download page for VS Code also offers the DEB file, which you can manually install on any Ubuntu distro.
How to Install VS Code on openSUSE
You can install VS Code on the openSUSE distro by first installing the key and repository with these commands:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
type=rpm-md
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/zypp/repos.d/vscode.repo'
Follow that with these commands, which download and install VS Code.
sudo zypper refresh
sudo zypper install code
VS Code for Raspberry Pi
You’re now using Microsoft’s best source code editing software that’s available for free. To effectively take advantage of its powers and optimize your coding efficiency, however, you’ll want to learn VS Code’s essential keyboard shortcuts.