Connect n8n to Remote Server using SSH Node | Alpha | PandaiTech

Connect n8n to Remote Server using SSH Node

Configure the SSH node in n8n with credentials and IP address to establish a secure connection for executing remote server commands.

Learning Timeline
Key Insights

IP Address Configuration

If you are hosting your AI models or CLI tools on a cloud VPS, you must use the Public IP address in the Host field. If the server is on a local network (like a server room), use the Local IP (e.g., 10.x.x.x).

Troubleshooting SSH Handshakes

If the connection test fails, it is often due to firewall settings or SSH key handshake issues specific to how n8n interacts with certain server configurations. Consult n8n documentation regarding 'known_hosts' or SSH key algorithms if this occurs.
Step by Step

Configuring the SSH Connection in n8n

  1. Create a blank workflow in the n8n interface.
  2. Locate the 'SSH' node in the node library and double-click it to add it to the canvas.
  3. Click the dropdown menu under the 'Credential to connect to a server' field.
  4. Select 'Create New Credential' from the list.
  5. Enter the server's IP address in the 'Host' field (use the Public IP if hosting on a VPS/Cloud).
  6. Enter the 'User' and 'Password' in the respective fields (or toggle to Private Key authentication if preferred).
  7. Click the 'Save' button at the bottom of the credential window.
  8. Verify that the message 'Connection tested successfully' appears.
  9. Rename the credential to 'AI terminal' (or preferred name) for easier identification later.
  10. Close the credential configuration window to return to the node settings.

Verifying Server Connectivity

  1. Locate the 'Command' input field within the SSH node settings.
  2. Type the command 'hostname' into the field.
  3. Click the 'Execute Node' button to run the test.
  4. Check the 'Output' panel for the server's name in the 'stdout' (standard out) field to confirm the connection is active.

More from Build & Deploy Autonomous AI Agents

View All