How to Install Visual Studio Code on Raspberry Pi

If you click our links and make a purchase, we may earn an affiliate commission. Learn more

I use Visual Studio Code every day, and I honestly think it’s one of the best editors out there. It’s made by Microsoft, but it runs perfectly on Linux and installs easily on a Raspberry Pi. Want to give it a try? I’ll show you how to get started.

Visual Studio Code is now included in the recommended software list on Raspberry Pi OS, so it can be installed in one click via this tool. After a few configuration steps, the editor can be used in the same way as on a standard computer.

Let’s start with the installation steps, and then I’ll share a few tips to get the most out of this tool on your Raspberry Pi.

If you’re new to Raspberry Pi or Linux, I’ve got something that can help you right away!
Download my free Linux commands cheat sheet – it’s a quick reference guide with all the essential commands you’ll need to get things done on your Raspberry Pi. Click here to get it for free!

Prerequisites for Visual Studio Code on Raspberry Pi

Before starting the installation process, just make sure to have these prerequisites in mind.

Hardware

For optimal performance, a Raspberry Pi 4 or Pi 5 is recommended. Visual Studio Code is probably one of the best editors, but not necessarily the lightest. So, you’ll have a better experience if you can get a model with more processing power and memory.

Except for that, there are no major requirements to use VS Code on Raspberry Pi. A stable network connection is recommended, and a comfortable keyboard and mouse if your goal is to code on it. But I guess you already have this (if not, check my favorite keyboards for Raspberry Pi here).

Software

Visual Studio Code is available for Windows, Linux, and Mac. On Linux, you have many options (.deb, .rpm, snap, script our sources), for different architectures (x64, arm32 and arm64) so it should work on any computer (download page).

On Raspberry Pi OS, the installation is straightforward as it’s available with the default tools, so I recommend using it. Any Raspberry Pi OS version with a Desktop environment is fine.

Make sure to do the system updates before going further. You can use the graphical tool, or simply copy and paste these commands into a terminal:
sudo apt update
sudo apt upgrade

Something not working as expected?
You can get answers from real experts in minutes.
Get help with your setup

With your hardware requirements met and your Raspberry Pi OS updated, you are now ready for the installation of Visual Studio Code.

Note: While writing this tutorial, I’m testing the installation process on a Raspberry Pi 5 using the latest release of Raspberry Pi OS (trixie, 64-bit).

Installing VS Code on Raspberry Pi

Here are the steps to install Visual Studio Code on Raspberry Pi:

  • Open the recommended software application.
  • Go to Programming and find Visual Studio Code.
  • Check the “Install” box and click on “Apply” to start the installation.

I’m detailing these steps in the next sections if you’ve never used this tool before.

Open the Raspberry Pi Recommended Software tool

The “Recommend Software” application on Raspberry Pi OS allows you to quickly install applications that are fully supported by the Pi foundation.

Recommended next step
Master Raspberry Pi in 30 Days

If you want a clearer path than jumping from tutorial to tutorial, my book gives you a step-by-step roadmap to really understand your Raspberry Pi.

Check the book here

The selection is limited, but it’s way more convenient than the traditional package manager. Anyway, start by opening the tool so we can install Visual Studio Code:

  • Open the main menu (Raspberry Pi icon in the top-left corner).
  • Navigate to Preferences > Recommended Software.
  • Click on it, and you should get a window that looks like this:

Install Visual Studio Code

In the “Recommended Software” tool, you can see all the applications and filter them by category.

Click on the Programming filter on the left, and scroll to the bottom, where you should find Visual Studio Code here. Next, mark the checkbox to have it installed:

Then, click Apply to start the installation. The system will do everything for you in the background, no command, no password, just wait a few seconds.

Run VS Code for the First Time

Once installed, VS Code is available in the main menu under “Programming” next to the other text editors that are pre-installed by default (Geany and Thonny).

A welcome wizard appears the first time you run it, and I recommend following it if you’ve never used this editor before. It’ll help you to customize the interface and introduce important features.

That’s it, Visual Studio Code is now installed and running on your Raspberry Pi. See? It wasn’t that hard. Let me introduce this tool a bit more so you can quickly get started with your projects.


🛠 This tutorial doesn't work anymore? Report the issue here, so that I can update it!

Stuck on this project? Ask me or other Pi users in the RaspberryTips Community. We help each other out and you'll get answers quick. Join and fix it together.

Getting Started with VS Code on Raspberry Pi

Overall, VS Code is an intuitive text editor, and getting started with it shouldn’t be too complicated (not like some IDE where you need a degree to create a text file). But it still includes many features, so let me walk you through the most important ones.

Interface Overview

I think that the developers have done a great job to keep the default interface pretty simple by default. Many features are available, but they are mostly hidden when you open the tool for the first time.

So if your goal is just to write a few Python scripts on your Raspberry Pi, you can get started right away. Here are the main parts you’ll see when you open a file:

  • The top menu: it’s similar to those you have with Notepad++ or other basic editors. It gives you access to the main features (open, save, search, etc.).
  • Then, I think you have three columns by default:
    • The left menu: That’s where the icons are in the left bar on my screenshot. They give you access to the most important features I’ll explain later (search, source control, extensions).
    • A column depending on which left menu element is active: For example, if you click on the search icon, a search engine will show up in a column inserted between the left icons and the text file.
    • Your code files: Then, the majority of the screen is available for your scripts. You can have as many as you want open at the same time (one tab for each file). You can split the view to see several files at once.
  • The bottom line: It gives you some basic information (like line number, script format, etc.), but some other features will also be added there if you enable extensions.

