Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 40 ยท Getting Started

Installing VS Code and First Launch

Install Visual Studio Code on Windows, macOS or Linux, add the code command to your shell, choose the right installer options and finish a first-launch checklist.

Installing VS Code takes a few minutes and needs no account. This lesson walks through each platform, the installer options worth ticking, the code command that opens files from a terminal, and a short checklist for your first launch.

Download the right build

Get the installer from the official download page at code.visualstudio.com. You will see builds for each platform and a choice of Stable or Insiders. Stable is the monthly release and is the right choice for nearly everyone. Insiders is a nightly build for people who want new features early; it installs side by side with Stable and uses its own settings.

On Windows there are two installer types:

Type Installs for Admin rights Updates
User installer Only your account Not needed Automatic, in the background
System installer All users Needed Managed through the installer

The User installer is the default recommendation: it updates itself without administrator prompts. Also pick the matching processor type (x64 or Arm64).

Windows

  1. Run the installer and accept the license.
  2. On the Select Additional Tasks page, tick 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 (usually already ticked)
  3. Finish the wizard and launch VS Code.

The two context-menu options let you right-click any file or folder and open it. The PATH option is what makes the code command work in a terminal.

macOS

  1. Download the .zip, extract it and drag Visual Studio Code.app into the Applications folder.
  2. Open it from Applications or Launchpad. On first launch macOS asks you to confirm that you want to open an app downloaded from the internet.
  3. To use code in the terminal, open the Command Palette (Cmd+Shift+P) and run Shell Command: Install 'code' command in PATH.

On macOS the Command key replaces Ctrl in nearly all shortcuts (Cmd+P, Cmd+Shift+P, Cmd+,). This course shows the Windows and Linux shortcuts and mentions Cmd where it matters.

Linux

Most distributions are supported through packages:

  • Debian and Ubuntu: download the .deb and install it, or add Microsoft's apt repository so updates arrive with system updates.
  • Fedora, RHEL, openSUSE: use the .rpm or the Microsoft yum repository.
  • Snap (code --classic) and Flatpak builds also exist.

The package places a code command on your PATH automatically. Note that Snap and Flatpak versions run in a sandbox, which can complicate access to system tools in the integrated terminal.

The code command

Once installed, open a terminal and try:

Terminal
code .                  # open the current folder
code notes.txt          # open (or create) a file
code -r .               # reuse the last window
code -n project         # open a folder in a new window
code --diff a.txt b.txt # compare two files
code --goto app.js:42:5 # open at line 42, column 5
code --list-extensions  # show installed extensions
code --version

code . is the command you will type most often: it opens the current directory as a project. If the terminal says code: command not found, restart the terminal first (PATH changes only reach new shells), then re-run the install step above.

A stand-in to practise the command line

You cannot run the real code here, but this small JavaScript parser models how a command line is split into options and targets, which helps you read the table above.

JS Stand-in: reading a code command line

Press Run (or Ctrl + Enter) to see the console output here.

No output.

First launch checklist

When VS Code opens for the first time you see the Welcome (or Get Started) tab. Work through this short list:

  1. Choose a color theme. The Welcome page offers one; you can change it later with Ctrl+K Ctrl+T (see Themes, Fonts and Icons).
  2. Open a folder with File > Open Folder (Ctrl+K Ctrl+O). VS Code works best with a project folder, not single files. See Opening Folders and Workspaces.
  3. Install a language extension if you need one. Opening a .py file, for example, suggests the Python extension in a pop-up.
  4. Turn on Auto Save from File > Auto Save so you never lose edits.
  5. Learn one shortcut: Ctrl+Shift+P opens the Command Palette. Everything else can be found from there (Command Palette).
  6. Check for updates. Windows and Linux builds update themselves; on macOS the Code menu has Check for Updates. Updates need a restart to apply.

Telemetry and privacy

VS Code can send usage data to Microsoft. You control it with the setting telemetry.telemetryLevel (values all, error, crash, off). Some extensions collect their own data under separate settings, so check their pages if privacy matters to you.

Sign in (optional)

An account is not required. Signing in with a GitHub or Microsoft account enables Settings Sync, which copies your settings, shortcuts, snippets and extensions to other computers. It is optional and can be turned on later.

Troubleshooting

  • code not found: reinstall with the PATH option, or on macOS run the install-command step; restart the terminal.
  • Blurry text on a high-DPI screen: check the window.zoomLevel setting and your operating system's scaling.
  • Starts slowly: run code --disable-extensions to test whether an extension is to blame, then use Developer: Show Running Extensions from the Command Palette.
  • Strange behavior after an update: Help > Toggle Developer Tools shows errors, and code --verbose prints startup details.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which Windows installer option lets the terminal find the code command?

    Adding VS Code to PATH is what makes the code command available in a terminal.
  2. 2. What does the command code . do?

    The dot means the current directory, so the folder is opened as a project.
  3. 3. How do you install the code command on macOS?

    macOS needs the shell command to be installed from the Command Palette.
  4. 4. Which build is meant for people who want new features early?

    Insiders is the nightly build; Stable is the monthly release.

Summary

  • Install Stable from the official site; on Windows prefer the User installer.
  • Tick the PATH and context-menu options so code . and right-click opening work.
  • On macOS install the shell command from the Command Palette.
  • The code command opens folders, files, diffs and specific lines.
  • First launch: pick a theme, open a folder, enable Auto Save, learn Ctrl+Shift+P.

Next: Opening Folders and Workspaces