IT runbook automation with n8n, SSH and Rundeck

n8n can run commands and move files over SSH and trigger Rundeck jobs with options, but giving a workflow tool shell access needs a deliberate design. This page covers the methods, setup order, identity mapping, security and failure points.

On this page

How n8n runs IT runbooks over SSH and Rundeck

Operations teams often keep their repeatable runbooks spread across chat threads, ticket comments and personal shell history, which makes them slow to repeat and hard to audit. n8n can reach those servers through its SSH node, which runs commands and transfers files, and it can reach jobs already defined in Rundeck through its Rundeck node. The choice between them comes down mainly to where the runbook logic and the audit trail should live: in n8n's workflow canvas and execution history, or in Rundeck's job definitions, options, access control and run logs. Pick the place that your operators and auditors will already check.

Before choosing either route, be clear about the license and the hosting model. n8n is source-available under the Sustainable Use License, not OSI open source, and that license limits use to your own internal business purposes or non-commercial use. Both methods also assume that the n8n instance runs in infrastructure you control, so that the SSH keys, Rundeck API tokens and the credentials n8n stores never leave your network. Confirm with n8n's license text that your intended use, including any internal operations team sharing the instance, fits the terms.

Whichever route you take, a workflow tool with shell access becomes a privileged system and should be treated like one. Decide which hosts and commands the workflow may touch, which account it logs in as, and who can edit the workflow that holds those credentials. Rundeck's own model, which reaches Linux and Unix nodes over SSH with public-key authentication, is a useful reference point for keeping keys scoped and rotated. Confirm with your security team how n8n's stored credentials are encrypted and who can read them, and document the approval step for any workflow that changes production systems.

What you need before connecting n8n to SSH and Rundeck

Four components have to be in place before a workflow can run a command on a server: a self-hosted n8n instance, a Rundeck installation with a production-grade database, key-based SSH access to target nodes, and a network path between all of them. Each card below names one of these decisions and the check to make before building.

Self-hosted n8n edition and version

Confirm which n8n edition you run before you plan the integration. The SSH and Rundeck nodes are part of the workflow canvas, so the question is whether your team can operate the instance and whether your licensing fits the use. Pin a specific n8n version and record it, since n8n ships minor releases roughly weekly and follows semantic versioning. Check the Sustainable Use License terms against how your organization will use the instance before rollout.

License text

Rundeck Open Source under Apache 2.0

Rundeck Open Source is licensed under the Apache Software License 2.0, and the Rundeck documentation describes it as free for teams that write and run Rundeck jobs at small scale. Runbook Automation is PagerDuty's commercial offering built on that open source core. Decide early which of the two you need, because support, scale and features differ. Confirm current terms with the project and PagerDuty before you commit.

Rundeck introduction

Java 17 and a supported production database

Rundeck requires a Java 17 runtime. Plan an external database from the start: the default embedded H2 database is not considered safe for production because it is not resilient if Rundeck is not shut down gracefully. Supported options listed in the system requirements include MariaDB 10.11.6 or later, MySQL 8.0.35 or 8.4 or later, PostgreSQL 15.5 or later, SQL Server 2022 and Oracle 19c or later. Confirm the version that matches your existing database platform and backup standards.

System requirements

Rundeck version and release channel

Rundeck v6.2.1 was published on September 9, 2026, and 6.3.0 release candidates were following. Choose the version you will run in production and check release notes before each upgrade. Track the GitHub releases page so your team knows when a release candidate turns into a stable release. Keep the Rundeck version recorded next to the n8n version, because the Rundeck node depends on the Rundeck API behaving as documented.

Rundeck releases

Public-key SSH access to target nodes

Rundeck reaches Linux and Unix nodes over SSH with public-key authentication, so each target needs a dedicated service account, a key pair stored in a secrets system, and a restricted shell or sudo policy. The n8n SSH node also runs commands and transfers files over SSH, so a single key that reaches every host expands the blast radius. Agree on which hosts each workflow may reach before you create credentials. Confirm the exact key formats and host key handling with your own SSH configuration.

Network path from n8n to hosts and Rundeck

Map the network flows before the build. n8n must reach each target host on the SSH port and reach the Rundeck API endpoint, and Rundeck must reach its nodes over SSH. Firewall rules, bastion hosts and segmentation between an automation zone and production often block one of these paths. Ask your network team to confirm each flow in writing, and record which direction initiates each connection so the rule set matches the design.

When to use the SSH node and when to call a Rundeck job

