Visual Studio Code is a free, open-source, cross-platform code editor from Microsoft. It ships with built-in debugging, embedded Git integration, IntelliSense code completion, an integrated terminal, syntax highlighting, code refactoring, and snippet support.
VS Code is one of the most widely used code editors in the world across web development, Python, Go, Rust, Java, and dozens of other ecosystems, largely because of its fast-loading interface and well-maintained extension marketplace.
The recommended way to install Visual Studio Code on Ubuntu 18.04 is through the official Microsoft apt repository. This registers VS Code as a system package, keeps it updated automatically alongside your other packages, and gives you the stable release channel. The same steps work on Ubuntu 16.04.
<strong>Prerequisite:</strong> You need sudo access.
Install the required dependencies. These packages handle HTTPS transport for apt and GPG signature verification:
bashsudo apt updatesudo apt install gnupg2 software-properties-common apt-transport-https wget
Import the Microsoft GPG key. This step tells your system to trust packages signed by Microsoft. Without it, apt will refuse to install from the Microsoft repository:
bashwget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
Add the VS Code repository. Microsoft distributes VS Code through three release channels: stable, insiders-stable, and insiders-fast. The stable channel is the right choice for everyday development:
bashsudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
Install VS Code:
bashsudo apt updatesudo apt install code
The binary name is code, not vscode. This naming is consistent across all Linux distributions where VS Code is officially supported. Once installed, VS Code will appear in your application menu under the name “Visual Studio Code.”
Start VS Code from the Activities menu by searching for “Visual Studio Code,” or from the terminal:
bashcode
The first time VS Code opens, you land on the Welcome tab, which gives you quick access to the command palette, recent files, keyboard shortcuts, and extension recommendations.
Extensions are where VS Code becomes genuinely useful for serious development work. The built-in Extensions Marketplace holds over 50,000 extensions. A few categories worth setting up immediately:
Open the extension panel with Ctrl+Shift+X or click the four-squares icon in the left sidebar.
Because VS Code was installed through the Microsoft apt repository, future updates are delivered through the standard Ubuntu package management system. New versions appear in the Software Updater alongside other system updates.
To update VS Code from the terminal:
bashsudo apt updatesudo apt upgrade
To upgrade only VS Code without touching other packages:
bashsudo apt upgrade code
VS Code also includes a built-in Settings Sync feature that backs up your extensions, keybindings, themes, and workspace settings to your GitHub or Microsoft account. Enable it through File > Preferences > Settings Sync. Once enabled, any new VS Code installation signs in and restores your full environment automatically.
Visual Studio Code is now installed on your Ubuntu 18.04 system and set up to receive automatic updates. Install your language extensions, configure your settings, and enable Settings Sync to keep your environment consistent across machines. Leave a comment below if you run into any issues.
Nextcloud is a free, open-source, self-hosted file sharing and collaboration platform. It gives you a private…
Plex is a self-hosted streaming media server that organizes your video, music, and photo collections into…
Odoo is one of the most widely used open-source ERP platforms in the world. It handles…
Let's Encrypt is a free, automated, and open certificate authority run by the Internet Security Research…
Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server and reverse proxy. It handles…
Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server and reverse proxy. It handles…