You can then play with the “View” menu to add optional windows. For example, in my screenshot, I enabled the “Terminal” window, allowing me to type Linux commands (and run my bash script) directly from the editor.

To be exhaustive, the features available in the left menu are:

  • Explorer: Where you can see a list of the files. In general, you’ll work on one project, with all files in one folder, and you can have an overview of the project’s files here to be able to open them quickly.
  • Search: A search engine. It works very well, especially if you are looking for something in your whole project.
  • Source Control: if you use Git or SVN, you can control everything from the editor directly.
  • Run & Debug: Probably not very useful for Raspberry Pi projects, it depends on which language you use and the complexity of your code.
  • Extensions: This is really powerful. Not only does VS Code come with many features by default, but there is also a kind of app store here where you can find and install additional extensions from the marketplace (more details later).
  • Account: It’s now possible to have an account and sync your files and settings across several computers.
  • Settings: Maybe do a quick tour there on the first run to see if there is anything you need to change in the default settings (font, tab size, shortcuts, etc.).

So, it can be as simple or advanced as you want or need. Not all features or options are enabled by default, which is good. Let’s talk a bit more about the extensions part, which is very interesting and not available with most other editors.

Extensions

We are used to having app stores now, on smartphones, operating systems, or web browsers. But for a text editor, it’s not that common.

In VS Code, you can click on the Extensions icons in the left menu to access a list of additional features that can be added to it: languages support, version control, customization, etc.

There’s a search engine available to quickly find something you need, but the editor will also suggest some. In my example, I got Python and Jupyter selected, which seems pretty smart.

The Python extension will allow you to use the “Run & Debug” feature for your Python scripts, have better code formatting and analysis, and many other options for your Python code.

I generally install the main extension for each language I use, some customization extensions (more on that in the next part), and various tools I find useful. For example, I have one that parses my code for //TODO comments and shows them all in one place.

It’s really nice to have extensions. If there’s something that you miss from another editor, you’ll likely find it here. Use the search bar to find anything you dream of—it probably already exists.

Customization

By default, Visual Studio Code has already many options you can play with in the settings, but you’ll also find several extensions to customize the style of your editor. You can find entire themes in the extensions, to completely change the way the editor looks on your system.

I generally install the “Blackboard Plus” extension that turns the interface to a dark blue and changes the syntax highlighting a bit, but feel free to search “theme” in the extensions, and test the ones that look interesting to you:

Remote Development

A quick word about remote development with Visual Studio Code. It’s kind of a buzzword, but it can be useful with a Raspberry Pi. The idea is to work from your computer but run scripts on the Raspberry Pi remotely.

As far as I can see, there are basically two ways to do this:

  • Full remote development: you do everything from the computer. You write and run scripts on the Raspberry Pi from your main PC.
  • Remote writing, local execution: you write code on your main PC, and then transfer it to the Raspberry Pi to run it (or schedule it).

For the first case, there is a pack with 4 extensions available and promoted in the extensions list (Remote Development), you may not need all of them, but that’s the easiest way to get started. It will connect via SSH to transfer and execute the scripts.

Related: Remote Python Development on Raspberry Pi

I don’t use it, so I don’t have any good feedback about it. I just find it too complicated because generally, the only thing I want is to write the code from my computer and have it synchronized to the Pi. That’s why I use this other one instead:

It’s really simple to use (a bit less to set up, but not that hard). You configure it for each project (folder), if you want to have the files synced to another Linux server (your Raspberry Pi). Each folder can have a different configuration file with the destination server, login, and password.

Once done (only one time for each folder), each time you save a file (CTRL+S) on your computer, it’s immediately synced to the Raspberry Pi. You can’t run the script from your PC directly, but it’s available on the Pi, so if you use SSH, or if it’s a web server, it’s very convenient.

I do this for all my small projects (when I don’t use some kind of version control system). It’s maybe not the best practice, but it works well for me. Pick the option you prefer (or just do everything from the Pi!).

And if you want to learn more about text editors and programming on Raspberry Pi, here is a list of articles you might be interested in:

Also, my goal wasn’t to write extensive documentation on how to use Visual Studio Code here, just to give you a quick overview and some tips for usage on a Raspberry Pi. Apart from that, you can check their official documentation here, where they explain all the features in detail.

Once installed, using it on a Raspberry Pi is no different from using it on a PC or Mac.

Not getting the same result?

Even when you follow every step, small differences in OS version, hardware or config can change the outcome. Instead of wasting time guessing, get help from people who have already fixed the same kind of issue.

Ask your question now
🔒 No risk. Cancel anytime.
  • Get help on your exact issue
  • Access step-by-step videos for tricky setups
  • Browse the website without ads

Similar Posts

Leave a Reply

Community members only
Comments are reserved for RaspberryTips Community members. Join the community to ask questions, get help, and interact with other Raspberry Pi users.

Join the community  or  log in