How to Use Visual Studio Code Connect to Remote Server

This article explains how to use Visual Studio Code to connect to a remote server via SSH. First, ensure your local computer has an OpenSSH client installed. Then download and install VS Code from the official website, open the Extensions panel, and install the Remote - SSH extension. Next, open the Command Palette, use the Remote-SSH command to add a new SSH host with your server's username and IP address, save it to a local config file, and connect by entering the server password when prompted.

Step 1: Install OpenSSH Client

Before connecting, make sure your local computer has an OpenSSH client installed.

  1. Open Server Manager.
  2. In the left navigation pane, select Local Server.
  3. In the Properties window, locate Remote SSH Access.
  4. Select Disabled to enable the OpenSSH service.

Step 2: Install Visual Studio Code

Download and install Visual Studio Code from the official website.

Step 3: Install Remote - SSH in VS Code

  1. Open VS Code.
  2. Go to Extensions (Ctrl+Shift+X) and search for Remote - SSH.
  3. Click Install.

This extension allows remote SSH VS Code access to Linux servers and containers.

Step 4: Connect to Linux Server

  1. Open the Command Palette (F1 or Ctrl+Shift+P).
  2. Select Remote-SSH: Connect to Host…
    remote ssh
  3. Click Add New SSH Host and input your server’s SSH information, including username and IP address.
    add new host
  4. Choose a Config File (local) to save the SSH information.
    config file
  5. Confirm the connection.
    confirm the connection
  6. Enter the server password when prompted.
    enter the password
    Once connected, you can operate the Linux server directly from VS Code, browse folders, edit files, and run commands as if you were on the server itself.
    operate the server

Step 5: Default VS Code SSH Shortcuts

  • F1 or Ctrl+Shift+P: Open Command Palette
  • Remote-SSH commands: Access server configuration and connection options
    command

Notes

  • Ensure the SSH server is running on your Linux machine before connecting.
  • This setup supports VS Code remote development, SSH, Visual Studio SSH connection, and remote SSH Visual Studio Code workflows.
  • Works with Linux servers, Windows Subsystem for Linux (WSL), and virtual machines.
Keywords:

visual studio linux, vscode remote ssh, vs code ssh, remote ssh vscode, ssh vscode, vscode ssh remote, visual code ssh, vscode ssh config, vscode ssh remote, visual code remote ssh, visual studio ssh, ssh visual studio code, vscode ssh connection, visual studio code connect to remote server

Last Updated:   10/27/2026
Outline