Skip to content
Self-hosting guide

How to Self-Host n8n for Free

Last reviewed

Self-hosting n8n gives you a free, unlimited, model-agnostic automation platform that's perfect for building AI agents. This guide walks through a Docker deployment you can run on a $5/month server or your own machine.

Why self-host n8n

The self-hosted Community Edition of n8n is free and unlimited — no per-execution billing and no per-seat fees. Your credentials and data never leave your server, which matters when agents touch CRM records, inboxes, or customer data.

The only running cost is the server itself (a small VPS is plenty to start) plus any model API usage your agents incur.

Deploy with Docker

  1. 1 Provision a small Linux server (1–2 GB RAM is enough to start).
  2. 2 Install Docker and Docker Compose.
  3. 3 Run: docker run -it --rm -p 5678:5678 -v n8n_data:/home/node/.n8n n8nio/n8n
  4. 4 Open http://your-server-ip:5678 and create the owner account.
  5. 5 Put it behind a reverse proxy (Caddy or Nginx) for automatic HTTPS.

Add AI agent capabilities

  1. 1 In the editor, create a new workflow.
  2. 2 Add an 'AI Agent' node and connect a chat model credential (OpenAI, Anthropic, or a local model via Ollama).
  3. 3 Attach tools — HTTP request, a database, or other app nodes — so the agent can act.
  4. 4 Add a trigger (webhook, schedule, or chat) and activate the workflow.

Keep it healthy

Pin a specific n8n version and back up the n8n_data volume regularly. Set up a reverse proxy with HTTPS and basic auth, and monitor disk usage so execution logs don't fill the disk.

Frequently asked questions

How much does self-hosting n8n cost?

The software is free. You pay only for the server (a small VPS often runs a few dollars a month) and any model API usage your agents consume.

Is self-hosted n8n safe for production?

Yes, with sensible ops: HTTPS via a reverse proxy, regular backups of the data volume, version pinning, and monitoring. Many businesses run production automations this way.