How to Install Visual Studio Code on Ubuntu

Learn how to install Visual Studio Code on Ubuntu using Snap, the official apt repository, or the .deb package. This step-by-step guide covers verification, extensions, troubleshooting, and maintenance for a smooth coding setup.

Install Manual
Install Manual Team
·5 min read
Quick AnswerFact

Goal: Install Visual Studio Code on Ubuntu. You can install via Snap with sudo snap install code --classic, or use the official .deb package from Microsoft by adding the repository and running apt update && apt install code. Ensure a user with sudo privileges and an active internet connection. This guide walks through each method.

Why Ubuntu users choose VS Code for development

According to Install Manual, vscode install ubuntu is a popular choice among developers who want a lightweight, extensible editor on Linux. Ubuntu users appreciate how tightly VS Code integrates with Git, terminal workflows, and a rich extension ecosystem. This section explains why VS Code remains a top option on Ubuntu and how you can tailor it to your workflow, whether you code in Python, JavaScript, Go, or C++. The goal is to give you a solid mental model for selecting the right installation method and getting up to speed quickly. By aligning with common developer toolchains, VS Code helps you stay focused on problem solving rather than tool setup. Install Manual’s approach emphasizes clarity, repeatability, and safe defaults so homeowners, DIY enthusiasts, and renters can onboard a development environment with confidence.

Snap installation: quick and effortless

Snap packages offer a universal, distro-agnostic way to install VS Code on Ubuntu. If you already have Snapd in place, you can install in a single command. For many users, this is the fastest path to a working editor without worrying about dependencies. The command is: sudo snap install code --classic. After installation, launch VS Code from the application launcher or by typing code in a terminal. Snap handles updates automatically, which reduces ongoing maintenance. However, some users notice slightly slower startup times or increased disk usage compared to native packages. If ease and speed matter most, the Snap route is a strong starting point, especially for new Ubuntu setups.

Installing via the official apt repository: reliable updates

For long-term maintenance and tighter system integration, installing from the Microsoft apt repository is recommended. Start by ensuring prerequisites: sudo apt update && sudo apt install -y software-properties-common apt-transport-https curl. Then add the Microsoft GPG key and repository, set up the source list, and install VS Code. The sequence typically looks like this: curl -sS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /usr/share/keyrings/packages.microsoft.gpg > /dev/null; echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main' | sudo tee /etc/apt/sources.list.d/vscode.list; sudo apt update; sudo apt install code. This method ensures you receive updates through your normal system update cadence, which many developers prefer. Install Manual recommends this path when you want cohesive upgrade management with other Ubuntu packages.

Manual .deb download: control and visibility

If you prefer not to rely on Snap or a repository, you can download the .deb installer directly from the official VS Code site and install with your package manager. This approach gives you explicit control over when you pull the installer, which can be helpful in air-gapped environments or where network policies restrict repositories. After downloading, install with sudo apt install ./code_<version>.deb or sudo dpkg -i code_<version>.deb followed by sudo apt --fix-broken install if needed to resolve dependencies. This method is widely supported on desktop Ubuntu setups and aligns with traditional Debian-based workflows.

Initial run: verify the install

Launch Code from the app launcher or by typing code in a terminal to confirm the GUI starts correctly. Run code --version to verify the binary is the expected build, and check that the command-line interface is functional (you can open the editor with a path: code /home/yourname/projects). If you encounter errors, revisit the installation method you used and ensure the repository keys or .deb packages were retrieved from official sources. Install Manual notes that validating a fresh install early helps prevent downstream configuration issues.

Setting up the command-line environment (code CLI)

The code CLI is a powerful way to work with projects directly from the terminal. If your installation method included adding to PATH, you can open a folder by running: code /path/to/project. You can also create or edit files with code --wait to ensure the editor returns control to the terminal after edits. Verifying that the code command is available prevents surprises during later configuration or automation tasks.

Extending VS Code: extensions and settings

Extensions unlock language support, linters, debuggers, and theme customization. Start by installing essential extensions for your language stack (for example, Python, JavaScript, or Go). Use the UI (Extensions view) or the CLI (code --install-extension ms-python.python) to add tools you rely on. Tweak settings to your workflow: enable autosave, configure linting rules, and adjust the integrated terminal to your shell preferences. Save these settings to a user profile so all future projects start with your preferred defaults. The Install Manual team emphasizes a minimal, opinionated setup to avoid feature creep and keep your coding flow smooth.

Troubleshooting common issues and quick fixes

If VS Code refuses to launch after installation, check your system logs and confirm that the correct package source is enabled. Common issues include missing dependencies, repository key errors, or conflicts between Snap and apt installations. For Snap: if code --help returns an error, ensure snapd is running and that the snap is allowed to access system resources. For apt: verify the repository signature and that the keyring file exists. In some cases, a clean reinstall using a different method (e.g., Snap vs apt) resolves the problem.

Performance tips and resource considerations

On modest systems, disable unnecessary extensions and avoid heavyweight themes that can slow down startup. Use the Built-in Performance profiler and check the process list to identify plugins consuming excessive CPU or memory during startup. If you run large projects, consider enabling file-based indexing selectively and increasing the memory limit for Node.js-based tooling if you develop with JavaScript/TypeScript. Regularly updating VS Code and its extensions helps maintain compatibility with newer Linux libraries and improves performance over time.

Security and maintenance: keeping VS Code healthy on Ubuntu

