Skip to content

n8n self-hosting setup: a safe small-business guide

Follow this n8n self-hosting setup to protect customer data, preserve workflows, test recovery, and decide when n8n Cloud costs less overall.

RunbookSeptember 5, 20268 min read
n8n self-hosting setup: a safe small-business guide
FIG. 01 — FEATURED

This sheet contains partner links. A purchase through one earns Runbook a commission at no additional cost to you. How we make money.

You will finish this n8n self-hosting setup with one protected automation server, a tested backup, and a monthly maintenance checklist. Budget two hours for the first setup with n8n, Docker, a domain name, and a Linux server. If nobody can manage those four pieces, choose n8n Cloud and avoid inheriting an unattended business system.

Decide whether self-hosting saves you money

n8n is automation software. It moves information between your business systems so an employee does not have to copy every form, order, or appointment by hand. Self-hosting means that software runs on a server you control instead of infrastructure maintained by n8n.

The Community edition has no software subscription. Free software does not mean free operation. You still need the server, a domain name, backups, security work, updates, and a person accountable when a customer form stops moving.

QuestionSelf-hosted Community editionn8n Cloud
Who keeps the service online?You or your server administratorn8n
Who installs security updates?Youn8n
Who checks backups?Youn8n
Where does workflow data live?On infrastructure you selectIn n8n's managed service
Best reason to choose itControl over location and configurationLess operational work

Read the n8n pricing breakdown before treating self-hosting as a cost cut. Then compare the maintenance burden with n8n versus Zapier and n8n versus Make. The subscription is only one line on the bill.

Your move

Name the person who owns updates, backups, security alerts, and recovery before you create the server. Put a recurring monthly appointment on that person's calendar. If you cannot assign the job, stop here and use a managed service.

Use the production stack, not a laptop

Your production stack needs five parts:

  1. A Linux server: the rented computer that stays online and runs n8n.
  2. Docker and Docker Compose: software that packages n8n and its settings into a repeatable container. A container is an isolated box for an application.
  3. A dedicated subdomain: an address such as automation.example.com used only for n8n.
  4. HTTPS: the padlock connection that encrypts information moving between a browser and the server.
  5. Persistent storage: a saved area that survives a restart or replacement of the n8n container.

n8n's official Docker guide recommends Docker for most self-hosting. Its Docker Compose example also uses Traefik, a reverse proxy. In plain words, Traefik stands at the public entrance, creates the encrypted connection, and passes approved traffic to n8n.

Do not run the live system from a laptop. Closing the lid, changing Wi-Fi, or installing an operating-system update can interrupt customer workflows. A local install is fine for learning. Production belongs on an always-on server.

Set the address and saved storage

Create a DNS A record for your chosen subdomain. DNS is the internet's address book. An A record points a name such as automation.example.com to the numeric internet address of your server.

Open the DNS area at the company that manages your domain. Add this record, replacing the sample values:

Type: A
Name: automation
Value: YOUR_SERVER_IP_ADDRESS
TTL: Auto

Next, ask your server administrator to follow n8n's Docker Compose installation. The official example stores n8n data in a Docker volume named n8n_data and stores Traefik's certificate files in traefik_data. A volume is a durable folder Docker keeps even when the application container is replaced.

Set both timezone values to the timezone used by your business. TZ controls the server's clock. GENERIC_TIMEZONE controls scheduled workflows. If these disagree, a “send at 8:00” routine can fire at the wrong 8:00.

Set WEBHOOK_URL to the full public HTTPS address. A webhook is a web address that catches data another system sends. Form tools, payment systems, and calendars need that public address to reach n8n.

N8N_HOST=automation.example.com
N8N_PROTOCOL=https
WEBHOOK_URL=https://automation.example.com/
GENERIC_TIMEZONE=America/New_York
TZ=America/New_York
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
N8N_RUNNERS_ENABLED=true

Change the timezone to your own. Keep the final slash on WEBHOOK_URL. Never paste passwords or secret keys into a public ticket, shared chat, or screenshot.

Protect the front door

HTTPS is the minimum, not the whole lock. Create the owner account with a unique password and turn on two-factor authentication, which asks for a second proof from your phone when you log in. Give each employee a separate account rather than sharing the owner login.

The n8n security guide also points administrators to controls for disabling an unused public API, limiting risky nodes, and hiding sensitive execution data. An API is a doorway other software can use to control an application. If your workflows do not use that doorway, closing it removes one route an attacker could test.

