How to Install VS Code on Ubuntu

LightNode
By LightNode · · Updated 2026-07-12

Quick Answer: Fastest Way to Install VS Code on Ubuntu

The quickest way to install Visual Studio Code on Ubuntu (26.04 LTS, 24.04 LTS, or 22.04 LTS) is to run a single Snap command, or to download the official .deb and install it with apt. Any of these three methods works on current Ubuntu releases:

  1. Snap (one command, auto-updates):

    sudo snap install code --classic
    
  2. Official .deb package — download it from code.visualstudio.com, then install it directly with apt (this also adds Microsoft's repo so VS Code updates with your system):

    sudo apt install ./code_*_amd64.deb
    
  3. Microsoft APT repository (best for scripted/server setups) — add Microsoft's signing key and repo, then install code:

    sudo apt install wget gpg
    wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft.gpg
    echo "deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null
    sudo apt update && sudo apt install code
    

After installing, launch VS Code by typing code in the terminal or opening it from the Applications menu. The detailed, step-by-step walkthrough for each method — including screenshots-free terminal instructions, post-install setup, and troubleshooting — is below.

Introduction

Visual Studio Code (VSCode) is a powerful, versatile, and free source-code editor developed by Microsoft. It has gained immense popularity among developers due to its lightweight nature, extensive feature set, and robust ecosystem of extensions. VSCode supports a wide array of programming languages and frameworks, making it an ideal choice for both beginners and experienced developers alike.

For Ubuntu users, installing VSCode opens up a world of possibilities in terms of code editing, debugging, and version control integration. Whether you're a web developer, a data scientist, or a system administrator, VSCode can significantly enhance your productivity and streamline your workflow.

In this guide, we'll walk you through the process of installing Visual Studio Code on Ubuntu. We'll cover multiple installation methods, ensuring that you can choose the one that best suits your needs and comfort level with the Ubuntu operating system.

Prerequisites

Before we dive into the installation process, let's ensure you have everything you need to successfully install Visual Studio Code on your Ubuntu system. Here are the prerequisites:

  1. Ubuntu Operating System:

    • VSCode runs on all currently supported Ubuntu releases, including Ubuntu 26.04 LTS (Resolute Raccoon, released April 23, 2026), 24.04 LTS (Noble Numbat), and 22.04 LTS (Jammy Jellyfish), as well as current non-LTS releases. Ubuntu 20.04 LTS still works, but its standard support ended on May 31, 2025, so it now receives updates only through Expanded Security Maintenance (Ubuntu Pro).
    • Ubuntu 18.04 LTS is no longer supported. Since VS Code 1.86 (January 2024) the editor requires glibc 2.28 or newer, and 18.04 ships glibc 2.27, so it can no longer run current builds — version 1.85 is the last release that works on 18.04.
    • Ensure your Ubuntu system is up to date by running sudo apt update && sudo apt upgrade in the terminal.
  2. Internet Connection:

    • A stable internet connection is required to download VSCode and its dependencies.
    • If you're on a metered connection, note that the current .deb download is approximately 190 MB.
  3. Basic Terminal Knowledge:

    • Some installation methods require using the command line.
    • Familiarity with basic terminal commands will be helpful.
  4. Sudo Privileges:

    • You'll need sudo access to install software on your Ubuntu system.
    • Ensure you know your system's sudo password.
  5. Adequate Disk Space:

    • Once installed, VSCode takes up roughly 400 MB of disk space.
    • Ensure you have sufficient free space on your system.
  6. Supported Architecture:

    • VSCode supports 64-bit systems.
    • To check your system architecture, run uname -m in the terminal. It should return x86_64.

Method 1: Install VSCode from Ubuntu Software Center

The Ubuntu Software Center provides a graphical interface for installing applications, making it an ideal choice for users who prefer a visual approach. Here's how to install Visual Studio Code using this method:

  1. Open Ubuntu Software Center:

    • Click on the Ubuntu Software icon in the dock or search for "Ubuntu Software" in the Activities overview.
  2. Search for VSCode:

    • Once the Software Center opens, click on the search bar at the top.
    • Type "Visual Studio Code" or simply "VSCode" and press Enter.
  3. Locate Visual Studio Code:

    • You should see Visual Studio Code in the search results.
    • It's usually listed with the official VSCode icon and published by Microsoft.
  4. Install VSCode:

    • Click on the Visual Studio Code entry to open its details page.
    • Click the "Install" button.
    • You may be prompted to enter your password to authorize the installation.
  5. Wait for the Installation to Complete:

    • The Software Center will download and install VSCode.
    • This process usually takes a few minutes, depending on your internet speed.
  6. Launch VSCode:

    • Once the installation is complete, you can click the "Launch" button in the Software Center.
    • Alternatively, you can find VSCode in your Applications menu or search for it in the Activities overview.

Method 2: Install VSCode using APT

Installing VSCode using APT (Advanced Package Tool) is a more robust method that ensures you get the latest version directly from Microsoft. This method involves adding Microsoft's official repository to your system. Here's how to do it:

  1. Update Package Index: Open a terminal and run the following command to ensure your package index is up-to-date:

    sudo apt update
    
  2. Install Dependencies: Install necessary dependencies by running:

    sudo apt install wget gpg apt-transport-https
    
  3. Import Microsoft GPG Key: Import Microsoft's GPG key and store it in the modern keyrings directory. (The older apt-key add command is deprecated and no longer works on Ubuntu 22.04 and newer, so use gpg --dearmor instead):

    wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft.gpg
    
  4. Add VSCode Repository: Enable the official VS Code repository, referencing the key you just added:

    echo "deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null
    
  5. Update Package Index Again: After adding the new repository, update the package index:

    sudo apt update
    
  6. Install VSCode: Finally, install Visual Studio Code:

    sudo apt install code
    
  7. Verify Installation: Once the installation is complete, you can verify it by checking the version:

    code --version
    

This method offers several advantages:

  • You'll always have access to the latest version of VSCode.
  • Updates will be managed through Ubuntu's standard update process.
  • It's easier to automate in scripts for system setup.

Method 3: Install VSCode using .deb package

Installing VSCode using a .deb package is another straightforward method. This approach is useful if you want to download the package first and install it later, or if you need to install VSCode on a machine without internet access. Here's how to do it:

  1. Download the .deb Package:

    • Open a web browser and go to the official Visual Studio Code website: https://code.visualstudio.com/
    • Click on the download button for Linux.
    • Select the .deb package for Ubuntu/Debian.
    • The download should start automatically.
  2. Locate the Downloaded File:

    • By default, the file should be in your Downloads folder.
    • The filename will look something like code_1.XX.X-XXXXXXXXXX_amd64.deb, where X represents version numbers.
  3. Install Using GUI (Option 1):

    • Once the download is complete, double-click on the .deb file.
    • This should open the Ubuntu Software Center.
    • Click on the "Install" button.
    • Enter your password when prompted to authorize the installation.
  4. Install Using Terminal (Option 2):

    • If you prefer using the terminal, the recommended way is to install the .deb package with apt, which automatically resolves any dependencies for you:
      sudo apt install ~/Downloads/code_1.XX.X-XXXXXXXXXX_amd64.deb
      
    • Replace the X's with the actual version number of your downloaded file (for the current 1.128 release the name looks like code_1.128.0-XXXXXXXXXX_amd64.deb, where the trailing digits are the build timestamp shown on the download page). This method also adds Microsoft's repository so VS Code stays updated through apt.
    • Alternatively, you can use dpkg and then fix any missing dependencies:
      sudo dpkg -i ~/Downloads/code_1.XX.X-XXXXXXXXXX_amd64.deb
      sudo apt install -f
      
  5. Verify the Installation:

    • After installation, you can verify it by opening VSCode from the Applications menu or by running code in the terminal.

This method has some advantages:

  • It allows for offline installation if you download the .deb file on another machine.
  • You have control over which version you install.
  • It's useful for mass deployment in organizations.

Method 4: Install VSCode using Snap

Snap packages are supported out of the box on Ubuntu 26.04, 24.04, and 22.04, making this the fastest single-command option. The VS Code snap is published and maintained by Microsoft, and it keeps itself updated automatically in the background. Here's how to use it:

  1. Install VSCode with Snap: Open a terminal and run:

    sudo snap install code --classic
    

    The --classic flag is required because VS Code needs broad access to your system to edit files and run tools outside the usual snap sandbox.

  2. Verify the Installation: Confirm the install by checking the version:

    code --version
    

This method has some advantages:

  • It's a single command with no repository setup required.
  • Updates are applied automatically in the background.
  • It works identically across current Ubuntu releases.

Post-Installation Steps

After successfully installing Visual Studio Code on your Ubuntu system, there are a few steps you might want to take to ensure the best experience:

  1. Launching VSCode:

    • You can launch VSCode in several ways:
      • Click on the VSCode icon in your Applications menu
      • Search for "Visual Studio Code" in the Activities overview
      • Use the terminal by typing code and pressing Enter
  2. Setting Up Command Line Integration:

    • VSCode can be launched from the terminal to open files or folders.
    • To enable this, open VSCode and:
      1. Press Ctrl+Shift+P to open the Command Palette
      2. Type "shell command" and select "Shell Command: Install 'code' command in PATH"
    • After this, you can use commands like code . to open the current directory in VSCode
  3. Installing Extensions:

    • VSCode's functionality can be extended with extensions.
    • To install extensions:
      1. Click on the Extensions icon in the left sidebar (or press Ctrl+Shift+X)
      2. Search for extensions you need (e.g., Python, C++, JavaScript)
      3. Click "Install" on the extensions you want
  4. Configuring Settings:

    • Customize VSCode to your liking:
      1. Go to File > Preferences > Settings (or press Ctrl+,)
      2. Here you can adjust various settings like theme, font size, indentation, etc.
  5. Updating VSCode:

    • If you installed via APT or Software Center:
      • VSCode will update automatically with your system updates
      • You can manually check for updates by running:
        sudo apt update
        sudo apt upgrade
        
    • If you installed via .deb package:
      • You'll need to download and install new versions manually
      • VSCode will notify you when updates are available
  6. Learning Keyboard Shortcuts:

    • VSCode has many useful keyboard shortcuts
    • View all shortcuts by going to File > Preferences > Keyboard Shortcuts
    • Some popular shortcuts:
      • Ctrl+P: Quick file opening
      • Ctrl+Shift+P: Command Palette
      • Ctrl+/: Toggle line comment

Install VSCode on Ubuntu

Frequently Asked Questions (FAQ)

Q: Is Visual Studio Code free to use?

A: Yes, Visual Studio Code is free and open-source software. It's available for use without any charge.

Q: Can I use VSCode for languages other than those made by Microsoft?

A: Absolutely! VSCode supports a wide range of programming languages through its extensible system. You can find extensions for languages like Python, Java, C++, Ruby, and many more.

Q: How do I uninstall VSCode if I no longer need it?

A: To uninstall VSCode, you can use the following command in the terminal:

sudo apt remove code

If you installed it via .deb package, you might need to use:

sudo dpkg -r code

Q: VSCode isn't recognizing my programming language. What should I do?

A: You may need to install the appropriate language extension. Open VSCode, go to the Extensions view (Ctrl+Shift+X), and search for your language to find and install the relevant extension.

Q: Can I sync my VSCode settings across multiple computers?

A: Yes, VSCode offers a Settings Sync feature. You can turn it on by clicking on the gear icon in the lower-left corner and selecting "Turn on Settings Sync."

Q: How often is VSCode updated?

A: Microsoft typically releases updates for VSCode on a monthly basis. These updates include bug fixes, performance improvements, and new features.

Q: Can I use VSCode for remote development?

A: Yes, VSCode supports remote development through its Remote Development extension pack. This allows you to use a container, remote machine, or Windows Subsystem for Linux (WSL) as a full-featured development environment.

Q: Is VSCode the same as Visual Studio?

A: No, VSCode (Visual Studio Code) is different from Visual Studio. VSCode is a lightweight, cross-platform code editor, while Visual Studio is a full-fledged Integrated Development Environment (IDE) primarily for Windows.

Q: Can I contribute to VSCode's development?

A: Yes, VSCode is open-source, and Microsoft welcomes contributions. You can find the source code and contribution guidelines on their GitHub repository.

Q: My system tray icon for VSCode is missing. How can I fix this?

A: This is a known issue on some Linux distributions. You can try installing the `libappindicator1` package:
```
sudo apt install libappindicator1
```
If that doesn't work, you might need to use a GNOME shell extension like "TopIcons Plus" to display the icon.