Recommended before this

Setting up an SSH Key

Setting up SSH Config

Setting up

  1. First, go to the extensions panel in Visual Studio Code and download the Remote - SSH extension (first one in the image below)

The extension in the marketplace

  1. Next, make sure you have your SSH key setup on the server you wish to connect to.

  2. After you have done so, open up vscode again and press Ctrl+Shift+P or Command+Shift+P to bring up the command prompt, and search for Remote - SSH: Add new SSH Host...

If you've set up your SSH keys and your sshconfig file already, the server name should show up here already and you can just connect

  1. Enter in your SSH host with your username, and press Enter to confirm. When asked for the location to save the configuration, you can choose to use the default.

  1. Press Ctrl+Shift+P again to open up the command bar, and this time search for Remote - SSH: Connect to Host.... The host you just added should show up in this list. Select it and press Enter to confirm.

  2. Voila! You're done. The first time you connect it might take a few seconds to set up the backend of vscode on the server. You should be able to see all the files from the server in the vscode file explorer window, and the integrated terminal is also a remote shell - so any commands you run will actually be run on the remote machine.