Install VS Code on Ubuntu – Complete Guide

The fastest way to install VS Code on Ubuntu is sudo snap install --classic code. If you prefer updates through apt, add Microsoft’s repository and run sudo apt install code. Both give you the official Visual Studio Code build, and this guide shows each step.
Short version
# Option 1: snap (updates itself in the background)
sudo snap install --classic code
# Option 2: Microsoft apt repository (updates with apt upgrade)
sudo apt install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft.gpg
sudo tee /etc/apt/sources.list.d/vscode.sources > /dev/null <<'EOF'
Types: deb
URIs: https://packages.microsoft.com/repos/code
Suites: stable
Components: main
Architectures: amd64,arm64,armhf
Signed-By: /usr/share/keyrings/microsoft.gpg
EOF
sudo apt update
sudo apt install codeIf you are looking to install Visual Studio Code on Ubuntu, then congratulations: you have come to the right place. VS Code is a free and open-source editor ideal for modern web applications, and its user-friendly interface makes it an appealing choice. In this blog post, we will walk through the essential steps needed to install VS Code on Ubuntu quickly and reliably. Get ready to experience powerful editing tools while utilizing all of the great features of your Ubuntu system!
A great way to learn how to use VS Code is by using it! Therefore, we have created a whole tutorial series that uses the Astro JS Web Framework and VS Code!
Can I install VS Code on Ubuntu?
Yes, you can install VS Code on Ubuntu. There are two ways to go about this:
- Install VS Code on Ubuntu using the Ubuntu Software Center.
- Install VS Code on Ubuntu from the terminal.
There is no right or wrong way of installing VS Code. Choose the way you feel most comfortable with!
On a Mac, see install VS Code on macOS.
Install VS Code on Ubuntu from Ubuntu Software Center
Another option is to use the store app that ships with Ubuntu. It is called Ubuntu Software on 22.04 and App Center on newer releases. Either way, you install the same code snap that Microsoft publishes:
- Open Ubuntu Software or App Center.
- Click on the search bar and search for “Visual Studio Code.”
- Click on code and click on install.
The screenshot below shows the older Ubuntu Software Center. The current App Center looks different, but the steps are the same.

Install VS Code in Ubuntu from Terminal
To install VS Code on Ubuntu, follow these steps:
- Open a terminal and add the Microsoft signing key and the VS Code repository to your system:
sudo apt install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft.gpg
sudo tee /etc/apt/sources.list.d/vscode.sources > /dev/null <<'EOF'
Types: deb
URIs: https://packages.microsoft.com/repos/code
Suites: stable
Components: main
Architectures: amd64,arm64,armhf
Signed-By: /usr/share/keyrings/microsoft.gpg
EOF
The screenshot shows the older key and .list file setup. The commands above are the current ones from Microsoft’s documentation.
- Update the package list and install VS Code using the following commands:
sudo apt update
sudo apt install code- Once the installation is complete, you can launch VS Code by running the following command:
code
FAQ
Should I install VS Code with snap or apt?
Both are official Microsoft builds. The snap updates itself in the background, while the apt package updates whenever you run sudo apt upgrade. Pick apt if you want all updates in one place, and pick snap if you want the shortest setup.
How do I uninstall VS Code on Ubuntu?
For the apt version, run sudo apt remove code. To also remove the repository, delete /etc/apt/sources.list.d/vscode.sources and /usr/share/keyrings/microsoft.gpg. For the snap version, run sudo snap remove code.
Why does the code command say “command not found”?
Open a new terminal first, because the current one may have an old PATH. For the snap, make sure /snap/bin is in your PATH. For apt, run dpkg -l code to confirm the package installed.
Why does apt warn about the VS Code repository being configured multiple times?
You most likely have two source files for the same repository, for example one from the .deb installer and one from the manual setup. Keep one vscode file in /etc/apt/sources.list.d/, delete the other, and run sudo apt update again.
Does VS Code run on Ubuntu for ARM?
Yes. Microsoft’s repository includes arm64 and armhf builds, so the same apt commands work on a Raspberry Pi or other ARM machines running Ubuntu.
Summary
Visual Studio Code is a great code editor for both beginners as well as seasoned programmers. We highly recommend using VS Code if you just start learning to program!
- VS Code can be installed on Ubuntu using the Ubuntu Software Center or from the terminal.
- There is no right or wrong way to install VS Code; choose the method you’re most comfortable with.
More posts
All Web Development

