← Blog
Self-Host n8n on a server: Automate Everything

I used to pay $49/month for Zapier. Five zaps, a few hundred executions a day, nothing crazy. Then one month the bill jumped to $73 because I went over the execution limit. That's when I looked into n8n.

n8n is an open-source workflow automation tool. Think Zapier or Make, but you run it yourself. No per-execution pricing, no artificial limits on how many workflows you can build, no vendor deciding which integrations you're allowed to use. You install it on a server, point a domain at it, and you've got your own automation server.

I've been running n8n on a server for over a year now. Hundreds of workflows, thousands of executions per day, total cost: the price of the server. Here's how to set it up.

What can you actually do with n8n?

Before getting into the setup, a quick overview for people who haven't used it:

  • Connect APIs together. Get a Slack message when someone fills out a Typeform. Push new Stripe payments to a Google Sheet. Send a Discord alert when your monitoring detects downtime.
  • Process data. Transform JSON, merge data from multiple sources, filter and route based on conditions. It has a visual editor, but you can also write JavaScript or Python directly in nodes.
  • Schedule tasks. Run a workflow every hour, every day at 9am, or on a cron schedule. Scrape a price comparison page daily and get alerted when something drops below a threshold.
  • Trigger on webhooks. n8n gives you webhook URLs that other services can call. Stripe sends a webhook when a payment fails? n8n catches it, looks up the customer in your CRM, and sends a follow-up email. All automatic.

n8n has 400+ built-in integrations and a community that builds more. If a service has an API, you can connect it.

Why self-host instead of using n8n Cloud?

n8n offers a hosted version starting at $24/month. It works fine, but:

  • The free tier is limited to 5 active workflows
  • Paid plans cap executions (2,500 to 50,000/month depending on tier)
  • Your data flows through their servers
  • Custom nodes and some integrations aren't available on cloud

Self-hosting removes all these limits. Your workflows, your data, your server. The only cost is the server itself — a Cloud instance, a VPS, or even a dedicated server if you're running heavy automations. You can get started for as low as $3.90/month.

The trade-off: you're responsible for updates, backups, and uptime. But if you're the kind of person who builds automations, managing a server is probably within your comfort zone.

What you need

  • A server with at least 2 GB RAM and 1 CPU core — a Cloud instance, VPS, or dedicated server all work (n8n is lightweight)
  • Docker and Docker Compose installed (see our Docker guide if you need help)
  • A domain name pointed at your server (for HTTPS)
  • 10 minutes

For most setups, 2-4 GB of RAM is plenty. I run about 80 active workflows on 4 GB and the server barely breaks a sweat. CPU spikes during heavy data processing but stays under 30% most of the time. A Dedimax Cloud server at $3.90/month is more than enough to get started.

Step 1: Set up DNS

Point a subdomain at your server IP. For example:

n8n.yourdomain.com → A record → YOUR_SERVER_IP

This needs to propagate before step 4. Do it first.

Step 2: Create directories

SSH into your server and set things up:

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

Step 3: Create docker-compose.yml

nano docker-compose.yml

Paste this:

version: '3.8'

services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: unless-stopped
    ports:
      - "5678:5678"
    environment:
      - N8N_HOST=n8n.yourdomain.com
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - WEBHOOK_URL=https://n8n.yourdomain.com/
      - GENERIC_TIMEZONE=Europe/Paris
    volumes:
      - ./n8n_data:/home/node/.n8n

Replace n8n.yourdomain.com with your actual subdomain and adjust the timezone.

Step 4: Set up a reverse proxy with SSL

You need HTTPS. The easiest approach if you already have Nginx on your server:

