How to Self-Host n8n: A Beginner’s Step-by-Step Guide

Self-hosting n8n means running the free, open-source Community Edition on your own server instead of paying per execution on a cloud plan. This guide covers Docker Compose setup through your first working workflow — expect about 1-2 hours for a first-time setup, most of which is waiting on DNS and SSL certificates rather than active work.

Prerequisites

  • A VPS with at least 1GB RAM (providers like Hetzner, DigitalOcean, or a managed option like PikaPods run $4-7/month for adequate specs)
  • A domain name (or subdomain) pointed at your server’s IP address
  • Basic comfort with a terminal/SSH — no coding required, just following commands
  • Docker and Docker Compose installed on the server

Step 1: Provision Your Server

Spin up a basic Ubuntu VPS from your provider of choice. 1GB RAM is the practical minimum for n8n plus its database; 2GB gives more comfortable headroom if you’ll run several workflows concurrently. Point your domain’s DNS A record at the server’s IP address before continuing — propagation can take up to an hour, so starting this early avoids waiting later.

Step 2: Install Docker and Docker Compose

SSH into your server and install Docker using your distribution’s official installation script (Ubuntu’s official docs provide a one-line install command). Docker Compose typically ships bundled with modern Docker installations — verify with docker compose version before moving on.

Step 3: Write Your Docker Compose File

Create a docker-compose.yml file defining the n8n container along with a Postgres database container (recommended over n8n’s default SQLite for anything beyond casual testing). Set environment variables for your domain, timezone, and a strong encryption key — n8n uses this key to encrypt stored credentials, so save it somewhere safe outside the server itself.

Step 4: Set Up a Reverse Proxy

Add a reverse proxy (Caddy is the simplest choice for beginners, since it handles SSL certificates automatically) in front of n8n so it’s reachable at your domain over HTTPS rather than a raw IP and port. Caddy’s configuration for a single service is typically just a few lines specifying your domain and the internal port n8n listens on.

Step 5: Get SSL Working

If you’re using Caddy, SSL certificates via Let’s Encrypt are issued and renewed automatically once your DNS is correctly pointed at the server — there’s usually nothing manual to configure. Confirm it worked by visiting your domain and checking for a valid padlock in the browser before proceeding.

Step 6: Launch and Complete Setup

Run docker compose up -d to start everything in the background, then visit your domain. n8n’s first-run wizard will prompt you to create an owner account — do this immediately, since an unsecured first-run instance is briefly accessible to anyone who finds the URL.

Step 7: Build Your First Workflow

Start with something simple to confirm everything works end to end: a scheduled trigger that sends yourself an email or Slack message. Once that runs successfully, you’ve confirmed the full chain (server, database, SSL, and n8n itself) is working correctly before building anything business-critical on top of it.

Cost Comparison vs Zapier and Make

A self-hosted n8n instance on a $5-7/month VPS handles effectively unlimited executions — compare that to Zapier’s $19.99/month for 750 tasks or Make’s $9/month for 10,000 credits. At high volume (thousands of monthly automated actions), self-hosted n8n is meaningfully cheaper than either, though it trades that savings for the setup time and ongoing responsibility of maintaining your own server.

Common Mistakes to Avoid

  • Skipping the database upgrade: n8n’s default SQLite is fine for testing but not recommended for anything running regularly in production.
  • Losing the encryption key: without it, previously stored credentials become unreadable if you ever migrate servers.
  • Leaving the instance unsecured after first launch: complete the owner account setup immediately after your first successful deploy.
  • Skipping backups: your workflows and credentials live entirely on this one server unless you set up regular backups.

Once your instance is running, see our 15 workflow automation ideas for concrete workflows worth building first, or if you want to see how n8n compares to the no-code alternatives before committing further, our full Zapier vs Make vs n8n comparison covers the tradeoffs in depth.

FAQ

Do I need coding experience to self-host n8n?

No — following documented commands via SSH is enough. Building workflows inside n8n itself is entirely visual/no-code once the server is running.

How much does self-hosting n8n actually cost per month?

Typically $5-7/month for a basic VPS with adequate specs, plus a few dollars a year for a domain if you don’t already own one — with no per-execution charges at all.

Is self-hosted n8n secure?

Yes, provided you complete the initial owner account setup immediately, keep Docker images updated, and use SSL (as covered in Step 5) — the same baseline practices as any self-hosted web application.

Can I switch from self-hosted to n8n Cloud later?

Yes, n8n supports exporting and importing workflows as JSON files, making migration between self-hosted and Cloud instances straightforward if you decide server maintenance isn’t for you.

Disclosure: AppGuideHQ may earn a commission if you sign up through some links on this page, at no extra cost to you. See our Terms of Use.