Read in 2 minutes

last updated 

How To Install Visual Studio Code on Ubuntu 18.04

Visual Studio Code is an open source cross-platform code editor developed by Microsoft. It has a built-in debugging support, embedded Git control, syntax highlighting, code completion, integrated terminal, code refactoring and snippets.

The easiest and recommended way to install Visual Studio Code on Ubuntu machines is to enable the VS Code repository and install the VS Code package through the command line.

Although this tutorial is written for Ubuntu 18.04 the same steps can be used for Ubuntu 16.04.

Prerequisites

Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges.

Installing Visual Studio Code on Ubuntu

To install Visual Studio Code on your Ubuntu system, follow these steps:

  1. First, update the packages index and install the dependencies by typing:

    sudo apt update
    sudo apt install software-properties-common apt-transport-https wget
  2. Next, install the Microsoft GPG key and Visual Studio Code repository using the following commands:

    wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
    sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
  3. Once the repository is enabled, install the latest version of Visual Studio Code with:

    sudo apt install code
Advertisement

Starting Visual Studio Code

Now that VS Code is installed on your Ubuntu system you can launch it either from the command line by typing code or by clicking on the VS Code icon (Activities -> Visual Studio Code).

When you start VS Code for the first time, a window like the following should appear:

You can now start installing extensions and configuring VS Code according to your preferences.

Conclusion

You have successfully installed VS Code on your Ubuntu 18.04 machine. To learn more about VS Code visit theit official documentation page.

If you have any question, please leave a comment below.