Onjsdev Logo
How To Connect Your Remote Server On VS Code?
30 Jun 20253 min read
Web DevelopmentVS CodeRemote ServerSSHLinuxVPSCloud VMTerminal

How To Connect Your Remote Server On VS Code?


VS Code has a great extension to access your remote server. With Microsoft's Remote - SSH extension, you can open and edit files on any remote server just like they were local. Let's see how.

Prerequisites

Before you get started, make sure you have:

Step 1: Install the Remote - SSH Extension

Remote - SSH Extension is an official VS Code extension that allows you to open folders and files from a remote server over SSH.

To install the extension, open VS Code and click on the Extensions icon in the Activity Bar. Search for "Remote - SSH" and click on the "Install" button.

Step 2: Connect To Your Remote Server

Press F1 (or Cmd + Shift + P) and type "Remote-SSH: Connect to Host...". Select the option and enter the SSH connection details: username and IP address as you connect to your remote server in terminal.

It may take a moment on the first connection—VS Code installs a small server on the remote machine.

Step 3: Open Your Remote Server Folder

Once connected, click "Open Folder" and navigate to your project directory (e.g., /var/www/myapp).

Now you're editing live files directly on the remote server, with full VS Code features like highlighting, terminal, and Git integration.

Conclusion

VS Code's Remote - SSH extension makes it easy to connect to your remote server and start coding and developing your projects. With this extension, you can open and edit files on any remote server just like they were local.

Thank you for reading.