How To

Install Visual Studio Code on Ubuntu 24.04 / Debian 13

Visual Studio Code (VS Code) is the most popular code editor used by developers worldwide. Built by Microsoft, it is a free, open-source editor that supports hundreds of programming languages through extensions, has a built-in terminal, Git integration, and a massive extension marketplace. This guide covers multiple ways to install Visual Studio Code on Ubuntu 24.04 and Debian 13 – from the official Microsoft repository, Snap, and Flatpak.

Original content from computingforgeeks.com - post 7467

VS Code runs on Linux, macOS, and Windows. It offers features like IntelliSense code completion, integrated debugging, syntax highlighting, code refactoring, and remote development over SSH. The current stable release is version 1.112 (March 2026).

Prerequisites

Before starting, make sure you have the following:

  • A machine running Ubuntu 24.04 LTS or Debian 13 (Trixie)
  • A user account with sudo privileges
  • Internet access to download packages
  • A desktop environment (GNOME, KDE, XFCE, etc.) installed

Step 1: Install Visual Studio Code from Microsoft Repository (apt)

The recommended way to install VS Code on Ubuntu or Debian is from the official Microsoft apt repository. This method gives you automatic updates through apt upgrade and access to the latest stable releases.

First, update your package index and install the required dependencies:

sudo apt update
sudo apt install -y wget gpg apt-transport-https

Import the Microsoft GPG key used to verify package signatures:

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /usr/share/keyrings/packages.microsoft.gpg > /dev/null

Add the VS Code repository to your system sources:

echo "deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list

Update the package index again to pull in packages from the new repository, then install VS Code:

sudo apt update
sudo apt install -y code

Verify the installation by checking the installed version:

code --version

The output shows the VS Code version, commit hash, and architecture:

1.112.0
a1b2c3d4e5f6
x64

Launch VS Code from your application menu or run code in the terminal. To open a specific project directory, pass the path as an argument:

code /path/to/your/project

Step 2: Install Visual Studio Code via Snap

Snap provides a sandboxed installation of VS Code that auto-updates independently of your system package manager. This is a good option if you prefer isolated application packages. If you do not have Snap installed on your system, set it up first.

Install VS Code as a snap package with the classic confinement flag (required so VS Code can access your filesystem):

sudo snap install code --classic

After installation, verify the snap is active:

snap list code

You should see the VS Code snap listed with its version, revision, and tracking channel:

Name  Version  Rev   Tracking       Publisher   Notes
code  1.112.0  174   latest/stable  vscode✓     classic

Snap packages update automatically in the background. To trigger a manual update at any time, run:

sudo snap refresh code

Step 3: Install Visual Studio Code via Flatpak

Flatpak is another sandboxed packaging format available on most Linux distributions. It runs VS Code in an isolated environment with its own runtime libraries.

Install Flatpak and the Flathub repository if not already configured:

sudo apt install -y flatpak
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Install VS Code from Flathub:

flatpak install flathub com.visualstudio.code -y

Launch the Flatpak version from the terminal using:

flatpak run com.visualstudio.code

To update the Flatpak installation later:

flatpak update com.visualstudio.code

One thing to keep in mind – Flatpak runs VS Code inside a sandbox, so access to system files outside your home directory may require additional permissions. For full filesystem access, the apt or Snap method is easier to work with.

Step 4: Install Essential VS Code Extensions

Extensions are what make VS Code powerful beyond basic text editing. You can install extensions from the GUI (Extensions sidebar – Ctrl+Shift+X) or from the command line using the code --install-extension command.

Here are some of the most useful extensions for system administrators and developers. Install the Python extension for linting, debugging, and IntelliSense:

code --install-extension ms-python.python

Install the Go language extension for Go development:

code --install-extension golang.go

Install the Docker extension for managing containers, images, and compose files directly from VS Code:

code --install-extension ms-azuretools.vscode-docker

Install Remote – SSH for editing files on remote servers over SSH:

code --install-extension ms-vscode-remote.remote-ssh

Other extensions worth installing for sysadmin and DevOps work:

code --install-extension redhat.vscode-yaml
code --install-extension ms-kubernetes-tools.vscode-kubernetes-tools
code --install-extension hashicorp.terraform
code --install-extension ms-vscode.makefile-tools

List all installed extensions to confirm they are active:

code --list-extensions

The output lists each extension by its identifier:

golang.go
hashicorp.terraform
ms-azuretools.vscode-docker
ms-kubernetes-tools.vscode-kubernetes-tools
ms-python.python
ms-vscode-remote.remote-ssh
ms-vscode.makefile-tools
redhat.vscode-yaml

Step 5: Configure VS Code Settings (settings.json)

VS Code stores user settings in a JSON file at ~/.config/Code/User/settings.json. You can edit this file directly or open it from within VS Code using Ctrl+Shift+P and typing “Preferences: Open User Settings (JSON)”.

Open the settings file:

mkdir -p ~/.config/Code/User
vi ~/.config/Code/User/settings.json

Add or update these settings for a productive development environment:

{
    // Editor behavior
    "editor.fontSize": 14,
    "editor.tabSize": 4,
    "editor.insertSpaces": true,
    "editor.wordWrap": "on",
    "editor.formatOnSave": true,
    "editor.minimap.enabled": false,
    "editor.bracketPairColorization.enabled": true,
    "editor.guides.bracketPairs": true,

    // File handling
    "files.trimTrailingWhitespace": true,
    "files.insertFinalNewline": true,
    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 1000,

    // Terminal
    "terminal.integrated.fontSize": 13,
    "terminal.integrated.defaultProfile.linux": "bash",

    // Telemetry - disable if preferred
    "telemetry.telemetryLevel": "off",

    // Git
    "git.enableSmartCommit": true,
    "git.autofetch": true
}

Settings take effect immediately after saving the file. You can also configure workspace-specific settings by creating a .vscode/settings.json file in your project root – these override user settings for that project only.

Step 6: Integrated Terminal Setup