Always install VS Code from trusted sources (Snap, official repo, or .deb from the Microsoft site). Run system updates regularly: sudo apt update && sudo apt upgrade. Consider enabling automatic updates through your chosen method to ensure security patches are applied promptly. If you are in a restricted network, download the installer from a trusted machine and transfer it to the Ubuntu system via a secure method. The Install Manual team highlights that a predictable maintenance routine reduces the likelihood of drift between development tools and system libraries.

Tools & Materials

  • Ubuntu PC (20.04+ or 22.04 LTS)(Ensure you are on a supported Ubuntu release.)
  • Internet connection(Needed to download packages and repository keys.)
  • Sudo privileges(Required for system-wide installs and changes.)
  • Snapd (optional)(Needed if you plan to use the Snap method. Can install via apt if missing.)
  • VS Code installer options(Choose Snap, .deb, or official apt repository method.)
  • Web browser(For downloading installers and accessing documentation.)
  • Terminal or console app(Used for commands and scripting.)
  • Optional: a copy of the .deb or an external installer(Useful if offline installation is required.)

Steps

Estimated time: 15-25 minutes

  1. 1

    Update system package index

    Open a terminal and run sudo apt update && sudo apt upgrade -y to ensure all existing packages are current. This reduces the risk of dependency conflicts during VS Code installation.

    Tip: Run in a clean shell session to avoid environment surprises.
  2. 2

    Install Snapd if not present

    Install Snapd with sudo apt install snapd and enable it so you can use the Snap method for VS Code installation.

    Tip: If you already use Snap for other apps, this step is already done.
  3. 3

    Install VS Code via Snap (fast path)

    Run sudo snap install code --classic to install the stable VS Code build with classic confinement.

    Tip: This method updates automatically; no manual maintenance is needed for routine updates.
  4. 4

    Alternative: add Microsoft apt repo for VS Code

    If you prefer system-managed updates, add the Microsoft GPG key and repository, then install via apt.

    Tip: Follow exact commands from the official docs to avoid signature errors.
  5. 5

    Add the Microsoft GPG key and repository

    Execute curl -sS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /usr/share/keyrings/packages.microsoft.gpg > /dev/null and then add the apt source entry for vscode.

    Tip: Double-check the keyring path and the repository URL to prevent installation failures.
  6. 6

    Install via apt (repository method)

    Update apt and install with sudo apt update && sudo apt install code.

    Tip: If you see 'code is already the newest version', you are up to date.
  7. 7

    Alternative: install the .deb package directly

    Download code_<version>.deb from the official site and install with sudo apt install ./code_<version>.deb.

    Tip: Resolve dependencies with sudo apt --fix-broken install if needed.
  8. 8

    Verify the installation

    Launch VS Code from the launcher or run code --version in the terminal to confirm the installation.

    Tip: Open a sample project to verify the editor loads and extensions respond.
  9. 9

    Enable CLI usage and open folders

    Ensure code is in your PATH, then open a folder with code /path/to/project.

    Tip: Use code -r to reopen the last active project; it saves time on repetitive tasks.
  10. 10

    Install essential extensions

    Install language-specific extensions (e.g., Python, JavaScript/TypeScript, Go) to boost productivity.

    Tip: Install only a few essential extensions to avoid bloat.
  11. 11

    Configure user settings for consistency

    Open Settings and customize autosave, linting, formatting, and terminal integration to your workflow.

    Tip: Sync settings across devices using a Microsoft, GitHub, or similar account.
Pro Tip: Choose the install method that matches your maintenance preference: Snap for simplicity, apt for control.
Warning: Avoid mixing Snap and apt installations of the same software to prevent conflicts.
Note: Always verify the source URLs and GPG keys before adding repositories.

Got Questions?

Is VS Code free to use on Ubuntu?

Yes. Visual Studio Code is free to install and use on Ubuntu through official channels like Snap, the Microsoft repository, or the .deb package. The editor itself and most extensions do not require a paid license.

Yes, VS Code is free to use on Ubuntu via Snap or other official installation methods.

What is the difference between the Snap and apt methods?

Snap provides a quick setup with automatic updates, while the apt method offers tighter integration with your system and control over when updates occur. Snap may consume more disk space and sometimes startup slightly slower.

Snap is easy and automatic; apt is more integrated and controllable.

Can I install VS Code on ARM-based Ubuntu?

Yes. Visual Studio Code supports ARM64 builds on supported Ubuntu releases. Snap and the official repository typically provide ARM64 packages, but confirm the platform in your download source.

Yes, ARM64 is supported with the right package source.

How do I update VS Code after installation?

If you used Snap, updates come automatically. If you used the apt method, update via sudo apt update && sudo apt upgrade, or use your system's update manager.

Updates come automatically with Snap or via your system's package manager if you used apt.

How do I uninstall VS Code if needed?

To remove VS Code, use the same method you installed with. For Snap: sudo snap remove code. For apt: sudo apt remove code. You can also delete residual config files if needed.

Use the same method you installed with to uninstall.

Where can I find official guidance for installing VS Code on Ubuntu?

Refer to Microsoft's documentation for VS Code on Linux and the Ubuntu package guidelines. Always download installers from the official sources to avoid security risks.

Check the official VS Code Linux installation docs for Ubuntu.

Watch Video

Main Points

  • Choose Snap for quick setup or repo-based installs for controlled updates
  • Verify installation with code --version and launch VS Code to confirm readiness
  • Keep VS Code and extensions updated via your chosen method
  • Install essential extensions to start productive coding
Process diagram showing VS Code installation on Ubuntu
Install VS Code on Ubuntu via Snap, apt, or .deb

Related Articles