How to Install n8n: Cloud vs Self-Hosting (and Why I Recommend a Server)

Author
Lukas von Kunhardt
Published
February 7, 2026
Tags
Essentials

Before you can build workflows, you need n8n running somewhere. You have two options:

  1. n8n Cloud — they host it for you. You sign up, pay, and it works.
  2. Self-hosting — you rent a small server and run n8n yourself.

I started on DigitalOcean, then switched to Hetzner because it was cheaper and I didn't have much money at the time. I didn't know what SSH was. But getting through the setup taught me what a server actually is, and there's something satisfying about having your own machine running your workflows. This guide covers both options so you can pick what works for you.

Option 1: n8n Cloud (The Easy Route)

If you don't want to deal with servers, n8n Cloud is the straightforward option. Sign up, create a workflow, done. It starts at €24/month for the Starter plan (2,500 executions per month).

If that sounds fine to you, go ahead — sign up and skip the rest of this guide. You can always migrate to self-hosting later.

But wait. If any of these apply, keep reading:

  • €24/month feels too much. Self-hosting costs under €5/month for the same thing, without execution limits.
  • You want full control. Self-hosting lets you install any npm package and any community node. n8n Cloud recently added support for verified community nodes, but unverified nodes and raw npm packages (like PDF parsers, web scrapers, or OCR tools) still require self-hosting.
  • Data privacy matters. Maybe your boss requires it, maybe you're in the EU and prefer your data stays on a European server. Self-hosting means your workflows and data live on your infrastructure, not someone else's.

If even one of those resonates, self-hosting is worth the hour it takes to set up. And I'll walk you through every step.

Option 2: Self-Hosting (What I Actually Use)

Here's the honest version: setting up a server for the first time is confusing. You'll see terms like SSH, Docker, and DNS. Some steps won't make sense until after you've done them.

But it's a one-time thing. You do this once, and then n8n just runs — 24/7, on your own server, for a few euros a month. No execution limits, no subscription anxiety. That's the deal: one hour of setup for unlimited free automation.

And you can't really break anything. The server is completely isolated from your computer. If something goes wrong, you delete the server from Hetzner's dashboard and start over. You only pay for the hours it was running.

The shortcut: If you have access to a coding assistant — Claude Code, Cursor, Codex, whatever — you can paste this entire guide into it and let it run the commands for you. Claude Code can connect to your server via SSH and execute every step. That cuts the time to about 20 minutes. Most of these tools have a free tier, so even if you've never used one, it's worth trying for this.

What You're About to Do

In plain terms, here's what this guide covers:

  1. Rent a small server from Hetzner (a German hosting company)
  2. Connect to that server from your computer
  3. Run n8n on it using Docker
  4. Point a domain name at it so you can access it from anywhere

Let me briefly explain the pieces before we start.

What's a Server?

A server is just a computer that's always on, sitting in a data center somewhere. The reason we use one here is simple: if you ran n8n on your laptop, your automations would stop every time you close the lid. A server stays on. It's always listening, always running your workflows — even at 3am when you're asleep.

We're using Hetzner because they're based in Germany, their servers are in Europe (GDPR-friendly), and they cost a fraction of what Amazon AWS or Google Cloud charge. The smallest Hetzner server is under €5/month. A comparable AWS instance is €15-20+.

What's Docker?

When you install a normal app on your computer, you download it, run an installer, and hope nothing conflicts with your other software. Docker skips all of that. It packages n8n and everything it needs into a neat container that just works. You tell Docker "run n8n" and it handles the rest — no installation headaches, no dependency conflicts.

Think of it like a shipping container: everything n8n needs is packed inside, and it runs the same way on every machine.

What's Caddy?

Caddy is a small program that sits in front of n8n on your server and handles two things: it gives you a secure HTTPS connection (the padlock in your browser), and it routes traffic from your domain to n8n. You configure it once and forget about it.

What's a Domain and DNS?

When your server is running, it has an IP address — something like 167.235.42.100. You could access n8n by typing that into your browser, and if you want to skip the domain setup, that's fine for getting started.

