I moved my n8n instance from the cloud to a home server about six months ago, and the difference in both control and cost has been substantial. What started as a $20/month cloud subscription is now a containerized service running alongside Plex and Home Assistant on hardware I already owned. If you’ve been curious about n8n self-hosting but weren’t sure where to start, this is your roadmap.
Why Self-Host n8n?
n8n is a workflow automation tool—think Zapier, but open source and extensible. You can connect APIs, databases, and services to automate everything from data syncing to notification routing. The cloud version works fine, but self-hosting offers a few compelling advantages:
- Cost control: You pay for hardware once, not monthly subscriptions
- Data sovereignty: Your workflows and credentials stay on your infrastructure
- Unlimited executions: No usage caps or throttling
- Customization: Install custom nodes, modify the source, run your own version
The tradeoff? You’re responsible for maintenance, backups, and uptime. For a homelab environment where you’re already managing services, that’s usually acceptable.
What You’ll Need
Before diving in, let’s establish baseline requirements. n8n isn’t particularly demanding, but you’ll want:
- A server or NAS with Docker support (Synology, QNAP, or a dedicated Linux box)
- At least 2GB of available RAM as a practical minimum—4GB if you plan to run PostgreSQL alongside or chain heavier API calls. The official docs allow 1GB, but real-world reports of out-of-memory errors at that level are common enough that 2GB is the honest floor.
- 20GB of SSD storage for the OS, Docker, n8n itself, and a reasonable buffer for execution logs
- Basic familiarity with Docker Compose and terminal commands
- A domain or subdomain, if you want external access
I’m running mine on an Intel NUC with 16GB RAM running Ubuntu Server, but I’ve seen successful deployments on Raspberry Pi 4s (4GB+ models) and older laptops repurposed as home servers. Pi 5s with 8GB are arguably the sweet spot for a dedicated n8n box in 2026.
Setting Up n8n Self-Hosting with Docker
Docker is the cleanest path to getting n8n running. You could install it directly on the host system via npm, but containerization keeps dependencies isolated and makes updates straightforward.
Basic Docker Compose Setup
Create a directory for your n8n installation and add a docker-compose.yml file. Here’s a minimal working configuration:
services:
n8n:
image: docker.n8n.io/n8nio/n8n:1.100.1
container_name: 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/Berlin
- N8N_ENCRYPTION_KEY=replace-me-with-a-long-random-string
volumes:
- ./n8n_data:/home/node/.n8n
Run docker-compose up -d And n8n will be accessible at http://your-server-ip:5678. The volume mapping ensures your workflows and credentials persist between container restarts.
Adding a Database
By default, n8n uses SQLite for storage. That’s fine for light usage, but if you’re running complex workflows or need better performance, PostgreSQL is worth the extra setup. Add this to your Docker Compose file:
postgres:
image: postgres:15
container_name: n8n-postgres
restart: unless-stopped
environment:
- POSTGRES_USER=n8n
- POSTGRES_PASSWORD=n8n
- POSTGRES_DB=n8n
volumes:
- ./postgres_data:/var/lib/postgresql/data
Then update the n8n service environment variables:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=n8n
- DB_POSTGRESDB_PASSWORD=n8n
Securing External Access
If you want to access n8n from outside your home network—useful for webhook integrations or mobile access—you’ll need to handle SSL and expose it safely. Basic auth helps, but HTTPS is non-negotiable if you’re exposing credentials.
I use Nginx Proxy Manager running in another container to handle reverse proxying and Let’s Encrypt certificates. Caddy is another excellent option that handles SSL automatically. Either way, you’ll want:
- A domain or subdomain pointed at your home IP
- Port forwarding is configured on your router (typically port 443)
- A reverse proxy handling SSL termination
If your ISP blocks inbound connections or you’re on a CGNAT network, Cloudflare Tunnels provides an alternative that doesn’t require port forwarding.
Real-World Usage Patterns
Once n8n is running, the possibilities stack up quickly. Here are workflows I’ve found genuinely useful:
- RSS to Discord: Monitor specific subreddits or blogs and push updates to a Discord channel
- Home automation glue: Connect Home Assistant to services that don’t have native integrations
- Backup orchestration: Trigger backups, verify them, and send notifications on failure
- API polling: Check services at intervals and react to changes
The visual workflow editor makes it easy to quickly prototype ideas. The learning curve is gentler than writing custom scripts, but you still have the power to dive into code when needed.
Maintenance and Backups
Self-hosting means owning the operational burden. A few practices that have served me well:
- Back up the volume directory regularly: Your workflows, credentials, and execution history live in
./n8n_data - Pin container versions: Use specific tags like
n8nio/n8n:1.17.0instead oflatestto avoid surprise breaking changes - Monitor execution logs: n8n’s execution view shows failed workflows, but consider forwarding critical errors to a notification channel
- Update deliberately: Check release notes before pulling new versions
I run a weekly backup script that snapshots both the n8n data directory and the PostgreSQL database, then syncs encrypted copies to Backblaze B2.
When Self-Hosting Doesn’t Make Sense
To be fair, self-hosting isn’t always the right call. If you need guaranteed uptime for business-critical workflows, cloud hosting (whether n8n Cloud or your own VPS) makes more sense. If you’re not comfortable troubleshooting Docker issues or don’t have reliable power and internet at home, the operational overhead might outweigh the benefits.
But for homelab enthusiasts, developers wanting a personal automation hub, or anyone running local services that need orchestration, n8n self-hosting hits a sweet spot between capability and complexity.
Give It a Weekend
Getting n8n running locally is a weekend project with long-term payoff. Start with the basic Docker setup, create a few simple workflows to test functionality, then gradually expand based on what you actually need to automate. The beauty of self-hosting is that you can experiment freely without worrying about execution limits or monthly bills.
If you’re already running other services on your homelab, n8n slots in naturally as the connective tissue between them. And if this is your first self-hosted service, it’s a gentle introduction to container management with immediate practical value.
