M
MeshWorld.
HowTo VS Code Visual Studio Code Ubuntu macOS Windows Install Editor Developer Tools 4 min read

How to Install VS Code on Ubuntu, macOS and Windows

By Vishnu Damwala

Visual Studio Code is one of the most installed developer tools in the world. Here’s how to install it cleanly on every major platform, and the first extensions worth adding once it’s running.


Install VS Code on Ubuntu / Debian Linux

This method keeps VS Code updated through apt upgrade like any other package.

# Install dependencies
sudo apt-get install wget gpg

# Add Microsoft's signing 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 VS Code 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'

# Install
sudo apt update
sudo apt install code

# Verify
code --version

Method 2: Snap

sudo snap install code --classic

Quick and simple. The --classic flag is required because VS Code needs access to your filesystem.

Method 3: Download the .deb directly

Go to code.visualstudio.com, download the .deb file, and install it:

sudo dpkg -i code_*.deb
sudo apt-get install -f   # fix any dependency issues

Install VS Code on macOS

brew install --cask visual-studio-code

VS Code will appear in your Applications folder and code will be available in the terminal.

Method 2: Direct download

  1. Go to code.visualstudio.com
  2. Download the macOS .zip
  3. Unzip it and drag Visual Studio Code.app to your Applications folder

To enable the code command in terminal:

  1. Open VS Code
  2. Open the Command Palette: Cmd + Shift + P
  3. Type shell command and select Shell Command: Install ‘code’ command in PATH

Install VS Code on Windows

Method 1: winget (fastest)

winget install Microsoft.VisualStudioCode

Restart your terminal after installation.

Method 2: Official installer

  1. Go to code.visualstudio.com
  2. Download the Windows installer (.exe)
  3. Run it

During installation, check these options:

  • Add “Open with Code” action to Windows Explorer file context menu
  • Add “Open with Code” action to Windows Explorer directory context menu
  • Add to PATH

These make daily use much smoother — right-click any folder to open it in VS Code.


Launch VS Code from the terminal

Once installed, you can open VS Code from any terminal:

code .          # open current directory
code file.js    # open a specific file
code ~/project  # open a specific folder

Essential extensions to install first

Open the Extensions panel with Ctrl+Shift+X (or Cmd+Shift+X on macOS) and search for these:

For all developers:

  • Prettier — automatic code formatting (esbenp.prettier-vscode)
  • ESLint — JavaScript/TypeScript linting (dbaeumer.vscode-eslint)
  • GitLens — supercharged Git integration (eamodio.gitlens)
  • Error Lens — shows errors inline (usernamehw.errorlens)

For web developers:

  • Astro — if you work with Astro (astro-build.astro-vscode)
  • Tailwind CSS IntelliSense — autocomplete for Tailwind classes (bradlc.vscode-tailwindcss)

For Python:

  • Python — the official Microsoft extension (ms-python.python)
  • Pylance — fast type checking (ms-python.vscode-pylance)

Install from the terminal:

code --install-extension esbenp.prettier-vscode
code --install-extension dbaeumer.vscode-eslint
code --install-extension eamodio.gitlens

Updating VS Code

VS Code updates itself automatically on macOS and Windows. On Linux:

apt:

sudo apt update && sudo apt upgrade code

Snap:

sudo snap refresh code

Open a project in VS Code from the terminal

The most common daily workflow:

cd ~/projects/my-app
code .

This opens the entire folder as a workspace. VS Code will pick up your .vscode/settings.json if it exists, applying project-specific settings automatically.

Set up Git next: How to Install Git on Ubuntu, macOS and Windows.