How to Use Visual Studio Code Connect to Remote Server

Visual Studio Code supports remote development over SSH, allowing you to connect to a Linux server and work with files and folders directly from VS Code. Using the VS Code Remote - SSH extension, you can open a remote folder on any machine with an SSH server running and take full advantage of VS Code’s features.

This guide shows beginners how to connect VS Code to a Linux server via SSH step by step.

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

Outline