sudo nano /etc/nginx/sites-available/n8n
server {
    listen 80;
    server_name n8n.yourdomain.com;

    location / {
        proxy_pass <http://127.0.0.1:5678>;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Enable the site and get an SSL certificate:

sudo ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d n8n.yourdomain.com

If you don't have Certbot: sudo apt install certbot python3-certbot-nginx -y

The WebSocket headers (Upgrade and Connection) are important. Without them, the n8n editor will load but the real-time updates won't work, and you'll be confused about why your test executions seem frozen.

Step 5: Start n8n

cd ~/n8n
docker compose up -d

Wait 30 seconds, then open https://n8n.yourdomain.com in your browser. You'll see the setup screen asking you to create an account.

That's it. You have a fully functional automation server.

Step 6: Secure it

A few things you should do right away:

Set up authentication. n8n creates a local account during setup. Use a strong password. If you want extra protection, add HTTP basic auth in Nginx on top of n8n's own auth.

Restrict access by IP (optional). If only you use n8n, you can lock it down to your IP in Nginx:

location / {
    allow YOUR_IP;
    deny all;
    proxy_pass <http://127.0.0.1:5678>;
    # ... rest of proxy config
}

Webhook URLs still need to be accessible from the internet though. You can be more selective:

location /webhook/ {
    proxy_pass <http://127.0.0.1:5678>;
    # ... proxy config (open to all)
}

location / {
    allow YOUR_IP;
    deny all;
    proxy_pass <http://127.0.0.1:5678>;
    # ... proxy config (restricted)
}

Enable automatic backups. Your workflow definitions and credentials are stored in ~/n8n/n8n_data. Back it up:

# Daily backup via cron
0 3 * * * tar czf ~/backups/n8n-$(date +\\%Y\\%m\\%d).tar.gz ~/n8n/n8n_data

Workflows to build first

If you're not sure where to start, here are a few workflows that pay for themselves immediately:

Uptime monitoring. Schedule a workflow to ping your websites every 5 minutes. If a request fails, send yourself a Slack/Telegram/email alert. Replaces UptimeRobot or similar services.

New customer onboarding. Stripe webhook triggers → create contact in CRM → send welcome email → notify your team in Slack. Runs automatically for every new customer.

Social media posting. Write a post, n8n publishes it to Twitter, LinkedIn, and your blog simultaneously. Schedule posts for the week on Monday morning.

Invoice processing. Receive invoices by email → extract data → log in spreadsheet → send to accounting software. Works with Gmail, Outlook, or any IMAP inbox.

Server alerts. Webhook from your monitoring tool (Grafana, Uptime Kuma) → format the alert → send to Discord/Slack with context and links.

Updating n8n

n8n releases updates frequently. Updating is simple:

cd ~/n8n
docker compose pull
docker compose up -d

The data persists in the mounted volume, so updates don't touch your workflows or credentials.

When you need more power

For most users, a small Cloud instance or VPS handles n8n without issues. But if you start running heavy workflows — processing thousands of records, making hundreds of API calls per minute, or running AI nodes that call LLM APIs — you might need more.

Signs you've outgrown your setup: executions start timing out, the editor feels sluggish, or htop shows sustained high CPU. At that point, move up:

  • Light usage (< 20 workflows): Cloud server from $3.90/month
  • Medium usage (20-100 workflows): VPS from $9.99/month
  • Heavy usage (100+ workflows, AI nodes, data processing): Dedicated server for maximum performance

All Dedimax plans include unlimited bandwidth. Since n8n makes a lot of outbound API calls and receives webhooks constantly, you don't want a bandwidth cap getting in the way.

The math

Zapier Pro: $49/month for 2,000 tasks/month. Need more? $73, $103, $148/month.

n8n on a Dedimax server: from $3.90/month (Cloud) or $9.99/month (VPS). Unlimited workflows. Unlimited executions. Your data stays on your server.

Over a year, that's $588 vs $47-120. And you get a server that can run other things too — a blog, a monitoring dashboard, a side project. It pays for itself with just the Zapier savings.

Continue reading

Le coin des experts

Un sujet bloquant ?
Une expertise à partager ?

On vous attend sur notre forum collaboratif. Déjà plus de 70 tutoriels en ligne (sysadmin, gaming, devops...) !

ça m'interesse
DEDIMAX DEDIMAX DEDIMAX DEDIMAX
DEDIMAX

Une question

À votre service !

Contactez-nous

Prendre contact