Skip to content
Follow
Ubuntu Linux

Install Visual Studio Code on Ubuntu: Step-by-Step Guide

Richard
Written by
Richard
May 25, 2022 Updated Sep 15, 2026 2 min read
How to Use Sticky Notes in Windows 11
How to Use Sticky Notes in Windows 11

Visual Studio Code on Ubuntu is a free source-code editor made by Microsoft that lets you write, test, and debug software projects. Setting up the official software repository method on Ubuntu 22.04 or 24.04 ensures that system updates run automatically so you always have access to the newest version.

Advertisement

The editor runs natively on Linux alongside Windows and macOS, bringing built-in tools like syntax highlighting, smart code completion, and integrated debugging support. You can install it on your Ubuntu machine in just a few minutes using the terminal and a handful of standard setup commands.

⚡ Quick Answer

Open your terminal and run `sudo snap install code –classic` to install VS Code via Snap. Alternatively, add the Microsoft APT repository and then run `sudo apt update && sudo apt install code`.

Advertisement

How to install VS Code on Ubuntu Linux

You can install VS Code using one of the two methods below. Most users prefer the first method.

Visual Studio Code installs through the Snap Store as the easiest way to get the code editor on Ubuntu. This method keeps the program updated automatically in the background without needing you to check for updates by hand. Open your terminal and run the install command to set it up in a few seconds.

  1. Open your terminal.
  2. Run this command: sudo snap install code --classic

Method 2Installing via APT Repository

Visual Studio Code installs using the APT repository as a reliable alternative that works with your standard system updates. This approach adds the Microsoft software repository to your computer so you get the latest features and security fixes through regular system updates. Check your system architecture first to make sure your computer supports the package.

📝Good to KnowFirst, check your system architecture to ensure compatibility: dpkg --print-architecture.

Most modern systems use amd64.

Advertisement

Install the necessary helper tools:

🐧Bash / Shell
sudo apt update && sudo apt install wget gpg

Now, import the Microsoft GPG key to your keyring folder:

🐧Bash / Shell
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg

Next, add the repository source file for your Ubuntu system:

⬛Command Prompt
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null

Finally, update your package list and install the editor:

Advertisement
🐧Bash / Shell
sudo apt update
sudo apt install code

VS Code is now installed. You can find it in your application menu.

Visual Studio Code interface running on an Ubuntu Linux desktop environment
vs code install on ubuntu

Post-Installation

After you install Visual Studio Code on Ubuntu, adding extensions can really boost your coding experience by adding new features.

  • Remote Development pack: Allows you to code on remote machines or inside containers.
  • GitHub Copilot: Uses AI to help you write code faster.

Conclusion

Visual Studio Code is a versatile, feature-rich code editor compatible with various platforms. Git control, syntax highlighting, and code completion are among the features supported by VS Code. By following these steps, developers can seamlessly install and utilize VS Code for their coding projects.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

📚 Related Tutorials

How to Install Ubuntu Linux
Ubuntu Linux How to Install Ubuntu Linux
Install Visual Studio Code Web on Ubuntu 24.04
Ubuntu Linux Install Visual Studio Code Web on Ubuntu 24.04
Advanced Windows 11 Guide for Developers
Windows Advanced Windows 11 Guide for Developers
How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *