n8n Self Hosted Setup: 5 Easy Steps to Private Automation

I automated my invoice-to-spreadsheet workflow last year and then found out three months later that the SaaS automation tool I’d built it on had quietly changed its pricing tier and doubled my monthly bill. That’s the moment I moved everything to something I actually own.

An n8n self hosted setup gets you the same drag-and-drop workflow automation as Zapier or Make, minus the per-task pricing and the risk of a company changing the rules on you mid-workflow. If you’ve got Docker running anywhere — a mini PC, a NAS, an old laptop — you can have your own automation server live in about 20 minutes.

Transparency Note: This post contains affiliate links. If you buy something through these links, I may earn a small commission at no extra cost to you. Every product mentioned is researched based on specs, expert reviews, and real user feedback.
n8n self hosted setup automation dashboard on a home server
Self-Hosted n8n SaaS (Zapier / Make)
Pricing model One-time setup, free to run Recurring, often per-task
Data location Stays on your own hardware Lives on the vendor’s servers
Maintenance You keep it running, backed up, updated Handled by the vendor
Pricing changes Can’t happen to you The vendor can change tiers anytime

What n8n Actually Is

n8n (pronounced “n-eight-n”) is an open-source workflow automation tool — the same category as Zapier or Make, but built to be self-hosted and fair-code licensed. You build automations visually by connecting nodes: trigger something on a schedule or webhook, pull data from an API, transform it, and push it somewhere else. Unlike Zapier’s per-task billing, a self-hosted n8n instance runs as many workflows as your hardware can handle for zero recurring cost.

The trade-off is exactly what you’d expect: you’re now responsible for keeping it running, backed up, and updated, instead of a SaaS company doing that for you. For a homelab that’s already running other Docker containers, that’s a small ask for meaningfully more control over your own data and workflows.

The node library is the other big draw. n8n ships with hundreds of pre-built integrations — email, Slack, Discord, Google Sheets, most major databases, and a generic HTTP Request node for anything that isn’t natively supported. That last one is the real superpower: if a service has any kind of API, you can talk to it from n8n, even without an official integration.

1. Install Docker (Skip If You Already Have It)

If you’re starting from a clean box, install Docker and the Compose plugin first:

curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER

Log out and back in for the group change to apply, then confirm with docker compose version. If you’re already running Portainer, you can paste the compose file below directly into a new stack instead of using the command line.

2. Write Your docker-compose.yml

Create a folder for n8n’s persistent data, then add a compose file:

mkdir -p ~/n8n/data && cd ~/n8n

cat > docker-compose.yml << 'EOF'
services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: unless-stopped
    ports:
      - "5678:5678"
    environment:
      - N8N_ENCRYPTION_KEY=replace-with-a-long-random-string
      - GENERIC_TIMEZONE=America/Chicago
      - N8N_HOST=n8n.yourdomain.com
      - WEBHOOK_URL=https://n8n.yourdomain.com/
    volumes:
      - ./data:/home/node/.n8n
EOF

The N8N_ENCRYPTION_KEY is the setting people skip and regret. It encrypts every credential you save inside n8n — API keys, passwords, tokens. Generate a real random string for it (not the placeholder above) and back that value up somewhere safe. Lose it, and every saved credential becomes unusable.

3. Set Your Timezone and Webhook URL

GENERIC_TIMEZONE controls when scheduled workflows actually fire — get this wrong and your "9 AM daily" trigger runs at a different hour than you expect. WEBHOOK_URL matters if any workflow needs to receive data from the outside world (a form submission, a GitHub push, a Stripe payment). If you're only running local, scheduled automations with no incoming webhooks, you can skip that variable for now and add it later.

4. Start the Container

Bring it up in the background:

docker compose up -d

Check that it's healthy with docker compose logs -f n8n, then open http://YOUR_SERVER_IP:5678 in a browser. n8n's first-run screen has you create an owner account with email and password — there's no default login to worry about disabling later.

