Set up remote development on your Pod using VSCode or Cursor.
This guide explains how to connect directly to your Pod through VSCode or Cursor using the Remote-SSH extension, allowing you to work within your Pod’s volume directories as if the files were stored on your local machine.
Before you begin, you’ll need:
To connect to a Pod, you’ll need to install the Remote-SSH extension for your IDE:
Open VSCode or Cursor and navigate to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).
Search for and install the Remote-SSH extension:
Before you can connect to a Pod, you’ll need an SSH key that is paired with your RunPod account. If you don’t have one, follow these steps:
Generate an SSH key using this command on your local terminal:
To retrieve your public SSH key, run this command:
This will output something similar to this:
Copy and paste the output into the SSH Public Keys field in your RunPod user account settings.
To enable SSH access, your public key must be present in the ~/.ssh/authorized_keys
file on your Pod. If you upload your public key to the settings page before your Pod starts, the system will automatically inject it into that file at startup.
If your Pod is already running when you upload the key, the system will not perform this injection. To enable SSH access, you’ll need to either terminate/redeploy the Pod, or open a web terminal on the running Pod and run the following commands:
Next, deploy the Pod you want to connect to. For detailed deployment instructions, see Manage Pods -> Create a Pod.
To connect with VSCode/Cursor, your Pod template must support SSH over exposed TCP. To determine whether your Pod template supports this, during deployment, after selecting a template, look for a checkbox under Instance Pricing labeled SSH Terminal Access and make sure it’s checked.
All official Runpod Pytorch templates support SSH over exposed TCP.
Next, you’ll configure SSH access to your Pod using the Remote-SSH extension. The instructions are different for VSCode and Cursor:
From the Pods page, select the Pod you deployed.
Select Connect, then select the SSH tab.
Copy the second command, under SSH over exposed TCP. It will look similar to this:
If you only see one command under SSH, then SSH over exposed TCP is not supported by your selected Pod template. This means you won’t be able to connect to your Pod directly through VSCode/Cursor, but you can still connect using basic SSH via the terminal.
In VSCode, open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and choose Remote-SSH: Connect to Host, then select Add New SSH Host.
Enter the copied SSH command from step 3 (ssh root@***.***.***.** -p ***** -i ~/.ssh/id_ed25519
) and press Enter. This will add a new entry to your SSH config file.
From the Pods page, select the Pod you deployed.
Select Connect, then select the SSH tab.
Copy the second command, under SSH over exposed TCP. It will look similar to this:
If you only see one command under SSH, then SSH over exposed TCP is not supported by your selected Pod template. This means you won’t be able to connect to your Pod directly through VSCode/Cursor, but you can still connect using basic SSH via the terminal.
In VSCode, open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and choose Remote-SSH: Connect to Host, then select Add New SSH Host.
Enter the copied SSH command from step 3 (ssh root@***.***.***.** -p ***** -i ~/.ssh/id_ed25519
) and press Enter. This will add a new entry to your SSH config file.
From the Pods page, select the Pod you deployed.
Select Connect.
Under Direct TCP Ports, look for a line similar to:
If you don’t see a Direct TCP Ports section, then SSH over exposed TCP is not supported by your selected Pod template. This means you won’t be able to connect to your Pod directly through VSCode/Cursor, but you can still connect using basic SSH via the terminal.
Here’s what these values mean:
69.48.159.6
is the IP address of your Pod.25634
is the port number for the Pod’s SSH service.Make a note of these values (they will likely be different for your Pod), as you’ll need them for the following steps.
In Cursor, open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and choose Remote-SSH: Connect to Host, then select Add New SSH Host. This opens the SSH config file in Cursor.
Add the following to the SSH config file:
Replace:
POD_NAME
with a descriptive name for your Pod. This will be used to identify your Pod in the SSH config file, and does not need to match the name you gave your Pod in the RunPod console.POD_IP
with the IP address of your Pod from step 3.POD_PORT
with the port number of your Pod from step 3.So, for the example Pod, the SSH config file will look like:
If you are using a custom SSH key, replace ~/.ssh/id_ed25519
with the path to your SSH key.
Save and close the file.
Now you can connect to your Pod with the Remote-SSH extension.
/workspace
).You should now be connected to your Pod instance, where you can edit files in your volume directories as if they were local.
If you stop and then resume your Pod, the port numbers may change. If so, you’ll need to go back to the previous step and update your SSH config file using the new port numbers before reconnecting.
Once connected through Remote-SSH, you can:
Here are some important directories to be aware of:
/workspace
: Default persistent storage directory./tmp
: Temporary files (cleared when Pod stops)./root
: Home directory for the root user.If you can’t connect to your Pod:
If the VSCode/Cursor server fails to install:
.vscode-server
or .cursor-server
directory and reconnecting: