How to Install Visual Studio Code on Debian 13 (Trixie)
Install Microsoft Visual Studio Code on Debian 13 Trixie using the official APT repository, enable package-managed updates, and launch your editor from the desktop or terminal.
A reliable VS Code setup for Debian 13
Use Microsoft’s signed APT repository to install the code package. This approach integrates with Debian’s package manager, so future VS Code updates can be installed with your normal APT maintenance workflow.
Official package source
Use Microsoft’s documented repository and signing-key setup rather than an unknown third-party package.
APT-managed updates
Update VS Code with the same package-management workflow used for other Debian software.
Terminal or desktop
Launch the editor from your application menu or run code in a graphical desktop session.
Introduction
Visual Studio Code (VS Code) is a source-code editor with support for extensions, debugging, Git integration, and many programming languages. It can be used for web development, Python, shell scripts, infrastructure-as-code, and day-to-day configuration editing.
Debian 13, codenamed Trixie, is Debian’s stable release. Microsoft provides a Debian package and an APT repository for VS Code on supported Linux architectures. The repository method is convenient because it keeps the editor integrated with APT-based software maintenance. Microsoft’s Linux installation guide is the primary reference for the commands in this tutorial.
code package with APT. The commands below assume a standard Debian 13 installation and a user account with sudo privileges.Requirements
- A working Debian 13 (Trixie) installation with a supported desktop environment if you want to run the graphical editor.
- Internet connectivity to reach Microsoft’s package servers.
- A user account with
sudoprivileges. - APT package lists that can be refreshed successfully.
- A supported architecture, such as
amd64orarm64.
Step 1: Confirm Debian 13 Trixie
Open a terminal and check the installed operating-system release.
cat /etc/os-releaseLook for values similar to the following:
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
VERSION_CODENAME=trixieCheck the CPU architecture as well:
dpkg --print-architectureCommon results include amd64 for 64-bit Intel/AMD systems and arm64 for 64-bit ARM systems. Keep the reported architecture in mind when checking repository support.
Step 2: Update Debian and install prerequisites
Refresh the package lists and apply available updates before adding the repository.
sudo apt update
sudo apt upgradeInstall the tools needed to retrieve and install Microsoft’s signing key.
sudo apt install wget gpgIf Debian asks you to confirm the package changes, review the proposed actions and proceed if they are expected.
Step 3: Add Microsoft’s repository signing key
APT uses repository signing keys to verify package metadata. Download Microsoft’s public key and convert it to a keyring file that APT can reference.
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft.gpgConfirm the keyring file exists:
ls -l /usr/share/keyrings/microsoft.gpgSigned-By. Do not disable APT signature verification to work around repository errors.Step 4: Configure the VS Code APT repository
Create a dedicated APT source file for Microsoft’s stable VS Code repository.
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
EOFThis Deb822-format source entry points APT to Microsoft’s stable package repository and associates it with the signing key you installed in the previous step. The architecture list follows Microsoft’s published Linux installation instructions; if your machine uses an architecture not listed here, check the current official documentation before proceeding.
Refresh the package index so APT reads the new repository:
sudo apt updateCheck the output for signature errors, unreachable repository messages, or missing Release files. Resolve any errors before installing the application.
Step 5: Install Visual Studio Code
Install the stable VS Code package with APT:
sudo apt install codeReview the package summary and confirm the installation. APT will resolve the package dependencies and install VS Code from the configured source.
code command should be available in your shell.Step 6: Launch Visual Studio Code
Option A: Launch from the application menu
Open your desktop environment’s application launcher and search for Visual Studio Code or Code. Select the application to start the editor.
Option B: Launch from a terminal
Run the following command from a graphical desktop session:
codeTo open the current directory as a project:
mkdir -p ~/Projects/hello-debian
cd ~/Projects/hello-debian
code .The dot (.) tells VS Code to open the current working directory. If you are launching from a terminal without a graphical session, the desktop window may not appear; use a desktop session or a supported remote-development configuration.
Option C: Open a file
code README.mdIf the file does not exist, VS Code can create it when you save your work.
Step 7: Verify the installation
Check the installed version:
code --versionThe command should print a version number, a commit identifier, and the architecture. You can also ask APT which package is installed:
apt policy codeConfirm the installed version is shown under Installed and inspect the candidate version and repository details. Exact version numbers change as Microsoft publishes updates.
Updating and removing VS Code
Update VS Code with Debian packages
Because the repository is configured, refresh APT and upgrade packages as part of your normal maintenance routine:
sudo apt update
sudo apt upgradeReview the proposed changes before confirming. Microsoft notes that repository publication can occasionally lag behind a release, so the newest upstream version may not appear immediately.
Remove VS Code
If you no longer need the editor, remove the application package:
sudo apt remove codeTo remove the package and its system-level package configuration files, use sudo apt purge code. This does not automatically delete your personal projects. VS Code user settings and extensions are typically stored in your home directory; remove those separately only if you intentionally want to discard them.
Remove the repository (optional)
If you also want to stop receiving VS Code updates through this repository, remove its source file and refresh APT:
sudo rm /etc/apt/sources.list.d/vscode.sources
sudo apt updateOnly remove the Microsoft keyring if no other configured repository or software on your system relies on it.
Troubleshooting VS Code on Debian 13
Unable to locate package code
Check that the source file exists and is named correctly, then refresh APT:
cat /etc/apt/sources.list.d/vscode.sources
sudo apt update
apt policy codeLook for repository errors in the output of apt update.
Repository signature or key error
Verify the keyring file path in Signed-By matches the actual keyring location. Re-run the official key installation command if necessary. Do not bypass signature checks.
VS Code opens from the menu but not the terminal
Check whether the command is available on your PATH:
command -v code
code --versionIf the command is missing, inspect the package installation with dpkg -L code and check for installation errors.
Command runs but no window appears
Make sure you are in a graphical desktop session. A headless SSH terminal generally cannot display a local GUI application without a supported display or remote-development setup.
APT reports a network or TLS error
Check connectivity, DNS resolution, system date/time, proxy configuration, and access to packages.microsoft.com. Retry sudo apt update after correcting the underlying issue.
Trash or file deletion does not work in VS Code
Microsoft’s Linux guide notes that Debian installations may need additional desktop integration packages. If this specific issue occurs, review the current official guide and consider installing gvfs and libglib2.0-bin:
sudo apt install gvfs libglib2.0-binBest practices for using VS Code on Debian
- Prefer the official Microsoft APT repository and signed package metadata.
- Keep Debian and VS Code updated using APT and review package changes before accepting them.
- Install extensions only from sources you trust; extensions can access project files and execute code.
- Use Git or another version-control system for important projects.
- Avoid running VS Code as root for ordinary development. Open project directories with the permissions of your normal user.
- Back up important project files and keep credentials out of source control.
- For Python, Node.js, containers, or cloud tools, install and maintain those runtimes separately from the editor.
APT repository installation vs. downloading a DEB file
| Method | Advantages | Considerations |
|---|---|---|
| Official Microsoft APT repository | Integrates with APT and supports routine package updates. | Requires adding a repository source and signing key. |
Download the official .deb package | Useful for a one-off or offline-assisted installation when the package has already been downloaded. | Manual update management may be needed if the repository is not configured. |
| Third-party packages | May be convenient in a particular managed environment. | Verify the maintainer and trust model; do not assume third-party packages are official Microsoft builds. |
For most Debian 13 desktop users who want ongoing updates, the official APT repository is a practical default. Microsoft’s documentation also describes installing a downloaded Debian package using sudo apt install ./package-name.deb.
Frequently Asked Questions
Is Visual Studio Code compatible with Debian 13 Trixie?
Microsoft provides Linux installation instructions for Debian-based distributions. Confirm that your CPU architecture and system libraries meet the current requirements in the official documentation.
What is the recommended way to install VS Code on Debian 13?
For a typical desktop installation, configure Microsoft’s official APT repository and install the code package with sudo apt install code.
Will VS Code update automatically?
With the APT repository configured, new versions become available through the package manager. They are applied when you run the relevant APT update and upgrade commands or use your normal update tooling; publication can occasionally lag behind an upstream release.
Can I install VS Code without a graphical desktop?
The package can be installed on a headless system, but the standard VS Code desktop window requires a graphical session. For remote work, use a supported remote-development setup or another suitable workflow.
How do I open a project folder?
Navigate to the folder in a terminal and run code ., or use the editor’s Open Folder command.
Does VS Code include Python or Node.js?
No. Install the runtime or SDK your project needs separately, then add the relevant VS Code extensions if required.
Can I uninstall VS Code without deleting my projects?
Yes. Removing the code package does not normally remove project folders saved elsewhere in your home directory. Review your settings and extension directories separately if you also want to remove user data.
Conclusion
Installing Visual Studio Code on Debian 13 Trixie is straightforward with Microsoft’s official APT repository. After adding the signing key and repository source, install code, launch the editor, and verify the installation from the terminal.
Once VS Code is ready, configure Git, language runtimes, SDKs, and extensions to match your development workflow. Keep your operating system and editor updated, and use trusted package and extension sources.
wget and gpg → add Microsoft’s signing key → create vscode.sources → run sudo apt update → install code → launch and verify.Continue Learning Linux on VMoreCloud
Explore more Linux administration, open-source software, cloud computing, virtualization, and practical infrastructure tutorials.
Linux • Debian • Open Source • Azure • VMware • Windows Server
Sources & Further Reading
Technical note: Package names, supported architectures, and repository details can change. Check Microsoft’s official installation guide if the repository behaves differently or if you use an architecture not listed in this tutorial. Test commands in your own environment before using them on managed production systems.