The n8n SSH node executes commands on a remote host and downloads or uploads files over SSH. It fits work that targets one known machine, has a short and predictable sequence of steps, and does not need a human to pick options at run time. Examples include restarting a service on one application server, pulling a log file for a ticket attachment, or pushing a configuration file to a single appliance. The workflow itself is the runbook, so the logic lives in n8n, the canvas shows each step, and execution history records what ran.

  • Narrow target: One host, one command set, and a clear owner for that machine.
  • Simple file transfer: Downloads and uploads for a known path are a good fit when the file list is short and stable.
  • Workflow-owned logic: Branching, retries and notifications are built in n8n, so no separate job definition is needed.
  • Credential exposure: The workflow holds the SSH credential, so anyone who can edit the workflow can reach that host.
  • Limited governance: There is no built-in option form or per-job access model comparable to a runbook console.

Before you choose this path, check which n8n users can open or change the workflow and which account the SSH credential uses on the target host.

Configuration sequence for SSH and Rundeck runbooks

This sequence connects n8n to target hosts over a dedicated SSH key, then places Rundeck between n8n and those hosts so that every operational run has defined jobs, options and a logged history. Each step ends with a check you can confirm before moving on.

  1. Create a least-privilege SSH account and key

    The platform team creates a dedicated, non-administrative account on each target host and generates a key pair used only for runbooks. Restrict the account to the commands and paths the runbooks need, and confirm which sudo rules, if any, apply with your security team before granting them. Store the private key in your secrets process, not in a workflow. Done means you can log in with the new key from the Rundeck host and from a test machine, and that password login for the account is disabled.

  2. Store the private key as an n8n credential

    In n8n, the administrator creates an SSH credential that holds the private key and the account name, then limits who can use it through the project and sharing settings. Because the key gives shell access, keep this credential out of shared projects that general users can edit. Confirm with your security team whether the key should be encrypted with a passphrase and how it will be rotated. Done means the credential's test connection succeeds against a single host.

  3. Test a harmless command over SSH

    Build a short test workflow with the SSH node that runs a read-only command such as hostname or uptime on one non-production host. Confirm the output in the execution log and check the host's authentication log to see that the connection came from the expected account and key. Then remove or disable any file transfer or write permissions that the test did not need. Done means the command output is correct and the host log shows only the intended login.

  4. Install Rundeck with a production database

    The platform team installs Rundeck on a server you control, using a supported Java 17 runtime and an external database instead of the embedded H2 default, which the documentation does not consider safe for production. Check the system requirements for the database version you plan to use. Enable authentication and configure access control before anything runs. Done means Rundeck starts, stops and restarts cleanly with the external database, and the web console requires login.

  5. Define the resource model and public-key node access

    Add each target host as a node in the Rundeck resource model, with the same least-privilege account and key from the first step. Rundeck reaches Linux and Unix nodes over SSH with public-key authentication, so the Rundeck server needs its own key authorized on the targets. Group nodes by role or environment so that jobs can target them with node filters. Done means Rundeck's node test shows every intended host as reachable and no unexpected host appears in the list.

  6. Create projects, jobs and options, then record job IDs

    Create a Rundeck project for each runbook domain and define jobs with typed options, such as a service name chosen from a fixed list rather than free text. Run each job first in a safe mode on a non-production node and review the output and the Rundeck execution log. Copy the job ID for each job from the project's jobs list, because the n8n Rundeck node uses that ID. Done means each job runs, its log records who started it and with which options, and the job IDs are documented for the workflow owners.

  7. Create a scoped Rundeck API token

    In Rundeck, create an API token for a dedicated user whose role allows running only the jobs the workflow needs, and decide with your security team how long the token stays valid. Store the token as an n8n Rundeck credential and point it at your Rundeck URL. Do not reuse a personal administrator token. Done means the credential test passes and a request for a permitted job works while a request for an unlisted job is refused.

  8. Wire the n8n Rundeck node and verify a logged run

    Build the workflow with the n8n Rundeck node, set the job ID and the option values from the trigger data, and run it against a non-production node first. Confirm that the n8n execution shows the job result and that the matching run appears in the Rundeck execution history with the API user recorded. Only then point the workflow at production nodes, with approval steps if your change process requires them. Done means both logs agree on the job, options, target and outcome.

How data and commands move between n8n, Rundeck and target hosts

The first decision is which tool initiates each step. In the pattern this page covers, n8n triggers or calls, Rundeck schedules and executes the job across its node list, and each target host receives commands over SSH. Output returns to n8n through the Rundeck node's execution results, so the workflow can branch on success or failure. When n8n runs the SSH node directly, the path skips Rundeck entirely, and the target host sees a connection from the n8n worker instead of from Rundeck. Map both paths before you build anything, because the audit trail differs between them.