But a domain (like n8n.yourdomain.com) is a human-friendly name that points to that IP address. DNS is the system that translates one into the other. Setting this up means you get a proper URL with a secure HTTPS connection — and honestly, there's something cool about having your own domain pointing to something you set up yourself.

Opening Your Terminal

Every step from here happens in your terminal — a text window where you type commands. It might feel unfamiliar, but you're mostly just pasting commands from this guide.

Mac: Press Cmd + Space, type "Terminal", press Enter. SSH works out of the box.

Windows 10/11: Press the Windows key, search for "Terminal" or "PowerShell", and open it. Windows 10 and 11 have SSH built in. If ssh doesn't work, go to Settings → Apps → Optional Features and add "OpenSSH Client."


Step-by-Step: Self-Hosting n8n on Hetzner

1. Create a Hetzner Account

Go to hetzner.com/cloud and sign up. You'll need to verify your identity and add a payment method.

2. Create a Server

Once you're in the Hetzner Cloud Console:

  1. Select your project (or create a new one)
  2. Click + CREATE SERVER
  3. Configure these settings:
    • Location: Pick the one closest to you (Falkenstein, Nuremberg, or Helsinki)
    • Image: Go to the APPS tab and select Docker CE — this saves you from installing Docker manually later
    • Type: Choose CPX11 (the cheapest shared option). It's more than enough for n8n
    • SSH Key: Add your SSH key (see below). This is how you'll securely connect to the server
    • Backups (optional): Check this box if you want Hetzner to automatically back up your server daily. It costs 20% of your server price (about €1/month on the CPX11). Worth it for peace of mind — you can always enable it later too

SSH Keys

Hetzner lets you choose between SSH keys and passwords. SSH keys are more secure and easier to use once set up.

If you've never created an SSH key before, open your terminal and run:

ssh-keygen -t ed25519

It'll ask where to save the key — press Enter to accept the default. It'll then ask for a passphrase — you can press Enter twice to skip this (no passphrase is fine for this use case). Then copy your public key:

cat ~/.ssh/id_ed25519.pub

This prints a long string starting with ssh-ed25519. Copy the whole thing and paste it into Hetzner's SSH key field when creating the server.

On Windows? The same commands work in PowerShell or Windows Terminal. Your key is saved in C:\Users\YourName\.ssh\. If cat doesn't work, use type instead: type %USERPROFILE%\.ssh\id_ed25519.pub

Using a coding assistant? Tell it "help me create an SSH key and add it to Hetzner" — it'll walk you through the exact steps for your operating system.

3. Connect to Your Server

Once the server is created, Hetzner shows you its IP address right on the server's overview page in the Cloud Console. You'll also need this IP for the DNS step later, so keep it handy. Connect to it from your terminal:

ssh root@your-server-ip

Replace your-server-ip with the actual IP address (something like 167.235.42.100).

If this is your first time connecting, it'll ask you to confirm the fingerprint — type yes.

You're now logged into your server.

4. Install Docker Compose

The Hetzner Docker image comes with Docker but not Docker Compose (which we need to run n8n and Caddy together). Install it:

apt update && apt -y upgrade
apt install docker-compose-plugin

5. Clone the n8n Setup Files

n8n provides a ready-made configuration repository with everything you need — the Docker Compose file, Caddy configuration, and folder structure. Clone it:

git clone https://github.com/n8n-io/n8n-docker-caddy.git
cd n8n-docker-caddy

6. Create Docker Volumes

Docker volumes are where your data gets stored. They persist between restarts, so you don't lose your workflows when the server reboots.

docker volume create caddy_data
docker volume create n8n_data

7. Set Up Your Domain (DNS)

Before n8n can work with HTTPS, you need a domain pointing to your server.

Don't have a domain yet? You can buy one from Cloudflare, Namecheap, or even directly through Hetzner's domain registration. A .com domain costs around €10/year. Pick anything you like — it's just for accessing your n8n instance.

Once you have a domain, you need to create a DNS A record. This tells the internet "when someone visits n8n.yourdomain.com, send them to my server."

  • Name/Host: n8n (this creates n8n.yourdomain.com)
  • Value/Points to: Your server's IP address (from Step 3)
  • TTL: Leave the default

