How To Install VScode on Debian 12

Microsoft Visual Code is a lightweight open source, extensible source code editor that comes with built-in Git support. Since Linux distributions including Debian are also open source. Using Visual code on Debian is beneficial as it provides command-line tools that can integrate with VS Code extensions. This blog explains several methods for installing Visual Studio Code on Debian 12.

5 Ways to Install VS Code on Debian 12

The major benefit of installing VS Code on Debian is that one can remotely access Linux using the VS Code WSL extension on the Windows operating system. There are primarily 5 ways to install Visual Studio Code on Debian.

1:Through Deb File

The most preferable method to install VS Code on Debian is using the deb setup file, which can be downloaded from the Visual Studio Code official site. Here you can select the deb file for different architectures, so simply click on the suitable one:

Downloading VS Code Deb file on Debian

Next, a download pop-up will open and the file will begin to download:

Downloading VS Code deb file on Debian

Alternatively, the VS Code deb file can be downloaded on Debian using the wget utility and the download link as in the command below:

wget https://vscode.download.prss.microsoft.com/dbazure/download/stable/89de5a8d4d6205e5b11647eb6a74844ca23d2573/code_1.90.0-1717531825_amd64.deb

Downloading VS Code deb file using the terminal (deb file download link )

Now use the apt or dpkg package manager to install Visual Studio Code on Debian using its deb file:

sudo apt install ./code_1.90.0-1717531825_amd64.deb

Installing VS Code on Debian using its deb file

Once the code editor is installed on Debian, simply execute the code command or search for it in the application’s menu:

code

Launching Visual Studio Code on Debian 12 installed through its deb file

2: Through Debian Software Install

Another way to install applications using their deb files is by using Debian’s software install application. Here, to install VS Code on Debian, simply click on the Open With option from the VS Code deb file right-click menu:

Opening Visual Studio Code with Debian Software install app

Next, select the Software Install app and click on Open:

Opening VS Code with Debian Software install app

Now click on the Install icon to proceed with VS Code installation on Debian:

Installing VS Code on Debian using its deb file with Software Install app

Once the VS Code is installed, either click on the Open icon or search for VS Code in the application’s menu to launch it:

Launching Visual Studio Code on Debian 12 installed through Debian software Install app

3: Through VS Code Repository

Since by default VS Code is not present in the Debian default package installer, to install it via the apt app installer you can add VS Code to the official repository. To add Visual Studio Code repository on Debian, first download its GPG key by executing the following command:

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg

Downloading VS Code GPG key on Debian 12

Next, install the downloaded VS Code GPG key on Debian 12 by executing:

sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/keyrings/microsoft-archive-keyring.gpg

Installing Visual Studio Code GPG key on Debian for adding its repository.

Next, add the VS Code repository on Debian by linking the GPG key added previously:

sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'

Adding VS Code repository in Debian

To apply the changes in the repository of the apt package manager, you need to update the packages list:

sudo apt update

Updating Debian apt packages list to successfully add VS Code repository.

Now use the apt package manager to install VS Code on Debian by using the below command:

sudo apt-get install code

Here in the image below, you can see that apt is using the VS Code repository for its installation on Debian 12:

Installing Visual Studio Code on Debian using VS Code repository.

Now execute the code command to launch Visual Studio Code:

code

Launching Visual Studio Code on Debian 12 installed through VS Code repository

On the other hand, you can launch it by searching Visual Studio Code in Debian’s app menu:

Launching Visual Studio Code on Debian from its applications menu.

4: Through Flatpak App Installer

The fourth method to install Visual Studio Code on Debian 12 is using the Flathub repository and for that use:

flatpak install flathub com.visualstudio.code

Installing Visual Studio Code on Debian using Flatpak package Installer

To launch VS Code installed via Flatpak use the below command:

flatpak run com.visualstudio.code

Launching Visual Studio Code on Debian 12 installed through Flatpak

Note: VS Code on Flatpak is unverified, so you might face any issues while compiling codes or while using various extensions.

5: Through the Snap Package Installer

The Last method for installing Visual Studio Code on Debian is using Snap, which is a third-party app installer for Linux distributions. This package manager has the classic version of VS Code. To install it via Snap run the below given command:

sudo snap install code --classic

Installing Visual Studio Code on Debian using Snap package Installer

To verify the installation of VS Code on Debian, you can list the applications installed via Snap:

sudo snap list

Verifying the Visual Studio Code installation on Debian by listing apps installed via Snap Package manager

To launch the Visual Studio Code on installed via Snap reboot Debian and then execute the below command:

code

Launching VS Code on Debian 12 installed through Flatpak

Conclusion

The Visual Studio Code on Debian can be installed in 5 different ways. These include using its deb file, Debian software install app, VS Code repository, Flatpak, and Snap package manager. The recommended way among all is to install it using Visual Studio Code deb file. There are two reasons for this. One is that it does not use any third-party software and can also be installed via system GUI. Second, it will be the latest version.

Index
Scroll to Top