Credentials sit at three hops. The n8n instance stores the Rundeck API credential and any SSH credential in its own database, protected by the encryption key described in the n8n documentation, and in queue mode every worker that executes these nodes needs that key. Rundeck stores its job definitions, option values and the SSH private keys or key references it uses for its nodes, and the target host holds only the public key for the account Rundeck logs in as. Confirm in your own environment which of these holders can read the private key material, and whether the Rundeck account on each host is restricted to the commands the runbook needs. The Rundeck system requirements describe the public-key model Rundeck uses for Linux and Unix nodes.

Logs also live in three places: the n8n execution history, the Rundeck execution log for each job run, and the operating system or shell audit logs on the target host. Decide which one is your system of record before go-live. Rundeck's execution log captures the job, its options and its output, which usually suits change review best. The n8n record shows the trigger and the workflow path, and the host log shows what the account actually ran. Keep the job ID and the Rundeck execution ID in the n8n execution data, so an analyst can join the three records. Ask your team to confirm how long each store retains data and who can read it.

Trust boundaries in an n8n runbook flow

The flow starts at a trigger such as a webhook, schedule or chat message, which reaches the n8n instance. n8n holds its credentials encrypted in its database and uses them for two paths: the SSH node reaching Linux or Unix hosts directly, or the Rundeck node calling a Rundeck server that keeps its own database and then reaches the same hosts over SSH with public-key authentication. Check where the encryption key lives, which identity the SSH key maps to on each host, and where execution logs are stored on each side of the boundary.

Two runbook paths from n8n to Linux or Unix hosts, with credential and log stores marked.

Mapping runbook inputs, credentials and roles between the systems

This table maps each runbook input, credential and permission from Rundeck to the n8n node that passes it along. Read it as a checklist for where each value is set, who owns it and what to confirm against the current n8n and Rundeck versions before you build.

ItemWhere it is setWhat to decide or confirm
Runbook parametersRundeck job options, referenced by job ID from the project's jobs list in the Rundeck nodeDefine each option's name, allowed values and default in Rundeck, then pass only those names from n8n. Confirm the exact option field names in the current Rundeck node.
Target host selectionRundeck node list or resource model, or host and command fields in the n8n SSH nodeDecide whether n8n names the host or Rundeck's resource model selects it. Keep one source of truth so inventory does not drift between the two systems.
SSH key or accountCredential in the n8n SSH node, with a public key for the account Rundeck or n8n connects asUse a dedicated automation account per environment. Store the private key in n8n credentials, not in workflow expressions, and restrict where it is accepted.
Sudo scopeSudoers rules on each target host, not in either workflow toolGrant sudo only to named commands or scripts. Confirm that a workflow can not request an arbitrary shell through the account.
Rundeck API tokenRundeck user profile token, entered as a credential in n8nCreate the token under a service user, not a personal account. Set an expiry that matches your rotation policy and record who owns it.
Rundeck access control rolesRundeck access control policies that grant run, view and read rights per project and jobMap each job to the groups allowed to run it. Confirm the policy syntax and whether the token user carries only the run rights it needs.
Role sources for Rundeck usersExternal authentication and option data sources supported by RundeckDecide whether group membership comes from your directory. Confirm which external source your Rundeck version supports before you rely on it.
Audit trailRundeck execution logs and n8n execution historyConfirm which actor, job ID and option values each system records, so an operator can trace a run from the workflow back to the Rundeck job.

Security trade-offs of giving a workflow tool shell access

An n8n workflow that runs SSH commands or triggers Rundeck jobs acts with the reach of whatever credentials it holds. The cards below cover the main exposures and the controls that limit them, so the team can decide what the workflow tool should be allowed to touch before the first runbook goes live.

Workflow tool as a path to root

An SSH key stored in n8n is a route to every host that key can log into. If the key carries sudo rights or sits in the root account's authorized keys, anyone who compromises the n8n instance inherits that reach. Before rollout, list every host the key can reach, check which accounts it maps to, and confirm whether privilege escalation is possible from that account.

n8n SSH node docs

Dedicated accounts with restricted commands

Create a separate service account per runbook group rather than reusing a shared administrator key. Limit that account to the commands its runbooks need, using the operating system's own controls such as restricted shells, sudo rules for named commands and file permissions on scripts. Ask your platform team which of these controls your hosts already enforce.

Protecting the encryption key

n8n stores credentials in its database encrypted with the instance's encryption key. Restrict who can read that key, keep it out of workflow exports and shared notes, and back it up in your secrets system. In queue mode, the same key must be shared with every worker and webhook processor that needs to read credentials, which widens the number of places the key lives.

