VS Code is a lightweight, cross-platform code editor that supports hundreds of programming languages through extensions. It features syntax highlighting, auto-indentation, IntelliSense, and an integrated terminal, making it one of the most popular editors for development on Ubuntu 24.04.
Quick answer
The easiest way to install Visual Studio Code on Ubuntu 24.04 is Snap or App Center. If you want Microsoft’s official APT updates, install via the deb package or add the Microsoft repository so apt upgrade code keeps it current.
How to Install Visual Studio Code on Ubuntu 24.04
| Method | Command | Auto-updates | Notes |
|---|---|---|---|
| Snap | sudo snap install –classic code | Yes (snap refresh) | Simplest install |
| APT (Microsoft repo) | sudo apt install code | Yes (apt upgrade) | Full APT integration |
| deb file | sudo dpkg -i code_*.deb | No (download new deb) | Manual version control |
| App Center | GUI — search VS Code | Yes | Installs Snap version |
| Flatpak | flatpak install flathub com.visualstudio.code | Via flatpak update | Sandbox may limit SDK access |
Method 1: Installing VS Code on Ubuntu 24.04 Using the Snap Package Manager
Install VS Code with all dependencies via Snap:
sudo snap install --classic code

Verify the installation:
code --version

Run VS Code installed via Snap:
snap run code
Update the Snap-based VS Code:
sudo snap refresh code

Remove the Snap-based VS Code:
sudo snap remove code
Method 2: Install VS Code on Ubuntu 24.04 Using the APT Package Manager
This method adds Microsoft’s official repository so VS Code receives updates through standard apt upgrade.
Step 1: Update System Repositories
sudo apt update && sudo apt upgrade -y

Step 2: Add Visual Studio Code GPG Key
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
Add the Microsoft repository:
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt update
Step 3: Install Visual Studio Code
sudo apt install code

Upgrade and remove via APT:
sudo apt upgrade code
sudo apt remove code
Method 3: Install Visual Studio Code on Ubuntu 24.04 Using a deb File
Download the .deb file from the official VS Code website:

Navigate to the Downloads folder and install it:
cd Downloads
ls
sudo dpkg -i code_1.87.0-1709078641_amd64.deb

Note: Packages installed via deb file do not update automatically. To get a newer version, download and install the latest deb from the website.
Remove VS Code installed via deb:
sudo dpkg --remove code

Method 4: Install Visual Studio Code on Ubuntu 24.04 Using the App Center
VS Code is available in Ubuntu’s App Center. Open it, search for code, and click Install:

Note: VS Code installed via App Center can be updated and uninstalled from App Center directly.
Method 5: Install Visual Studio Code on Ubuntu 24.04 Using Flatpak
Flatpak distributes VS Code on most Linux distributions. Note that Flatpak’s sandboxing may require extra permissions for some developer workflows (terminal access, SDK paths).
Step 1: Install Flathub
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

sudo flatpak install flathub

Install VS Code from Flathub:
flatpak install flathub com.visualstudio.code

Update VS Code via Flatpak:
sudo flatpak update --app com.visualstudio.code

Run and remove VS Code via Flatpak:
flatpak run com.visualstudio.code
flatpak remove com.visualstudio.code
Which VS Code install method should you choose?
Use Snap or App Center when you want a simple desktop install with automatic updates. Use Microsoft’s APT repository when you want standard apt upgrade behavior and tighter system integration.
Flatpak works if most of your desktop apps come from Flathub, but some developer workflows may need extra permissions to access SDKs, terminals, or project folders outside the sandbox.