Run n8n's built-in audit after setup. In the n8n editor, add an n8n node, choose Resource > Audit, then choose Operation > Generate. The report flags unused credentials, unprotected webhooks, risky nodes, missing security settings, and an outdated instance. A credential is the saved key or login that lets n8n connect to another service.

Do not expose port 5678 directly to the public internet. In the official Compose pattern, n8n listens on the server itself while Traefik handles public traffic over ports 80 and 443. Ask the administrator to confirm that firewall rule before any real customer data enters a workflow.

Back up workflows, credentials, and the key

A backup is useful only if it can rebuild the service. Save the database, the persistent n8n volume, the Compose files, the environment settings, and the encryption key. n8n uses that key to protect saved credentials. Losing it can leave restored credentials unreadable.

The n8n command-line reference includes backup exports for workflows and credentials. The command line is a text window used to administer the server. Your administrator can schedule these commands inside the n8n container:

n8n export:workflow --backup --output=backups/latest/
n8n export:credentials --backup --output=backups/latest/

Keep the backup outside the production server. If the server disappears, a backup stored only on that server disappears with it. Encrypt the backup, restrict who can download it, and set a retention period so old customer information does not pile up forever.

Test recovery before launch. Restore the files into a separate test installation, open one workflow, reconnect a harmless test account, and run a sample record end to end. Record the date and the person who completed the test.

Build one harmless workflow first

Do not move every customer process on day one. Create a workflow that starts with a manual trigger and writes a sample row to a test spreadsheet. Then restart the n8n container and run the workflow again.

This proves three things: the editor works, the saved data survives a restart, and the outside account can reconnect. Next, use a test webhook and send fake contact details to it. Keep real names, phone numbers, payment details, and live follow-ups out of the test.

Once that passes, move one low-risk routine. A weekly internal report is safer than appointment confirmation because a delay does not leave a customer wondering whether the booking exists. The weekly marketing report build is a sensible pattern to adapt after the server is stable.

The part that breaks

The common failure is ownership, not Docker. The server works on launch day, so everyone assumes it will keep working without attention. Months later, a breaking update, expired certificate, full disk, or failed backup becomes an emergency.

n8n's update guidance says to update frequently, aim for at least monthly, read release notes for breaking changes, and test updates in a separate environment first. Do not let a production server pull a new image automatically without a recovery plan. “Latest” is not a testing process.

Put these checks on one recurring ticket:

Monthly n8n check
[ ] Read release notes
[ ] Take a fresh off-server backup
[ ] Restore the backup in the test installation
[ ] Update the test installation
[ ] Run the sample workflow and webhook
[ ] Update production during a quiet window
[ ] Run the security audit
[ ] Check failed executions and disk space
[ ] Record version, date, and owner

If that list feels excessive, that is the decision signal. Use a hosted option and spend the saved attention on the workflows themselves.

Upgrade path

Start with one n8n instance and its default database for a small, low-risk workload. Move to PostgreSQL, a separate database system, when you need a more conventional production database or expect the installation to grow. Keep the persistent .n8n volume even with PostgreSQL because n8n documents other important files there.

Do not add queue mode just because it sounds more serious. Queue mode separates incoming work from worker processes so several jobs can run across more machines. It also adds Redis, shared encryption settings, and more failure points. Add it only after monitoring shows that one instance cannot handle the actual workload.

Your next build is the workflow that justifies the server. Browse the automation runbooks, choose one internal process with a forgiving deadline, and run it beside the manual process until the failure alerts and recovery steps hold up.

Frequently asked questions

Can you self-host n8n for free?

The Community edition has no software subscription, but you still pay for a server and for the work needed to secure, update, back up, and monitor it.

Is self-hosting n8n safe for customer data?

It can be, provided you use encrypted web access, control user accounts, protect the encryption key, patch the installation, and test backups regularly.

Do you need Docker to self-host n8n?

No, but n8n recommends Docker for most self-hosting because it keeps the application isolated and makes installations and updates more consistent.

Should a small business use n8n Cloud instead?

Use n8n Cloud when nobody can own server security, updates, monitoring, and recovery. Self-hosting makes sense when control justifies that continuing work.

About Runbook

AI tools and automation builds for marketers. What to use, how to wire it, and the workflow to copy this week. How we work

GET THE NEXT DISPATCH

Run the next build before your competitors read about it.

One short email when an AI tool or automation actually changes the work, with the build to copy.

No send unless there is a build worth running.

// keep_reading

Related builds