VS Code is available on Linux through official repositories, a Snap package, and community-maintained packages for Arch. This guide walks through the install steps for each major distribution. Choose the method that matches yours, verify the install, and you will have the editor ready in a few minutes.
Pick your install method
| Distribution | Recommended method |
|---|---|
| Ubuntu, Debian, Linux Mint, Pop!_OS | Official .deb repository |
| Fedora, RHEL, CentOS, Rocky Linux | Official .rpm repository |
| Arch Linux, Manjaro, EndeavourOS | AUR package |
| Any Linux distribution | Snap package |
All methods make the shell command available and receive updates through your package manager.
Debian and Ubuntu-based distributions
Add the Microsoft repository, then install with apt. First, download and install the Microsoft signing key:
sudo apt install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft.gpgThis command fetches the public key that verifies package authenticity and saves it directly in the system keyring directory.
With the signing key installed, create the repository file so apt knows where to find the package:
echo -e "Types: deb\nURIs: https://packages.microsoft.com/repos/code\nSuites: stable\nComponents: main\nArchitectures: amd64,arm64,armhf\nSigned-By: /usr/share/keyrings/microsoft.gpg" | sudo tee /etc/apt/sources.list.d/vscode.sources > /dev/nullThis creates the current deb822-format source file that apt reads for the VS Code repository.
Now install the package with apt:
sudo apt update
sudo apt install codeThe shell command is available immediately. Test it with code --version.
Fedora, RHEL, and CentOS-based distributions
Import the Microsoft signing key and add the repository configuration:
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\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc' | sudo tee /etc/yum.repos.d/vscode.repo > /dev/nullThis imports the GPG key and writes the repository to a file recognized by dnf. Once the repository is configured, install with:
sudo dnf check-update
sudo dnf install codeFor older RHEL or CentOS systems, use yum instead of dnf.
Replace dnf with yum in both commands above. This completes the repository-based install for RPM distributions.
Arch Linux
VS Code is available in the Arch User Repository. Install with an AUR helper:
yay -S visual-studio-code-binThis installs the official binary build from Microsoft. The package name pulls the prebuilt binary rather than building from source. Update it with yay -Syu like any other AUR package.
Snap package (any distribution)
If your distribution supports Snap, install from the Snap Store:
sudo snap install code --classicThe --classic flag is required. The editor needs classic confinement to access installed tools, shells, and the filesystem outside the Snap sandbox.
Snap updates the editor automatically in the background. No manual update step is needed.
Verify the installation
After installing through any method, confirm that the editor is ready.
- Open a terminal.
- Type
code --versionand press Enter. - You should see the version number, commit ID, and platform string.
To open a project from the terminal, create a test folder and open it:
mkdir ~/vscode-test && cd ~/vscode-test && code .The editor opens with the test folder loaded. Create a file, edit it, and save it to confirm everything works. Delete the test folder when done.
Troubleshooting
Command not found after install
If the shell command is not recognized after installing the .deb or .rpm package, close and reopen the terminal. The shell caches the old PATH and needs to reload.
For Snap installs, make sure /snap/bin is in your PATH. Add this line to your shell configuration file:
export PATH="$PATH:/snap/bin"ENOSPC error on large projects
If you see "Visual Studio Code is unable to watch for file changes in this large workspace", Linux has a low default limit on file watchers. Increase it:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -pConflicts with old repositories
If you previously used a third-party repository and see conflicting package errors, remove the old source file from the apt sources directory before adding the official Microsoft repository.
Next steps
The editor is running on Linux. Open a folder, install language extensions, and set up essential settings. Start with the beginner setup guide to configure Auto Save, pick a theme, enable Copilot, and create your first project.
If you also use macOS or Windows, see the macOS install guide.
Rune AI
Key Insights
- Use the official Microsoft repository for .deb or .rpm packages; auto-update comes with it.
- Arch users install from the AUR; Snap is available for any distribution.
- The code command is included automatically with .deb and .rpm installs.
- Test the install with code --version and open a folder with code .
Frequently Asked Questions
Which Linux package should I use?
Does VS Code auto-update on Linux?
How do I get the code command after installing?
Conclusion
VS Code is installed and running on Linux. The code command is ready. Open a project folder, install extensions, and sign in to GitHub Copilot. For the next step, set up essential settings and create your first project with the beginner setup guide.
More in this topic
How to Use VS Code with WSL 2 on Windows
Run VS Code connected to Windows Subsystem for Linux so you can develop in a full Linux environment with native tools, terminals, and debugging, all from Windows.
20 Best VS Code Extensions for Web Developers in 2026
Twenty carefully chosen VS Code extensions every web developer should know. Covers formatting, linting, frameworks, debugging, Git, and developer experience.
How to Install, Disable, Update, and Uninstall VS Code Extensions
Learn how to install, disable, update, and uninstall VS Code extensions from the Marketplace and the command line. Step-by-step instructions for every action.