Every domain provider has a slightly different interface for this. If you're unsure where to find your DNS settings, ask your coding assistant: "How do I create an A record on your provider?" — it'll walk you through the exact clicks.

DNS changes can take a few minutes to an hour to propagate. You can check if it's working:

ping n8n.yourdomain.com

If it returns your server's IP, you're good.

8. Open Firewall Ports

Your server needs to accept web traffic. Open ports 80 (HTTP) and 443 (HTTPS):

sudo ufw allow 80
sudo ufw allow 443

9. Configure n8n and Caddy

Two files need your domain name: .env (n8n's settings) and caddy_config/Caddyfile (the reverse proxy).

Easiest way — tell your coding assistant:

"I'm SSH'd into my server in the /root/n8n-docker-caddy directory. Edit .env to set my domain to n8n.yourdomain.com, protocol to https, and timezone to Europe/Berlin. Then update caddy_config/Caddyfile to use the same domain."

Doing it manually? You'll use nano, a text editor in your terminal. It looks unusual, but it's simple: arrow keys to move, type to edit, Ctrl+X then Y then Enter to save.

nano .env

The file has comments explaining each variable. The key ones to change:

  • N8N_HOST: n8n.yourdomain.com
  • N8N_PROTOCOL: https
  • GENERIC_TIMEZONE: Your timezone, e.g. Europe/Berlin (find yours here)

Save and exit, then edit the Caddy config:

nano caddy_config/Caddyfile

Replace the placeholder domain with yours:

n8n.yourdomain.com {
    reverse_proxy n8n:5678 {
        flush_interval -1
    }
}

Save and exit.

10. Start Everything

docker compose up -d

This pulls the Docker images and starts both n8n and Caddy. It might take a minute or two the first time.

11. Open n8n

Go to https://n8n.yourdomain.com in your browser. You should see the n8n setup screen. Create your owner account and you're in.

That's it. n8n is running on your server, accessible from anywhere, with automatic HTTPS.


After Setup

Keeping n8n Running

Docker is configured to restart automatically. If your server reboots (Hetzner does occasional maintenance), n8n comes back up on its own. You don't need to do anything.

Backups

Your workflows are stored on your server. Two layers of protection:

  1. n8n's built-in export: Inside n8n, you can export any workflow as a JSON file. Good for sharing or moving workflows between instances.
  2. Hetzner server backups: If you enabled backups during server creation, Hetzner automatically takes a daily snapshot of your entire server. It keeps seven backups on a rolling basis. If something goes wrong, you can restore your server to any of those snapshots from the Hetzner Console. You can enable this anytime under your server's "Backups" tab.

Updating n8n

When a new version of n8n comes out, updating is three commands:

cd /root/n8n-docker-caddy
docker compose pull
docker compose down && docker compose up -d

If Something Went Wrong

Can't connect via SSH? Double-check the IP address and make sure you're using the right SSH key. If you set a password instead of an SSH key, use ssh root@your-server-ip and enter the password.

Domain not working? DNS can take up to an hour to propagate. Wait a bit and try again. Make sure the A record points to your server's IP.

n8n not loading? Check if the containers are running:

docker compose ps

If they're not, check the logs:

docker compose logs

Remember: If you're stuck at any point, paste the error message into your coding assistant. It's seen these errors thousands of times and can usually tell you exactly what's wrong.


What You Just Unlocked

You now have n8n running 24/7 on your own server. No execution limits. No monthly subscription to n8n. Your workflows run whenever they need to — at 3am, on weekends, thousands of times a day — and nobody asks you to upgrade.

As you progress through this course, self-hosting also means you can install community nodes and npm packages. Need to scrape data from a website? There's cheerio. Extract text from a PDF? pdf-parse. Read text from images? Tesseract.js. We mentioned this in the previous guide — this extensibility is one of the main reasons n8n is worth learning.

And by the way — this server isn't limited to n8n. It's a full Linux machine. You can run other Docker containers alongside n8n: databases, APIs, websites, whatever you need. For now though, n8n is more than enough to keep you busy.

You're set up. Let's start building.