Visual Studio Code (VS Code) is Microsoft’s cross-platform code editor for Ubuntu—syntax highlighting, Git integration, debugging, and extensions from the Visual Studio Marketplace. It is not the same product as full Visual Studio IDE on Windows, and it is not shipped in the default Ubuntu archive under the name you expect.
This guide covers how to install VS Code on Ubuntu and download VS Code for Ubuntu through every supported path: the official packages.microsoft.com APT repository, a direct .deb, Snap, and VS Code Insiders. I ran the repository installs on Ubuntu 25.04 and ended with stable 1.126.0 (code) and Insiders 1.127.0 (code-insiders) from the same Microsoft repo.
Tested on: Ubuntu 25.04 (Plucky Puffin); kernel 6.14.0-37-generic.
apt search does not list Microsoft’s code package—you add Microsoft’s repository or use Snap. The must-have Ubuntu apps roundup notes that VS Code falls in that vendor/Snap bucket on current releases.
Quick command summary
| Task | Command |
|---|---|
| Add Microsoft APT repo | See Step 1 below |
| Install stable VS Code | sudo apt install -y code |
| Install VS Code Insiders | sudo apt install -y code-insiders |
| Check stable version | python3 -c "import json; print(json.load(open('/usr/share/code/resources/app/package.json'))['version'])" |
| Check Insiders version | code-insiders --version |
Download latest .deb |
wget -O code.deb https://update.code.visualstudio.com/latest/linux-deb-x64/stable |
Non-interactive .deb + repo |
echo "code code/add-microsoft-repo boolean true" | sudo debconf-set-selections then sudo apt install -y ./code.deb |
| Install via Snap (stable) | sudo snap install code --classic |
| Install via Snap (Insiders) | sudo snap install code-insiders --classic |
| Open current folder | code . |
| Remove APT stable | sudo apt purge -y code |
Prerequisites
- Ubuntu 22.04 LTS, 24.04 LTS, or newer (25.04 tested here). Microsoft publishes amd64, arm64, and armhf builds in the same repo.
- sudo and HTTPS access to
packages.microsoft.comandcode.visualstudio.com. - A desktop session (or X11/Wayland forwarding) if you want the graphical editor on the same machine. Pure SSH servers can still install the package for the
codeCLI and Remote SSH workflows from another computer. - About 195 MB download per package and ~870 MB installed under
/usr/share/code(similar size for Insiders). - Optional: Git and Node via nvm for typical web development stacks after the editor is installed.
Stable vs Insiders
| VS Code (stable) | VS Code Insiders | |
|---|---|---|
| APT package | code |
code-insiders |
| CLI | code |
code-insiders |
| Release cadence | Monthly stable + weekly patches | Daily insider builds |
| Config directory | ~/.config/Code |
~/.config/Code - Insiders |
| Best for | Production laptops, teaching labs | Preview features, extension authors |
You can install both from apt—they use different binaries and desktop entries (code.desktop and code-insiders.desktop).
Step 1: Add the official Microsoft APT repository
Microsoft documents a deb822 source file (not the older one-line deb format):
sudo apt-get install -y wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft.gpg
sudo tee /etc/apt/sources.list.d/vscode.sources > /dev/null <<'EOF'
Types: deb
URIs: https://packages.microsoft.com/repos/code
Suites: stable
Components: main
Architectures: amd64,arm64,armhf
Signed-By: /usr/share/keyrings/microsoft.gpg
EOF
sudo apt updateOn Ubuntu 25.04 the Microsoft repo indexed cleanly:
Get:7 https://packages.microsoft.com/repos/code stable InRelease [3,590 B]
Get:11 https://packages.microsoft.com/repos/code stable/main amd64 Packages [25.8 kB]Check candidates before install:
apt-cache policy code code-insiderscode:
Candidate: 1.126.0-1782208079
1.126.0-1782208079 500
500 https://packages.microsoft.com/repos/code stable/main amd64 Packages
code-insiders:
Candidate: 1.127.0-1782234876
1.127.0-1782234876 500
500 https://packages.microsoft.com/repos/code stable/main amd64 Packagesapt-cache policy shows an older build, wait or use the direct .deb URL temporarily.
Step 2: Install VS Code (stable) from APT
sudo apt-get install -y codeOn my host the download was about 195 MB and finished with:
Fetched 195 MB in 44s (4,466 kB/s)
Unpacking code (1.126.0-1782208079) ...
Setting up code (1.126.0-1782208079) ...Verify the package and on-disk version:
dpkg -l code
python3 -c "import json; print(json.load(open('/usr/share/code/resources/app/package.json'))['version'])"ii code 1.126.0-1782208079 amd64 Code editing. Redefined.
1.126.0The launcher lives at /usr/share/applications/code.desktop. The CLI wrapper is /usr/bin/code → /usr/share/code/bin/code.
Step 3: Install VS Code Insiders from APT
Use the same repository—only the package name changes:
sudo apt-get install -y code-insidersUnpacking code-insiders (1.127.0-1782234876) ...
Setting up code-insiders (1.127.0-1782234876) ...Insiders exposes a working --version on headless SSH where the stable Electron binary may exit without a display:
code-insiders --version1.127.0-insider
2858f2c0200dc2f4f87aca248c69daaf85f3ce69
x64Launch Insiders from the app menu (Visual Studio Code - Insiders) or with code-insiders ..
Alternative: download and install the .deb package
When you cannot add apt sources (golden image policy, air-gapped transfer, or one-off VM), download VS Code for Ubuntu from Microsoft:
cd ~/Downloads
wget -O code_amd64.deb https://update.code.visualstudio.com/latest/linux-deb-x64/stableThe redirect resolved to code_1.126.0-1782208079_amd64.deb when I checked headers.
For unattended installs that also register the Microsoft repo (so apt upgrade works later):
echo "code code/add-microsoft-repo boolean true" | sudo debconf-set-selections
sudo apt install -y ./code_amd64.debWithout that debconf line, the .deb postinst prompts whether to add the apt repository—fine in a desktop session, awkward in CI.
Alternative: Snap packages
Canonical hosts official Snap builds:
sudo snap install code --classic
sudo snap install code-insiders --classicsnap info code listed a classic confinement package (~447 MB) in June 2026. Snap refreshes VS Code automatically in the background.
Remove with:
sudo snap remove code
sudo snap remove code-insidersAvoid installing Snap and APT stable builds together unless you want two separate “Visual Studio Code” icons.
First launch and daily use
Graphical: open the app menu → Visual Studio Code (stable) or Visual Studio Code - Insiders.
Open a project folder from the terminal:
cd ~/projects/my-app
code .For Insiders:
code-insiders .Install an extension from the CLI:
code --install-extension ms-python.pythonUser settings, extensions, and caches live under ~/.config/Code (stable) or ~/.config/Code - Insiders. Sign in with a Microsoft or GitHub account from Accounts in the activity bar to sync settings when enabled.
Shell integration and default editor
After install, VS Code can install shell integration for bash/zsh when you run Terminal: Install Shell Integration from the Command Palette (Ctrl+Shift+P).
Set VS Code as the default plain-text editor (official Linux FAQ):
xdg-mime default code.desktop text/plain
sudo update-alternatives --install /usr/bin/editor editor $(which code) 10
sudo update-alternatives --set editor /usr/bin/codeOn Snap installs, use /snap/bin/code in the update-alternatives path instead.
Uninstall VS Code
APT stable:
sudo apt-get purge -y codeAPT Insiders:
sudo apt-get purge -y code-insidersA purge dry-run on stable reported:
The following packages will be REMOVED:
code*
Purg code [1.126.0-1782208079]Drop the repository when Microsoft updates are no longer wanted:
sudo rm -f /etc/apt/sources.list.d/vscode.sources /usr/share/keyrings/microsoft.gpgDelete local profile data only when you are sure:
rm -rf ~/.config/Code ~/.vscode
rm -rf ~/.config/Code\ -\ Insiders ~/.vscode-insidersTroubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
code: command not found after APT install |
PATH or wrong shell profile | Use /usr/share/code/bin/code; open a new terminal |
code opens Cursor or wrong binary |
Another IDE’s remote-cli/code earlier in PATH |
type code; call /usr/bin/code or adjust PATH order |
Missing X server or $DISPLAY on SSH |
No GUI on server | Use desktop locally, X forwarding, or Remote SSH from a workstation |
Unable to watch for file changes (ENOSPC) |
inotify watch limit | Raise fs.inotify.max_user_watches in /etc/sysctl.d/; exclude node_modules in settings |
Wrong code package from distro PPA |
Pop!_OS or third-party repo | Pin Microsoft origin in /etc/apt/preferences.d/code per Microsoft docs |
| Trash/delete fails in Explorer on Debian-based systems | Missing gvfs | sudo apt install gvfs libglib2.0-bin |
sources.list.d/vscode.list: No such file during .deb install |
Missing directory | sudo mkdir -p /etc/apt/sources.list.d |
Repo origin changed error on apt update |
Microsoft metadata rotation | Run sudo apt update and accept the prompt |
References
- Install VS Code on Linux (official)
- Download Visual Studio Code
- VS Code on Snapcraft (stable)
- VS Code Insiders on Snapcraft
- Set up GitHub with VS Code (on-site)
Summary
To install VS Code on Ubuntu, add Microsoft’s signed packages.microsoft.com/repos/code source as vscode.sources, run sudo apt install code, and launch from the app menu or with code .. I verified stable 1.126.0 and Insiders 1.127.0 on Ubuntu 25.04. For a download VS Code Ubuntu workflow without a repo, grab the latest linux-deb-x64 .deb and pre-accept the repo with debconf-set-selections. Snap with --classic is the quickest one-liner when you already use Snap. Pick stable for everyday work and Insiders when you need tomorrow’s features—both uninstall cleanly with apt purge.