If you want this reachable outside your home network, put it behind Nginx Proxy Manager or Caddy with a real domain and HTTPS rather than exposing port 5678 directly to the internet.

5. Build and Trigger Your First Workflow

Start small: a scheduled trigger that checks an RSS feed every morning and posts new entries to a Discord or Slack webhook is a genuinely useful first workflow and touches most of the core node types you'll use later — trigger, HTTP request, and a conditional filter.

Once you're comfortable with scheduled and webhook triggers, a physical trigger button is a surprisingly good addition. The Elgato Stream Deck MK.2 can fire an n8n webhook with a single button press — I have one key set up to kick off my "publish blog post" workflow instead of running it manually every time. If you already use one for streaming or productivity shortcuts, this is a genuinely useful second life for it. I covered the full setup in my Stream Deck productivity workflows post.

What I liked: One-press automation triggers, works alongside existing streaming/productivity shortcuts.
What could be better: Requires its own always-on companion software running to bridge to a webhook.
5. BUILD AND TRIGGER YOUR FIRST WORKFLOW

Elgato Stream Deck MK.2

Once you're comfortable with scheduled and webhook triggers, a physical trigger button is a surprisingly good addition.

  • Once you're comfortable with scheduled and webhook triggers, a physical trigger button is a surprisingly good addition. The Elgato Stream Deck MK.2 can fire an n8n webhook with a single button press
  • I have one key set up to kick off my "publish blog post" workflow instead of running it manually every time. If you already use one for streaming or productivity shortcuts, this is a genuinely useful second life for it. I covered the full setup in my Stream Deck productivity workflows post

Check price on Amazon →

Current price and availability shown on Amazon.

Backing Up Your Workflows

Everything n8n needs — workflows, credentials, execution history — lives in that ./data folder from the compose file. Back it up regularly, on a schedule, to something outside the box it's running on. A cheap portable SSD like the Samsung T7 Portable SSD is an easy, fast destination for a weekly backup script, especially if your automations touch anything you'd hate to rebuild from scratch.

BACKING UP YOUR WORKFLOWS

Samsung T7 Portable SSD

Everything n8n needs — workflows, credentials, execution history — lives in that ./data folder from the compose file.

  • Everything n8n needs
  • workflows, credentials, execution history

Check price on Amazon →

Current price and availability shown on Amazon.

FAQ: n8n Self Hosted Setup

Is a self-hosted n8n instance actually free, or are there hidden costs?
The software itself is free under n8n's fair-code license for self-hosting. Your only real costs are the hardware you're already running and, optionally, a domain name if you want a proper URL instead of an IP address.

Do I need to know how to code to use n8n?
No. Most workflows are built visually by connecting pre-built nodes, similar to Zapier. Code comes in handy for advanced custom logic, but it's an option, not a requirement, for the vast majority of automations.

What happens to my workflows if the container restarts or the server reboots?
Nothing, as long as your volume mount is set up correctly. The ./data folder persists everything outside the container, and restart: unless-stopped in the compose file means Docker automatically brings it back up after a reboot.

Should I use SQLite or a full database like PostgreSQL?
SQLite, which n8n uses by default, is genuinely fine for personal use and a modest number of workflows. Once you're running dozens of active workflows or want more robust concurrent access, migrating to PostgreSQL is straightforward and worth doing before it becomes a bottleneck rather than after.

The Takeaway

An n8n self hosted setup takes about the same effort as installing any other Docker container on this site, and it replaces recurring automation subscriptions with a one-time setup you fully control. Start with the docker-compose file above, get one simple workflow running end to end, and expand from there — the node library is deep enough to keep you building for a long time.

Your first automation doesn't need to be clever. It just needs to save you five minutes you'd otherwise spend doing something manually, on repeat, forever.

What's the first workflow you'd build if setup took zero effort? Tell me in the comments — I'm always looking for the next one to steal.

Scroll to Top