Explore Agentic Development -

Visual Studio Code on Linux

Installation

  1. Download and install Visual Studio Code for your Linux distribution

    Note

    VS Code ships weekly releases and supports auto-update when a new release is available.

  2. Install additional components

    Install Git, Node.js, TypeScript, language runtimes, and more.

  3. Install VS Code extensions from the Visual Studio Marketplace

    Customize VS Code with themes, formatters, language extensions and debuggers for your favorite languages, and more.

  4. Enable AI features

    Tip

    If you don't yet have a Copilot subscription, you can use Copilot for free by signing up for the Copilot Free plan and get a monthly limit of inline suggestions and chat interactions.

  5. Get started with the VS Code tutorial

    Discover the user interface and key features of VS Code.

Install VS Code on Linux

Debian and Ubuntu based distributions

  1. The easiest way to install Visual Studio Code for Debian/Ubuntu based distributions is to download and install the .deb package (64-bit), either through the graphical software center if it's available, or through the command line with:

    sudo apt install ./<file>.deb
    
    # If you're on an older Linux distribution, you will need to run this instead:
    # sudo dpkg -i <file>.deb
    # sudo apt-get install -f # Install dependencies
    
    Note

    Other binaries are also available on the VS Code download page.

    When you install the .deb package, it prompts to install the apt repository and signing key to enable auto-updating using the system's package manager.

  2. To automatically install the apt repository and signing key, such as on a non-interactive terminal, run the following command first:

    echo "code code/add-microsoft-repo boolean true" | sudo debconf-set-selections
    
  3. To manually install the apt repository:

    1. Run the following script to install the signing key:

      sudo apt-get install wget gpg &&
      wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg &&
      sudo install -D -o root -g root -m 644 microsoft.gpg /usr/share/keyrings/microsoft.gpg &&
      rm -f microsoft.gpg
      
    2. Create a /etc/apt/sources.list.d/vscode.sources file with the following contents to add a reference to the upstream package repository:

      Types: deb
      URIs: https://packages.microsoft.com/repos/code
      Suites: stable
      Components: main
      Architectures: amd64,arm64,armhf
      Signed-By: /usr/share/keyrings/microsoft.gpg
      
    3. Lastly, update the package cache and install the package:

      sudo apt install apt-transport-https &&
      sudo apt update &&
      sudo apt install code # or code-insiders
      
Note

Due to the manual signing process and the publishing system we use, the Debian repo could lag behind by up to three hours and not immediately get the latest version of VS Code.

RHEL, Fedora, and CentOS based distributions

We currently ship the stable 64-bit VS Code for RHEL, Fedora, or CentOS based distributions in a yum repository.

  1. Install the key and yum repository by running the following script:

    sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc &&
    echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\nautorefresh=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/vscode.repo > /dev/null
    
  2. Then update the package cache and install the package using dnf (Fedora 22 and above):

    dnf check-update &&
    sudo dnf install code # or code-insiders
    

    Or on older versions using yum:

    yum check-update &&
    sudo yum install code # or code-insiders
    
Note

Due to the manual signing process and the publishing system we use, the yum repo could lag behind by up to three hours and not immediately get the latest version of VS Code.

Snap

VS Code is officially distributed as a Snap package in the Snap Store

Get it from the Snap Store

You can install it by running:

sudo snap install --classic code # or code-insiders

Once installed, the Snap daemon takes care of automatically updating VS Code in the background. You get an in-product update notification whenever a new update is available.

Note

If snap isn't available in your Linux distribution, check the Installing snapd guide, which can help you get that set up.

Learn more about snaps from the official Snap Documentation.

openSUSE and SLE-based distributions

The yum repository mentioned previously also works for openSUSE and SLE-based systems.

  1. Install the key and yum repository by running the following script:

    sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc &&
    echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\nautorefresh=1\ntype=rpm-md\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/zypp/repos.d/vscode.repo > /dev/null
    
  2. Then update the package cache and install the package using:

    sudo zypper install code
    

AUR package for Arch Linux

There is a community-maintained Arch User Repository package for VS Code.

To get more information about the installation from the AUR, consult the following wiki entry: Install AUR Packages.

Nix package for NixOS (or any Linux distribution using Nix package manager)

There is a community-maintained VS Code Nix package in the nixpkgs repository.

To install it by using Nix:

  1. Set allowUnfree option to true in your config.nix

  2. Run the following command:

    nix-env -i vscode
    

Install the .rpm package manually

You can manually download and install the VS Code .rpm package (64-bit), however, auto-updating won't work unless the repository above is installed.

Once downloaded, the .rpm package can be installed by using your package manager, for example with dnf:

sudo dnf install <file>.rpm
Note

Other binaries are also available on the VS Code download page.

Updates

VS Code ships weekly and you can see when a new release is available by checking the release notes. If the VS Code repository was installed correctly, then your system package manager should handle auto-updating in the same way as other packages on the system.

Note

Updates are automatic and run in the background for the Snap package.

Configure VS Code as the default text editor

xdg-open

You can set the default text editor for text files (text/plain) that is used by xdg-open with the following command:

xdg-mime default code.desktop text/plain

Debian alternatives system

Debian-based distributions allow setting a default editor by using the Debian alternatives system, without concern for the MIME type. You can set this by running the following command and selecting code:

sudo update-alternatives --set editor /usr/bin/code

If you've installed VS Code with the Snap package, use this command instead:

sudo update-alternatives --set editor /snap/bin/code

If VS Code doesn't show up as an alternative to the default editor, you need to register it:

sudo update-alternatives --install /usr/bin/editor editor $(which code) 10

Use the custom title bar

The custom title bar provides many benefits, including great theming support and better accessibility through keyboard navigation and screen readers. These benefits might not always translate as well to the Linux platform. Linux has various desktop environments and window managers that can make the VS Code theming look foreign to users. Therefore, the custom title bar isn't enabled by default on Linux.

For users needing the accessibility improvements, we recommend enabling the custom title bar when running in accessibility mode using a screen reader.

You can manually configure the title bar with the Window: Title Bar Style ( window.titleBarStyle