Visual Studio Code (VS Code) is an open-source code editor developed by Microsoft. It is one of the most popular editors among developers and works for almost every language – Python, JavaScript, Go, C++, and many more.
VS Code comes with a solid set of built-in tools:
VS Code is cross-platform and runs on Windows, macOS, and Linux. This guide covers two ways to install VS Code on Ubuntu 20.04. The snap method is simpler and updates automatically. The apt method gives you more control over updates and fits better with a package-managed system. Pick the one that suits your workflow.
The snap method is the fastest way to get VS Code up and running. Snap packages are self-contained — they bundle all the dependencies the app needs, so you do not have to manage them separately.
The trade-off is that snap packages tend to have a larger disk footprint and a slightly slower startup time than a standard .deb package.
Install the VS Code snap with:
bashsudo snap install --classic code
The --classic flag gives VS Code full access to the system. VS Code needs this to work properly with your project files and local tools.
That is it. VS Code is installed and will update itself in the background whenever a new version comes out.
If you prefer not to use the terminal, open Ubuntu Software, search for “Visual Studio Code”, and install it from there using the graphical interface.
This method adds the official Microsoft apt repository to your system. It gives you more control — you decide when to update, and the package is managed the same way as any other software installed through apt.
First, install the required dependencies:
bashsudo apt updatesudo apt install software-properties-common apt-transport-https wget
Add the Microsoft GPG key so your system can verify the packages come from a trusted source:
bashwget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
Add the VS Code repository:
bashsudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
Install VS Code:
bashsudo apt install code
To update VS Code later, run the standard apt update and upgrade commands:
bashsudo apt updatesudo apt upgrade
Open the Activities search bar, type “Visual Studio Code”, and click the icon to open it.
You can also launch it from the terminal:
bashcode
To open a specific project folder, pass the path directly:
bashcode /path/to/your/project
Or use code . from inside a directory to open the current folder in VS Code.
The first time you open VS Code, the welcome screen appears. From there you can:
VS Code remembers your last workspace, so it picks up right where you left off each time you open it.
VS Code is now installed and ready on your Ubuntu machine. It works well straight out of the box and becomes even more powerful as you add extensions. Whether you are writing Python scripts, working with Docker, or building a web app, VS Code adapts to your workflow. Got questions? Leave a comment below.