How to Install Visual Studio Code in Ubuntu

If you’re a programmer, chances are you already know the nuances and features of Visual Studio Code.

Here’s how to install VS Code on Ubuntu and its related distributions. For those who might be wondering what Visual Studio Code is all about, here’s a little primer on its build features.

What is Visual Studio Code?

Microsoft Visual Studio Code, as the name suggests, is an open-source code editor powered by Microsoft. It offers many debugging options to end users, including built-in Git control, as well as syntax highlighting, code completion, code refactoring, built-in terminal, and snippets.


Visual Studio Code, as a platform, syncs well with Windows, macOS, and even Linux.

There are three main ways to install Visual Studio Code on Ubuntu. The first method is to install it from the terminal, using the snap package. The second method is to use APT with the package repository provided by Microsoft. These repositories are aimed specifically at Linux users.

In the third method, you just use the desktop GUI to install the software on your system. Check out this comparison if you can’t decide between VS Code and Atom.

1. Installing VS Code Snap Package via Ubuntu Terminal

The snap package for Visual Studio Code on Linux is solely maintained and updated by Microsoft. This way you can always be sure to get the best quality software for yourself.

As a prerequisite, you must have Snap installed on your system. For those who don’t, here’s a brief introduction to the Snap Store and how to install Snap on Linux.

You can install snaps from the command line or through Ubuntu software.

To install the Visual Studio Code snap package, open the terminal and type the following command to start the installation process:

sudo snap install 

That’s it; Once the installation is complete, you can open Visual Studio Code from the terminal or the apps menu. VS Code comes with a host of features, and real-time code collaboration is one of the best.

2. Installing VS Code using APT on Ubuntu

Alternatively, you can install Visual Studio Code using Microsoft’s repository and the default package manager on Ubuntu, which is APT.

First, update all packages on your system using the following commands:

sudo apt update
sudo apt upgrade -y

Advanced users can also issue this code in a single line:

sudo apt update && sudo apt upgrade -y

Once you’ve updated and upgraded the packages, it’s time to install the necessary dependencies to add the repository. Type the following command in your terminal:

sudo apt install software-properties-common apt-transport-https wget

Then use wget to import the Microsoft GPG key:

wget -q https:

To enable the VS Code repository, run the following command:

sudo add-apt-repository "deb [arch=amd64] stable main"

As soon as the repository is activated, simply install the software package using:

sudo apt install code

To update your existing version of VS Code to the latest version available, run the update/upgrade commands like this:

sudo apt update && sudo apt upgrade -y

This will recognize the latest versions available and update your existing version to the latest version. To get the most out of VS Code after it’s installed, check out these essential productivity tips for Visual Studio Code.

3. Installing Visual Studio Code using the GUI

You can also install Microsoft Visual Studio Code from your desktop GUI. If you’re not a Terminal fan, using the desktop environment to install the package is your best bet.

To install Visual Studio Code, launch the Ubuntu Software application from the applications menu. To research Coded and select the first result. Then click on Install.

Once the installation is complete, you can open Visual Studio Code from the terminal or directly from the applications menu.

Using VS Code for the first time

After installation, as soon as you open VS Code on your Ubuntu machine, you will be greeted with the following screen:

If everything seems to be in order, you can install the extensions and configure the editor according to your preferences. Here are some great Visual Studio Code extensions to increase your efficiency.

Write code with Visual Studio Code in Ubuntu

You now know how to install Visual Studio Code on Ubuntu, and as you’ve seen, it’s a fairly straightforward process. Considering the different ways to install the packages, you can choose a process as you like so that you can download the software and use it whenever you want.

Visual Studio Code isn’t the only code editor available to you as a Linux user. You can test other editors and find the one that works best for you.

Comments are closed.