n8n queue mode docs

Limiting who can edit SSH workflows

A user who can edit a workflow containing an SSH node can change the command it runs, the host it targets or the credential it uses, even without seeing the secret itself. Restrict edit rights on workflows that touch production hosts to a small group, and review changes to those workflows as you would review a change to a script run by root.

Rundeck access control and job permissions

Rundeck's access control and job-level permissions let you decide which users can view, run or edit each job, and which nodes a job may target. Use these to keep n8n's Rundeck credential limited to the jobs the workflow needs. Confirm how your Rundeck version maps n8n's API token to users and roles before granting it broad access.

Rundeck documentation

Logging and reviewing executions

Every SSH command and Rundeck job run should leave a record that names the workflow, the trigger and the target host. Review those logs on a schedule and alert on runs outside normal hours or against unexpected hosts. Confirm with your monitoring team where n8n execution data and Rundeck job logs are stored, how long they are kept, and who can read them.

Why SSH and Rundeck runbooks from n8n fail

This table lists the failures teams most often hit when n8n calls SSH or Rundeck, with the likely cause and the first fix to try for each. Read it as a checklist before go-live, and confirm each setting against your own hosts, Rundeck install and n8n deployment.

FailureLikely causeFix
Public-key authentication rejectedThe private key in the n8n SSH credential does not match the public key in the target account's authorized keys, or the wrong user is setConfirm the username and key pair match the target account, then test the same key from the n8n host with a plain SSH login before debugging the workflow
Connection times out or host key check failsFirewall or routing blocks the n8n host from reaching the SSH port, or the host key is not trustedCheck network paths from the n8n worker, not your laptop, and verify the expected host key before adding it to the trusted set
Job runs against the wrong targetThe job ID was copied from a different Rundeck project, so the node calls a job that does not run the intended runbookCopy the job ID from the jobs list of the project the workflow targets, and check the project name in the node settings
Rundeck loses state after a crashThe default embedded H2 database is in use, which the Rundeck documentation says is not considered safe for productionMove Rundeck to a supported external database such as PostgreSQL 15.5 or later, and stop Rundeck gracefully during maintenance
Job options arrive empty or wrongOption names in the workflow do not match the names defined on the Rundeck job, or values are typed as the wrong formatCompare option names and allowed values against the job definition, then run one manual execution from the Rundeck web console with the same inputs
Credential decryption errors in queue modeThe main instance's encryption key was not shared with worker and webhook processor nodes, so they cannot read stored SSH or Rundeck credentialsSet the same encryption key on every main, worker and webhook processor node, as n8n queue mode requires, and restart them after the change

Questions buyers ask before automating runbooks with n8n

What drives the cost and effort of automating runbooks with n8n?

Cost follows the number of runbooks, the number of target hosts, how many of those runbooks already exist as documented steps, and how much approval and audit logic each one needs. The main cost components are the time to inventory and classify runbooks, building and testing each workflow, setting up credentials and host access, and reviewing the security model before anything touches production. Recurring costs include maintaining workflows as hosts and scripts change, and keeping n8n and any Rundeck instance patched. Ask any provider for a quote that separates one-time build work from ongoing support and lists what is excluded, such as new runbook development.

How long does a runbook automation project take with n8n?

Duration depends mainly on how many hosts and jobs are in scope and how many distinct runbooks each job represents. A small pilot covering a handful of hosts and a few well-documented procedures moves much faster than a fleet-wide rollout with approval gates, audit requirements and multiple environments. Plan time for host access setup, change control approvals and testing against non-production systems before production use. No fixed timeline applies to every environment, so ask for a schedule tied to a written scope with named milestones.

What does our team need to provide before the work starts?

Prepare a runbook inventory listing each procedure, its owner, the hosts it touches, the commands or scripts it runs and the approvals it requires. Provide the SSH hosts and the service accounts that will connect to them, with public-key authentication in place, since Rundeck reaches Linux and Unix nodes that way. You will also need a non-production environment for testing, the Rundeck job IDs if jobs already exist, and a named owner who can approve access and changes. Confirm which secrets store and identity provider you will use before credentials are configured.

Can an internal team build this without outside help?

Yes, an experienced internal team can build it, provided it has skills in n8n workflow design, Linux administration, SSH key management and the operational process behind each runbook. The harder parts are usually not the nodes themselves but the access model, approval logic and audit trail, which need security review. Outside help is most useful for the security review of shell access, hardening decisions and building a repeatable pattern for many runbooks. Decide early which of those tasks your team will own after handover.

Do we need Rundeck, or can n8n run the commands directly?

