
SSH n8n INTEGRATION: AUTOMATE SSH WITH N8N
Looking to automate remote server operations with n8n? The SSH n8n integration gives you direct access to 3 powerful actions that let you execute commands, upload files, and download data from any remote server—all without leaving your automation workflow.
Whether you're managing deployments, syncing files between servers, or running scheduled maintenance scripts, this integration transforms manual terminal sessions into automated, reliable processes. Connect once, and let n8n handle the rest: server backups, log retrieval, batch command execution, and more.
In this guide, you'll discover exactly how to configure your SSH credentials in n8n, master each available action, and build workflows that save hours of repetitive server management.
Need help automating Ssh with n8n?
Our team will get back to you in minutes.
Why automate Ssh with n8n?
The SSH n8n integration opens up 3 essential actions for remote server automation: command execution, file upload, and file download. These aren't just basic operations—they're the building blocks for sophisticated DevOps workflows that run 24/7 without human intervention.
Massive time savings become immediately apparent. Instead of manually SSHing into servers to run commands, transfer files, or retrieve logs, you set up the workflow once and let it execute automatically. A task that previously required opening a terminal, authenticating, navigating directories, and executing commands now happens in milliseconds as part of a larger automation chain. Consider server health checks that once took 15 minutes of manual work—now they trigger automatically every hour, collect data, and alert you only when something needs attention.
Seamless integration with n8n's 400+ native nodes means your SSH operations connect directly to everything else: pull data from a database, process it with JavaScript, upload results to your server via SSH, then notify your team on Slack. Real-world examples include automated deployment pipelines (trigger on GitHub webhook → run build commands via SSH → upload artifacts), scheduled backup workflows (download critical files from production servers → store in cloud storage), and monitoring systems (execute diagnostic commands → parse output → create tickets in Jira if issues detected).
How to connect Ssh to n8n?
! 1 stepHow to connect Ssh to n8n?
- 01
Add the node
The SSH integration supports two authentication methods: password-based authentication and private key authentication. Both are configured directly within n8n's credential system.Basic configuration:Open the Credentials panel: In your n8n editor, click on "Credentials" in the left sidebar, then select "Add Credential" and search for "SSH".Choose your authentication type: Select either "SSH Password" for username/password authentication or "SSH Private Key" for key-based authentication (recommended for production environments).Enter your connection details: Provide the host address (IP or domain), port number (default is 22), and your username. For password auth, enter your password. For private key auth, paste your private key content and optionally your passphrase.Test the connection: Click "Test Connection" to verify n8n can successfully authenticate with your remote server before saving.Save and name your credential: Give your credential a descriptive name (e.g., "Production Server SSH" or "Staging-Server-Key") so you can easily identify it when building workflows.
TIP💡 TIP: Always use SSH key authentication for production workflows—it's more secure and avoids password exposure. Store your credentials with clear naming conventions that indicate the environment (prod/staging/dev) to prevent accidentally running commands on the wrong server. For more troubleshooting tips, check our n8n troubleshooting guide.- 01
Need help automating Ssh with n8n?
Our team will get back to you in minutes.
Ssh actions available in n8n
01 Action 01Upload File
The Upload File action pushes files from your n8n workflow to a remote server via SSH. Perfect for deployments, configuration updates, and any automation that needs to place files on remote machines.
Key parameters:
- Credential to connect with: Required dropdown for selecting your SSH authentication credentials. Same credential system used across all SSH actions.
- Resource: Set to "File" since you're performing file system operations.
- Operation: Set to "Upload" to send a file from your workflow to the remote server.
- Input Binary Field: The name of the binary property from previous nodes containing the file to upload (required). Default is
data. This connects to files generated or retrieved earlier in your workflow. - Target Directory: The remote directory where the file will be placed (required). Example:
/home/useror/var/www/uploads. The directory must exist and your SSH user must have write permissions. - Options: Access additional properties for advanced upload configurations through the "Add option" button.
Use cases: Deployment automation: Upload built assets from your CI/CD pipeline to production servers. Configuration management: Push updated config files to multiple servers in sequence. Content publishing: Upload generated reports, images, or documents to a web server for public access.

02 Action 02Download File
The Download File action retrieves files from your remote server and brings them into your n8n workflow as binary data. This is essential for backup automations, log analysis, report generation, and any scenario where you need to process or store remote files.
Key parameters:
- Credential to connect with: Required dropdown to select your SSH credentials. Ensures secure, authenticated access to the remote server.
- Resource: Set to "File" to indicate you're working with the server's file system rather than executing commands.
- Operation: Set to "Download" to retrieve a file from the remote server into your workflow.
- Path: The absolute path to the file you want to download (required). For example,
/home/user/invoice.txtor/var/log/nginx/access.log. Must be the complete path—relative paths won't work. - File Property: The name of the output property where the downloaded file content will be stored (required). Default is
data. Subsequent nodes can access this binary data using this property name. - Options: Additional configuration like encoding or timeout settings. Use "Add option" to access advanced parameters when needed.
Use cases: Automated backup workflows: Download critical config files nightly and store them in AWS S3. Log analysis pipelines: Pull server logs, parse them with JavaScript, and create summary reports. Invoice processing: Retrieve generated PDFs from a server and email them to clients automatically.

03 Action 03Execute Command
The Execute Command action is the cornerstone of SSH automation—it lets you run any shell command on a remote server directly from your n8n workflow. Think of it as having a terminal session that's always ready, waiting for your automation to trigger it.
Key parameters:
- Credential to connect with: A required dropdown where you select your pre-configured SSH credentials (password or private key). This determines which server you're connecting to and how you'll authenticate.
- Resource: Set to "Command" for this action. This required dropdown tells n8n you want to interact with the server's command line rather than its file system.
- Operation: Set to "Execute" to run your specified command. This is the action that actually triggers command execution on the remote server.
- Command: The actual shell command you want to execute. This required text field accepts any valid command your server's shell supports—from simple
ls -lato complex scripts with pipes and redirects. - Working Directory: An optional field specifying where the command runs. Defaults to
/(root), but you can set it to/var/www/myappor any path to avoid typing full paths in your commands.
Use cases: Trigger deployment scripts after code pushes:
cd /var/www/app && git pull && npm run build. Run scheduled database backups using Postgres:pg_dump mydb > /backups/db_$(date +%Y%m%d).sql. Check server health metrics:df -h && free -m && uptime. Restart services after configuration changes:systemctl restart nginx.This action shines when you need to orchestrate server operations as part of larger workflows—combine it with webhooks, schedules, or data from other apps to create fully automated DevOps pipelines.

Build your first workflow with our team
Drop your email and we'll send you the catalog of automations you can ship today.
- Free n8n & Make scenarios to import
- Step-by-step setup docs
- Live cohort + community support
Frequently asked questions
Is the SSH n8n integration free?
Yes, the SSH integration is included natively in n8n at no additional cost. Whether you're using the open-source self-hosted version or n8n Cloud, you have full access to all three SSH actions (Execute Command, Download File, Upload File) without any premium tier requirements. The only consideration is your n8n hosting costs if you're using the cloud version, but the SSH functionality itself carries no extra charges. Self-hosters enjoy completely free access to this integration.What authentication methods does the SSH n8n integration support?
The integration supports two authentication methods: password-based authentication and private key authentication. Password auth is simpler to set up—just enter your username and password. However, for production environments, private key authentication is strongly recommended. It's more secure (no password transmitted over the network), supports passphrase-protected keys, and is standard practice in professional DevOps workflows. Both methods are configured through n8n's credential system and can be easily switched between different servers.Can I execute multiple SSH commands in a single workflow?
Absolutely. You can chain multiple SSH nodes in your workflow, each executing different commands on the same or different servers. For running multiple commands in a single SSH session, you have two options: use semicolons to separate commands (e.g., cd /app && git pull; npm install; npm run build) or create a shell script on your server and execute it with a single command. The first approach is simpler for short command sequences, while scripts are better for complex operations that need error handling and logging. For more workflow examples, explore our automatic backup workflow that demonstrates chaining multiple n8n nodes.


