Visual Studio Code is a powerful open source code editor developed by Microsoft. It has built-in debugging support, embedded Git control, syntax highlighting, code completion, integrated terminals, code refactoring, and snippets.
Visual Studio Code Core is cross-platform, available on Windows, Linux, and macOS.
This guide shows two ways to install Visual Studio Code on Ubuntu 20.04. VS Code can be installed as a snap package through the Snapcraft store or as a deb package from the Microsoft repository.
Choose the installation method that is most suitable for your environment.
Install Visual Studio Code as a Snap Package
The Visual Studio Code snap package is distributed and managed by Microsoft.
Locked is a standalone software package that includes a binary of all the dependencies needed to run the application. Snap packages are easy to upgrade and secure. Unlike the standard deb package, snaps has a larger disk footprint and a longer application startup time.
The snap package can be installed from the command line or through the Ubuntu Software application.
To install the VS Code snap, open your terminal (Ctrl + Alt + T) and run the following command:
sudo snap install --classic code
There she is. Visual Studio Code has been installed on your Ubuntu machine, and you can start using it.
If you prefer to use a GUI, open the Ubuntu Software and search for “Visual Studio Code” and install the application:
Every time a new version is released, the Visual Studio Code package will automatically be updated in the background.
Install Visual Studio Code with apt
Visual Studio Code is available from the official Microsoft Apt repository. To install it, follow the steps below:
1. Update the package index and install dependencies by running the following command as a user with sudo privileges:
sudo apt update
sudo apt install software-properties-common apt-transport-https wget
2. Import the Microsoft GPG key using the following wget command:
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
And activate the Visual Studio Code repository by typing:
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
3. After the apt repository is activated, install the Visual Studio Code package:
sudo apt install code
When a new version is released, you can update the Visual Studio Code package through your standard desktop Software Update tool or by running the following command on your terminal:
sudo apt update
sudo apt upgrade
Start the Visual Studio code
In the Activity search bar type “Visual Studio Code” and click on the icon to launch the application.
When you start VS Code for the first time, a window like the following will appear:
You can now start installing extensions and configure the VS Code according to your preferences.
The VS code can also be launched from the command line by typing in the code.
We have explained how to install VS Code on Ubuntu 20.04.
You can now start installing new extensions and adjusting your workspace. To learn more about VS Code visit their official documentation page.
If you have questions, please leave a comment below.