n8n Free: Self-Host Workflow Automation with Docker

n8n Free: How to Self-Host the Open-Source Automation Tool with Docker

Disclosure: This post contains one or more links to providers we have a real, registered affiliate/referral relationship with. We may earn a commission at no extra cost to you if you sign up through them.

If you’ve been comparing Zapier, Make, and other automation platforms, you’ve probably noticed the pricing adds up fast once your workflow volume grows. That’s why so many developers and sysadmins are switching to n8n free — the open-source, node-based automation tool that you can self-host without per-execution fees.

This guide walks through exactly how to get n8n running for free on your own infrastructure using Docker, how it compares to the paid n8n Cloud plans, and how to harden it for production use.

What Is n8n and Why Is It Free?

n8n (pronounced “n-eight-n”) is a fair-code workflow automation tool. Unlike Zapier, its core is licensed under the Sustainable Use License, which means you can self-host it for free — including for internal business use — as long as you don’t resell it as a competing service.

That’s the key distinction developers care about: n8n free isn’t a crippled trial. When you self-host, you get:

  • Unlimited workflow executions (no per-task billing)
  • Full access to 400+ integration nodes
  • Custom JavaScript/Python code nodes
  • Webhook triggers, cron scheduling, and error workflows
  • Complete data ownership — nothing leaves your server
  • The only thing you give up compared to n8n Cloud is managed hosting, automatic updates, and official SLA-backed support. For most technical teams, that trade-off is easily worth it.

    n8n Free (Self-Hosted) vs n8n Cloud

    | Feature | Self-Hosted (Free) | n8n Cloud (Paid) |
    |—|—|—|
    | Cost | $0 (server costs only) | Starts ~$20/month |
    | Execution limits | Unlimited | Plan-based caps |
    | Data residency | Your server | n8n’s infrastructure |
    | Maintenance | You manage updates | Fully managed |
    | Custom nodes | Yes | Limited |
    | SSO/enterprise features | Requires Enterprise license | Available on higher tiers |

    If you’re comfortable running a VPS, self-hosting is almost always the better economic choice long-term.

    Prerequisites

    Before you start, make sure you have:

  • A Linux VPS (Ubuntu 22.04+ recommended) with at least 1 GB RAM
  • Docker and Docker Compose installed
  • A domain name (optional but recommended for HTTPS)
  • Basic familiarity with the command line
  • If you don’t already have a server, providers like DigitalOcean offer droplets that are more than capable of running n8n comfortably, even on their cheapest tier. We cover general VPS hardening in our Linux server security checklist if you want to lock things down further.

    Installing Docker and Docker Compose

    If Docker isn’t installed yet, run:

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

    Verify the install:

    docker --version
    docker compose version

    Running n8n with Docker Compose

    Create a project directory and a docker-compose.yml file:

    mkdir ~/n8n-stack && cd ~/n8n-stack
    nano docker-compose.yml

    Paste in the following configuration:

    version: "3.8"
    
    services:
      n8n:
        image: n8nio/n8n:latest
        restart: unless-stopped
        ports:
          - "5678:5678"
        environment:
          - N8N_HOST=n8n.yourdomain.com
          - N8N_PORT=5678
          - N8N_PROTOCOL=https
          - NODE_ENV=production
          - WEBHOOK_URL=https://n8n.yourdomain.com/
          - GENERIC_TIMEZONE=America/New_York
        volumes:
          - n8n_data:/home/node/.n8n
    
    volumes:
      n8n_data:

    Start the stack:

    docker compose up -d

    Check the logs to confirm it started cleanly:

    docker compose logs -f n8n

    At this point n8n is running on port 5678. You can access it directly via http://your-server-ip:5678, but for anything beyond local testing, you’ll want a reverse proxy with HTTPS — running automation workflows with credentials over plain HTTP is a bad idea.

    Adding HTTPS with Caddy

    The simplest way to get free, auto-renewing HTTPS is Caddy. Add it to your compose file:

      caddy:
        image: caddy:2
        restart: unless-stopped
        ports:
          - "80:80"
          - "443:443"
        volumes:
          - ./Caddyfile:/etc/caddy/Caddyfile
          - caddy_data:/data
    
    volumes:
      caddy_data:

    Create a Caddyfile:

    n8n.yourdomain.com {
        reverse_proxy n8n:5678
    }

    Point your domain’s A record at your server IP, then restart the stack:

    docker compose up -d

    Caddy will automatically request and renew a Let’s Encrypt certificate. If you’re using Cloudflare for DNS, you also get free DDoS protection and can proxy traffic through their network for an extra layer of security.

    Securing Your Free n8n Instance

    Running n8n free doesn’t mean cutting corners on security. A few essentials:

  • Enable basic auth or SSO — set N8N_BASIC_AUTH_ACTIVE=true with N8N_BASIC_AUTH_USER and N8N_BASIC_AUTH_PASSWORD environment variables at minimum.
  • Restrict the firewall — only allow ports 80, 443, and SSH; block direct access to 5678 from outside.
  • Back up the n8n_data volume regularly — this contains your workflows, credentials, and execution history.
  • Keep the image updated — pull the latest tag periodically to get security patches.
  • Use environment variables for secrets — never hardcode API keys inside workflow nodes.
  • For firewall rules, ufw makes this simple:

    sudo ufw allow OpenSSH
    sudo ufw allow 80/tcp
    sudo ufw allow 443/tcp
    sudo ufw deny 5678/tcp
    sudo ufw enable

    If uptime matters for your automations (e.g., triggering alerts or syncing data), it’s worth pairing your instance with an uptime monitor. BetterStack offers free-tier uptime checks and status pages that can ping your n8n webhook health endpoint and alert you the moment it goes down.

    Building Your First Free Workflow

    Once you’re logged in, try a simple test workflow:

    1. Add a Webhook trigger node — this gives you a unique URL n8n listens on.
    2. Connect it to an HTTP Request node to call any public API (e.g., a weather API).
    3. Add a Set node to reshape the response data.
    4. Send the result somewhere — Slack, email, or a Google Sheet.

    Here’s what a minimal workflow JSON export looks like, which you can import directly:

    {
      "nodes": [
        {
          "parameters": {
            "path": "weather-hook",
            "httpMethod": "GET"
          },
          "name": "Webhook",
          "type": "n8n-nodes-base.webhook",
          "typeVersion": 1,
          "position": [250, 300]
        }
      ],
      "connections": {}
    }

    This pattern — webhook in, transform, action out — covers the majority of real-world automation needs: syncing CRM data, monitoring alerts, posting to Slack, or scraping and reformatting content. It’s the same building block whether you’re running the free self-hosted version or paying for n8n Cloud.

    If you’re already running other self-hosted tools, check our guide on setting up Docker Compose stacks for home labs for patterns on organizing multiple services alongside n8n.

    Common Pitfalls with Self-Hosted n8n

  • Forgetting persistent volumes — without a named volume, restarting the container wipes all workflows.
  • Not setting WEBHOOK_URL — webhooks silently fail to register correctly behind a reverse proxy without this.
  • Running as root — the official image already drops privileges; don’t override the user in custom Dockerfiles unless necessary.
  • Ignoring execution data growth — by default n8n keeps all execution logs, which can bloat your database over time. Configure EXECUTIONS_DATA_PRUNE=true to auto-clean old records.
  • Skipping backups — export your workflows periodically with the CLI or API, not just relying on the volume snapshot.
  • Scaling Beyond a Single Server

    For low-to-moderate workflow volume, a single Docker container backed by SQLite (the default) is fine. If you start running hundreds of concurrent executions, switch to PostgreSQL and consider n8n’s queue mode with Redis, which lets you run multiple worker containers in parallel. This is still entirely free under the self-hosted license — you’re only paying for the extra compute.

    A typical scaled setup adds:

      postgres:
        image: postgres:15
        restart: unless-stopped
        environment:
          - POSTGRES_USER=n8n
          - POSTGRES_PASSWORD=changeme
          - POSTGRES_DB=n8n
        volumes:
          - postgres_data:/var/lib/postgresql/data

    Then point n8n at it with DB_TYPE=postgresdb and the corresponding connection environment variables.


    Recommended: Want to explore DigitalOcean yourself? DigitalOcean is a direct vendor link (not an affiliate/tracked link).

    FAQ

    Is n8n really free to self-host?
    Yes. The core n8n platform is licensed under the Sustainable Use License, allowing free self-hosting for internal use, including commercial businesses automating their own operations. You only pay for the server it runs on.

    What’s the catch with the free version?
    There isn’t a feature catch — you get the same nodes and capabilities as paid plans. The trade-offs are that you manage your own updates, backups, and uptime, and certain enterprise features (SSO, advanced permissions, dedicated support) require a paid Enterprise license.

    Can I use n8n free for client work or a SaaS product?
    You can use it internally to automate your own business processes, but reselling n8n itself as a hosted service to third parties violates the license. Read the Sustainable Use License terms before commercial redistribution.

    How much server power do I need?
    A 1 GB RAM / 1 vCPU VPS handles light-to-moderate workflow volume fine. Heavier usage with many concurrent executions benefits from 2 GB+ RAM and a PostgreSQL backend instead of SQLite.

    Does self-hosted n8n support webhooks and scheduling?
    Yes, both are fully supported in the free self-hosted version, including cron-based triggers and webhook-based triggers, identical to the cloud offering.

    How do I back up my n8n workflows?
    Export workflows via the UI, use the n8n CLI (n8n export:workflow --all), or snapshot the Docker volume where .n8n data is stored. Automating this with a cron job is recommended for production instances.

    Wrapping Up

    Running n8n free via Docker gives you enterprise-grade automation capability without recurring per-task fees. Between the Docker Compose setup, Caddy for HTTPS, and a few security hardening steps, you can have a production-ready automation server running in under thirty minutes. From there, the only real cost is your VPS — and a small droplet is enough to run dozens of active workflows comfortably.

    If you found this useful, check out our related guide on self-hosting monitoring stacks with Docker to pair uptime alerts with your new automation server.

    Comments

    Leave a Reply

    Your email address will not be published. Required fields are marked *