Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install Visual Studio Code on Linux

Install VS Code on Debian-based and Red Hat-based systems, or with Flatpak.

VPS and Cloud Servers1 min read11 screenshots

Debian and Ubuntu

Step 1: Update the package list

sudo apt update
Updating the repositories

Step 2: Install the dependencies

sudo apt install software-properties-common apt-transport-https wget gpg
Installing the dependencies

Step 3: Download the Microsoft key

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
Downloading the Microsoft key

Step 4: Install the key

sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
Installing the key

Step 5: Add the repository

echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list
Adding the VS Code repository

Step 6: Install VS Code

sudo apt update
Updating the package list
sudo apt install code
Installing VS Code

Step 7: Start it

Run code or open Visual Studio Code from the application menu.

VS Code running

Red Hat, CentOS, Fedora and AlmaLinux

sudo dnf update
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

Create the repository file:

sudo tee /etc/yum.repos.d/vscode.repo <<'REPO'
[code]
name=Visual Studio Code
baseurl=https://packages.microsoft.com/yumrepos/vscode
enabled=1
gpgcheck=1
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
REPO

Install:

sudo dnf install code

Flatpak

Add Flathub:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Adding the Flathub repository

Install and start:

flatpak install flathub com.visualstudio.code
flatpak run com.visualstudio.code
Installing VS Code with Flatpak
VS Code from Flatpak
Note: VS Code is a desktop app. On a server with no desktop, use SSH remote development from your own computer instead.

Quick recap

  • On Debian/Ubuntu, add the Microsoft repository and run sudo apt install code.
  • On Red Hat systems use dnf install code.