The integrated terminal in VS Code is one of its strongest features – you can run commands without leaving the editor. Open it with Ctrl+` (backtick) or from the menu under Terminal – New Terminal.

VS Code detects your default shell automatically. To change the default terminal profile, open settings (Ctrl+Shift+P – “Terminal: Select Default Profile”) and choose between bash, zsh, or any other shell installed on your system.

Split the terminal into multiple panes using Ctrl+Shift+5. This is useful when you need one terminal for running a service and another for testing. You can also rename terminal tabs by right-clicking the tab title.

To set a custom shell or pass arguments, add this to your settings.json:

{
    "terminal.integrated.profiles.linux": {
        "bash": {
            "path": "/bin/bash",
            "args": ["-l"]
        },
        "zsh": {
            "path": "/usr/bin/zsh"
        }
    },
    "terminal.integrated.defaultProfile.linux": "bash"
}

Useful terminal shortcuts to speed up your workflow:

  • Ctrl+` – Toggle terminal visibility
  • Ctrl+Shift+` – Create a new terminal instance
  • Ctrl+Shift+5 – Split the terminal pane
  • Ctrl+PageUp / PageDown – Switch between terminal tabs

Step 7: Remote Development with VS Code (SSH, WSL, Containers)

VS Code’s remote development extensions let you edit code on remote machines, inside containers, or within WSL as if everything were local. The editor runs on your desktop while the file system, terminal, and extensions operate on the remote target.

Remote – SSH

The Remote – SSH extension connects VS Code to any server you can reach via SSH. After installing the extension (Step 4), press Ctrl+Shift+P and select “Remote-SSH: Connect to Host”. Enter your SSH connection string:

ssh [email protected]

VS Code installs a lightweight server component on the remote machine automatically. Once connected, the file explorer shows the remote filesystem, the terminal runs commands on the remote host, and extensions execute remotely where they make sense (e.g., language servers run on the remote, UI extensions stay local).

For password-free access, set up SSH key authentication and add your connection to ~/.ssh/config:

Host myserver
    HostName 192.168.1.100
    User admin
    IdentityFile ~/.ssh/id_ed25519

The host name “myserver” then appears in the Remote-SSH connection list for quick access.

Dev Containers

The Dev Containers extension lets you develop inside a Docker container with a fully configured development environment. Create a .devcontainer/devcontainer.json file in your project:

{
    "name": "Python Dev",
    "image": "mcr.microsoft.com/devcontainers/python:3.12",
    "customizations": {
        "vscode": {
            "extensions": [
                "ms-python.python",
                "ms-python.vscode-pylance"
            ]
        }
    },
    "postCreateCommand": "pip install -r requirements.txt"
}

Open the project in VS Code, then press Ctrl+Shift+P and select “Dev Containers: Reopen in Container”. VS Code builds (or pulls) the container and connects to it. Every team member gets an identical development environment regardless of their host OS.

Step 8: VS Code vs VSCodium – Open-Source Alternative

VSCodium is a community-driven, fully open-source build of VS Code with Microsoft’s telemetry and proprietary code removed. The VS Code source code is MIT-licensed, but the official Microsoft build includes proprietary tracking and extensions marketplace connections.

Key differences between VS Code and VSCodium:

FeatureVS Code (Microsoft)VSCodium
LicenseMIT source, proprietary buildMIT (fully open-source build)
TelemetryEnabled by defaultDisabled completely
Extension marketplaceMicrosoft MarketplaceOpen VSX Registry
Remote extensionsFull supportNot available (proprietary)
GitHub CopilotSupportedNot available
UpdatesAutomatic via apt/snapManual or via repo

Install VSCodium on Ubuntu or Debian by adding the repository:

wget -qO- https://gitlab.com/nicedoc/vscodium-deb/-/raw/master/pub.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/vscodium-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/vscodium-archive-keyring.gpg] https://download.vscodium.com/debs vscodium main" | sudo tee /etc/apt/sources.list.d/vscodium.list
sudo apt update
sudo apt install -y codium

Launch VSCodium with the codium command. If you rely on Microsoft-specific extensions like Remote – SSH or GitHub Copilot, stick with the official VS Code build. VSCodium is a strong choice when privacy and open-source licensing matter more than access to proprietary extensions.

Step 9: VS Code Keyboard Shortcuts Reference

Learning keyboard shortcuts dramatically speeds up editing and navigation. Here are the most useful shortcuts for Linux:

ShortcutAction
Ctrl+Shift+POpen Command Palette
Ctrl+PQuick file open by name
Ctrl+Shift+EToggle file explorer sidebar
Ctrl+Shift+FSearch across all files
Ctrl+Shift+XOpen extensions panel
Ctrl+`Toggle integrated terminal
Ctrl+BToggle sidebar visibility
Ctrl+/Toggle line comment
Alt+Up/DownMove line up or down
Ctrl+Shift+KDelete entire line
Ctrl+DSelect next occurrence of word
Ctrl+Shift+LSelect all occurrences of word
F2Rename symbol across files
Ctrl+Shift+`Create new terminal
Ctrl+K Ctrl+SOpen keyboard shortcuts editor

To customize any shortcut, press Ctrl+K Ctrl+S to open the keyboard shortcuts editor. You can search for any action and rebind it to your preferred key combination. Custom keybindings are stored in ~/.config/Code/User/keybindings.json.

Conclusion

VS Code is installed and configured on your Ubuntu 24.04 or Debian 13 system. Whether you chose the apt repository for system-level integration, Snap for sandboxed auto-updates, or Flatpak for runtime isolation, VS Code works the same across all methods.

For a production development setup, configure SSH key authentication for remote development, set up workspace-specific settings for each project, and install only the extensions you actively use – too many extensions slow down the editor. Keep VS Code updated regularly to get the latest security patches and features.

Related Articles

Apache Configure Varnish Cache 7 on Ubuntu 22.04|20.04|18.04 Debian Build Open vSwitch from Source on Debian and Ubuntu Ubuntu How To Install VirtualBox on Ubuntu 24.04 Debian Encrypt Ubuntu or Debian Disk Partition using Cryptsetup

Leave a Comment

Press ESC to close