Skip to content
Commitpedia
Log in Join & edit

Install Visual Studio Code on Linux, macOS and Windows

Install VS Code from Microsoft's packages, Homebrew or winget, get the code command working in the terminal, and add the extensions you need for your language.

Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?

Edit history of Install Visual Studio Code on Linux, macOS and Windows: 1 recorded edit
Edit history · 1 edit
Type
Article
Edits
1
Editors
1
First issued
15 Oct 2026
Last edit
15 Oct 2026
Reading
2 min

Which option to pick

Visual Studio Code is free and available as a native package for every desktop OS from code.visualstudio.com. On Linux prefer the .deb or .rpm package or Microsoft’s repository, which keep VS Code updated through your normal package manager; the Snap and Flatpak builds work but can lag and run in a sandbox that complicates using local toolchains. On macOS and Windows the download or the package manager command are equivalent. VS Code auto-updates itself on macOS and Windows. Note that the Marketplace VSCodium is a separate, telemetry-free build with its own extension gallery; the steps below are for VS Code itself.

Step: Linux

Debian and Ubuntu: download the .deb from the website, then install it with apt, which also registers Microsoft’s repository for future updates:

Check before you run this

  • Runs with administrator rights. Make sure you understand every line.
sudo apt install ./code_*.deb

Fedora and RHEL: add Microsoft’s repository and install:

Check before you run this

  • Runs with administrator rights. Make sure you understand every line.
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
printf '[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc\n' | sudo tee /etc/yum.repos.d/vscode.repo > /dev/null
sudo dnf check-update
sudo dnf install code

Snap, on any distribution that has it: sudo snap install --classic code. Arch Linux users can install the code package (the OSS build) or the visual-studio-code-bin package from the AUR for the Microsoft build.

Step: macOS

brew install --cask visual-studio-code

Or download the .zip, unzip it and drag Visual Studio Code.app into Applications. Then open VS Code, press Cmd+Shift+P, type Shell Command: Install ‘code’ command in PATH and run it, so code . works in the terminal. The Homebrew cask does this for you.

Step: Windows

winget install Microsoft.VisualStudioCode

Or run the User Installer from the website, which installs without administrator rights. Keep Add to PATH ticked; the options to add Open with Code to the Explorer context menu are convenient. Open a new terminal window afterwards.

Check it works

code --version
code .

The first command prints the version, commit and architecture; the second opens the current folder. Install extensions from the terminal too, for example:

code --install-extension ms-python.python
code --install-extension ms-azuretools.vscode-containers
code --list-extensions

Common problems

  • macOS: code: command not found: run the Shell Command: Install ‘code’ command in PATH action from the command palette.
  • Linux: VS Code warns about too few file watchers (ENOSPC) in big projects: raise the limit with echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/60-vscode.conf followed by sudo sysctl --system.
  • Linux Snap or Flatpak: the integrated terminal cannot find tools installed on the host, or Git prompts fail. Switch to the .deb/.rpm package, or configure the Flatpak to use the host shell.
  • Windows: the integrated terminal opens PowerShell but python or node are not found even though they are installed: VS Code inherited an old PATH. Close all VS Code windows and start it again from a new terminal.

Official documentation

Did this work for you?

No votes yet. Be the first.

If it did not work, the report form below tells the editors what went wrong.

See also

  • 0057 Shell cheat sheet: everyday commands A quick reference for moving around, managing files, viewing and searching text, checking processes and disk space in bash and zsh, with… Beginner · Cheat sheet · Linux, macOS Article Basics · Command-line tools 15 Oct 2026
  • 0076 jq recipes: 23 one-liners for JSON on the command line A runnable collection of jq filters for everyday JSON work: pick fields, filter with select, reshape, sort, count, group, pass shell variables,… Intermediate · Cheat sheet · Linux, macOS, Windows Script Command-line tools · jq & JSON on the command line 15 Oct 2026
  • 0386 Install Node.js on Linux, macOS and Windows Get Node.js and npm on any desktop OS. Use a version manager (nvm or fnm) when you work on several projects, or… Beginner · Step by step · Linux, macOS, Windows Article Installing languages & tools · Node.js 15 Oct 2026
  • 0387 Install Python on Linux, macOS and Windows Install a current Python 3 with pip and venv on each desktop OS, check the version, and avoid the classic traps: python… Beginner · Step by step · Linux, macOS, Windows Article Environments & packages · Installing languages & tools 15 Oct 2026
  • 0388 Install Go on Linux, macOS and Windows Install the Go toolchain from the official downloads or a package manager, set PATH so the go command and installed tools are… Beginner · Step by step · Linux, macOS, Windows Article Installing languages & tools 15 Oct 2026
  • 0389 Install Java (OpenJDK) on Linux, macOS and Windows Install a current long-term-support OpenJDK with the compiler included, make java and javac available on the command line, and switch between versions… Beginner · Step by step · Linux, macOS, Windows Article Installing languages & tools 15 Oct 2026

Repos in the wild

History

Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.

  1. Dominik +3,255 chars

Report a problem

Something wrong, unsafe or copied? Tell the editors.
What is wrong?