DEV Community

Cover image for Dev on a potato 🥔 laptop. Enter, VSCode remote coding
Matthew Wang
Matthew Wang

Posted on • Edited on

Dev on a potato 🥔 laptop. Enter, VSCode remote coding

Engineers. Read this if your potato laptop is getting slow:

I stopped running dev servers on my M1 mac a year ago and never looked back. Running Docker Containers, Cursor, Arc, etc, all at once became impossible. Here's a step-by-step guide on how to code remotely on a separate machine.

This guide shows you how to set it up in a clean and reliable way.

🛠️ Prerequisites

Before you begin:

✅ You have VSCode installed on your local machine Download here.

✅ You can SSH into your remote machine (ssh user@your.remote.host). I personally have a self hosted ubuntu linux machine instead of VPC to save on cloud costs.

✅ Your remote machine has a Linux-based OS

🚀 Step 1: Install the Remote - SSH extension

1 - Open VSCode

2 - Go to the Extensions panel (Ctrl+Shift+X or ⇧⌘X)

3 - Search for "Remote - SSH" and install it

🧩 Step 2: Configure your SSH access

1 - Set up your SSH config file:

Command Palette (Ctrl+Shift+P or ⇧⌘P) and open ssh config

VSCode control panel selected ssh config

2 - Add your ssh config

Example:

Host my-remote-machine
  HostName 222.22.22.222
  Port 22
  User matt
Enter fullscreen mode Exit fullscreen mode

🔑 Step 3: Add your SSH key to remote for easy login

1 - Check if you have setup an SSH key

ls ~/.ssh/id_ed25519.pub
Enter fullscreen mode Exit fullscreen mode

2 - Generate one if it doesn't exist

ssh-keygen -t ed25519 -C "your_email@example.com"
Enter fullscreen mode Exit fullscreen mode

3 - Copy key to remote server

ssh-copy-id -i ~/.ssh/id_ed25519.pub yourusername@your.server.ip
Enter fullscreen mode Exit fullscreen mode

The public key will be appended to ~/.ssh/authorized_keys on the remote server

🔗 Step 4: Connect from VSCode

1 - Open the Command Palette (Ctrl+Shift+P or ⇧⌘P)

2 - Type: Remote-SSH: Connect to Host...

3 - Select the dev server you configured

4 - VSCode will establish a secure SSH tunnel and install a small VSCode server on the remote machine

🧪 Step 5: Open your project

Once connected, you can:

Use the File Explorer to open folders on the remote machine

Run your code in the integrated terminal (which runs on the remote host)

Use Git, extensions, and linters just like you would locally

📝 Bonus Tips:

  • Install extensions (VSCode will install them on the remote host)

  • Forward ports (for web servers or debugging):
    Ports Tab → Forward a Port

VSCode forward ports

With this feature you can directly access a remote machine with localhost!

  • If Disconnected, just reload your window: Open the Command Palette (Ctrl+Shift+P or ⇧⌘P) -> type & & select Reload Window

Top comments (0)