n8n can run commands directly through its SSH node, which executes commands and transfers files over SSH. Rundeck adds a dedicated layer for runbook execution: a web console, access control, scheduling, option passing, logging, error handling and a REST API with CLI tools. Choose n8n alone for simple, event-driven procedures that a workflow can own end to end. Add Rundeck when operators need a console to run jobs with options, when job history and access control must sit in a separate, audited system, or when many teams share one catalog of procedures.

What licensing applies to n8n and Rundeck Open Source?

n8n is source-available under the Sustainable Use License, not an OSI open source license. That license permits use or modification for your own internal business purposes, or for non-commercial or personal use. Files with .ee in their name or directory require a valid n8n Enterprise License. Rundeck Open Source is licensed under the Apache Software License 2.0, and its documentation describes it as free for teams that write and run Rundeck jobs at small scale. Have legal counsel confirm that your intended use, including any distribution or service you build for others, fits these terms.

What does the commercial Runbook Automation offering add over Rundeck Open Source?

Runbook Automation, formerly Rundeck Enterprise and Process Automation, is PagerDuty's commercial offering built on open source Rundeck. It is offered as a self-hosted product and as SaaS. Ask PagerDuty to confirm which features, support terms and deployment models are included in the edition you consider, and compare them against the capabilities you need, such as access control, scheduling, logging and integrations. Also confirm the support and upgrade commitments in writing, since those are not defined by the open source project.

Testing and operating runbooks after go-live

Treat every runbook as code that changes over time, and test each change in a non-production environment before anyone runs it against production hosts. The test environment should mirror the parts that matter for the runbook: the same n8n and Rundeck versions where possible, the same SSH account and key type, and representative target hosts rather than a single lab machine. Use dry runs first. For SSH steps, confirm that commands are read-only or that they print intended actions before they change anything, and for Rundeck jobs, run the job with test option values and check the execution log for the exact command each node received. Ask your team to confirm how the n8n SSH node and Rundeck node handle failures in your own build, since a failed step can leave a half-finished change on a host that a later step assumes is complete.

Version upgrades need the same discipline. Track n8n releases and Rundeck releases against their published release notes, using the n8n release notes and the Rundeck releases on GitHub page, and plan a staging upgrade that replays your test executions before production. n8n ships minor releases roughly weekly, so decide in advance which versions you adopt and how often you review them. Rundeck also needs a check on its database: the default embedded H2 database is not considered safe for production, so confirm your Rundeck instance runs on a supported external database before any upgrade window. Back up both platforms' data stores before each change and keep the previous version available for rollback.

Access review is the control that ages fastest. Once runbooks exist, the question shifts from who can build a workflow to who can run which job against which hosts. Review Rundeck project access and job permissions, the SSH accounts and keys that n8n uses, and which n8n users can edit or execute workflows that hold those credentials. Ask for a list of who ran each high-impact job over the review period and compare it with the people who should have that access. Rotate SSH keys on a schedule your security team sets, and remove access for people who change roles. Record each review result so auditors and your own team can see the decisions taken and the evidence behind them.

How DeployOpen scopes and delivers this integration

DeployOpen plans, builds, documents and supports self-hosted open-source platforms inside your own infrastructure, including the n8n workflows that run SSH commands and Rundeck jobs. For runbook automation, the work starts with a written list of which hosts, commands and jobs are in scope and which accounts the workflows are allowed to use.

How we scope

  • Inventory the runbooks to automate, with each step's target hosts, commands, file transfers and Rundeck job IDs.
  • Agree in writing which SSH accounts, key types and Rundeck projects each workflow may use, and which actions stay manual.
  • Engagements are fixed-scope, so deliverables, the test plan and timelines are agreed before any build work starts.

How we build

  • Configure the n8n SSH and Rundeck credentials, with keys stored in n8n's credential store and never in workflow exports.
  • Build workflows that pass Rundeck job options explicitly and validate inputs before any command reaches a host.
  • Test each runbook on non-production nodes, including failed commands, timeouts and unreachable hosts, then run a security review of the shell access granted.

How we hand over

  • Document each workflow's trigger, permissions, target nodes, approval steps and the Rundeck job it calls.
  • Record the SSH accounts, host allowlists and credential owners so your team can audit access without reverse engineering workflows.
  • Walk your operators through running, pausing and rolling back workflows, with the runbook owners who will maintain them.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer, covering n8n and Rundeck version changes.
  • Review new runbooks and changes to host access before they go live, so shell permissions do not grow unnoticed.
  • Confirm with your Rundeck and n8n teams which edition, database and license terms apply to your environment before rollout.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.