How To

Install Visual Studio Code on Ubuntu 18.04: Microsoft Repo Setup

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>&nbsp;You need sudo access.

Install Visual Studio Code on Ubuntu: Add the Microsoft Repository

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: stableinsiders-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.”

Launch VS Code and Set Up Extensions

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:

  • Language support: Microsoft’s official extensions for Python, Go, Rust Analyzer, and C/C++ add full IntelliSense, linting, formatting, and debugger integration for each language
  • Remote development: The Remote Development extension pack lets you edit files on SSH servers, inside Docker containers, or in WSL directly from your local VS Code window
  • AI code completion: GitHub Copilot and IntelliCode provide AI-powered suggestions trained on large code repositories
  • Collaboration: Live Share lets multiple developers work in the same codebase simultaneously from different machines, without sharing screen

Open the extension panel with Ctrl+Shift+X or click the four-squares icon in the left sidebar.

Keep Visual Studio Code Updated

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.

Cyber Defence

Recent Posts

Install Nextcloud on Ubuntu 18.04 with Apache and MySQL

Nextcloud is a free, open-source, self-hosted file sharing and collaboration platform. It gives you a private…

44 minutes ago

Install Plex Media Server on Ubuntu 18.04: Step-by-Step Setup

Plex is a self-hosted streaming media server that organizes your video, music, and photo collections into…

49 minutes ago

Install Odoo 11 on Ubuntu 16.04 with Git and Python Virtualenv

Odoo is one of the most widely used open-source ERP platforms in the world. It handles…

59 minutes ago

Secure Nginx with Let’s Encrypt on Ubuntu 16.04: SSL Setup Guide

Let's Encrypt is a free, automated, and open certificate authority run by the Internet Security Research…

1 hour ago

Install Nginx on Ubuntu 16.04: UFW, PPA, and Config Structure

Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server and reverse proxy. It handles…

1 day ago

Install Nginx on Ubuntu 18.04: UFW, Service Control, and Config

Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server and reverse proxy. It handles…

1 day ago