This guide is intended for users running VS Code on Debian 12 “Bookworm.” If you’re using Debian 13 “Trixie,” check out our updated guide for that release.
Visual Studio Code (VS Code) is a powerful and versatile code editor that developers worldwide love. Installing it on Linux is a straightforward process that can be accomplished in just a few simple steps.
If you’re using Debian 12 “Bookworm” and want to harness the full potential of this powerful code editor, you’ve come to the right place.
This comprehensive guide will walk you through the step-by-step process of installing Visual Studio Code on Debian 12. Additionally, we will also show you how to install it as a Flatpak package, a widely adopted Linux community software distribution format.
Which of the two methods should I choose? Well, it is entirely up to you. However, we recommend sticking with the native DEB format. So, let’s get started.
Install Visual Studio Code on Debian 12 “Bookworm”
This guide will use the sudo
command and assuming you have sudo privileges.
1. Install Prerequisites
Before we begin the installation, we must install some packages that will be required to be available on our Debian 12 system for the next steps.
To accomplish this, type the following APT commands to update the package base and install prerequisites:
sudo apt update
sudo apt install software-properties-common apt-transport-https wget gpg
Code language: Bash (bash)
2. Import Microsoft’s GPG Key
To ensure that the packages we receive for installing Visual Studio Code are genuine, we should download and import the Microsoft-signed GPG keys on our Debian 12 system.
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/packages.microsoft.gpg
Code language: Bash (bash)

Notice that none of the commands generate output.
3. Add Microsoft’s Visual Studio Code Repository
After importing Microsoft’s GPG keys, we’ll add the official Visual Studio Code repository to our Debian 12 system. This implies that the update package will be made available with the rest of your system’s regular updates if a new version is released.
To accomplish it, type the command shown below.
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
Code language: Bash (bash)

4. Run System Update
Before we proceed with VS Code installation on our Debian 12 system, we should update the list of available packages. Run the command below to update Debian’s repository index.
sudo apt update
Code language: Bash (bash)

5. Install VS Code on Debian 12
Everything is already prepared for the actual installation. To install VS Code on our Debian 12 “Bookworm” system, run the following command and wait for the installation to complete.
sudo apt install code
Code language: Bash (bash)

6. Run Visual Studio Code on Debian 12
You can start using VS Code by launching it from the desktop application menu. Search for “code,” and when its icon appears, click to run the same.

When you start VS Code for the first time, a window like the following should appear:

When setting up your interface, you will be asked to choose a theme and have the ability to personalize your IDE to match your preferences.
For example, you can modify font size, color scheme, and layout settings. Furthermore, you can install extensions that expand the IDE’s capabilities and features.
Doing so will enable you to tailor your development environment to your specific requirements, making your coding experience more efficient and enjoyable.
Uninstall VS Code
If you uninstall Visual Studio Code from your Debian system for any reason, you can do it easily by running the provided command below:
sudo apt remove code
Code language: Bash (bash)
Install Visual Studio Code as a Flatpak
Important notice: Please note that VS Code’s Flatpak version runs inside a container and cannot access SDKs on your host system.
Another way to install VS Code on Debian 12 is by using Flatpak, a universal packaging format that simplifies software distribution across different distributions.
However, if you don’t have Flatpak support added to your system, don’t worry. We’ve got you covered, and you can learn how to do it quickly and easily with our comprehensive guide on the subject.
First, add Flatpak support to your Debian 12 system:
sudo apt install flatpak
Code language: Bash (bash)

Then, enable the Flathub repository:
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Code language: Bash (bash)
Finally, run the following to install Visual Studio Code on your Debian 12 system as Flatpak:
flatpak install flathub com.visualstudio.code
Code language: Bash (bash)

Now, log out, log back in, and locate and run VS Code from the list of applications in the app launcher you are using.
Conclusion
In this guide, we have explored two different methods to install Visual Studio Code on Debian 12: as a native DEB package and using Flatpak. Each approach offers its own set of advantages, catering to users’ diverse needs and preferences.
For users seeking a straightforward and traditional installation process, the native DEB package method is the preferred approach. Leveraging Debian’s package manager, users can effortlessly install VS Code and benefit from system-wide integration, regular updates, and a seamless user experience.
On the other hand, the Flatpak approach appeals to those who prioritize application sandboxing and independent version management.
Thanks for your time! If you have any questions, please leave them in the comments section below. To learn more about Visual Studio Code, visit its official documentation page.
Hey Bobby, Thanks a lot, It was very helpful.
Thank you for creating this helpful tutorial!!
very nice and complete tutorial, hugs from Brazil!👋