DEV Community

Abinash Bhatta
Abinash Bhatta

Posted on

How to Self-Host n8n with Docker Compose (Free Zapier Alternative)

Why n8n?

If you are paying for Zapier or Make, stop.

n8n is a free, open-source workflow automation tool that you can
run on your own machine. Your data never leaves your server,
no monthly bills, no task limits.

What you will need

  • Docker installed on your machine
  • Docker Compose
  • 5 minutes

The docker-compose.yml

services:
  n8n:
    image: n8nio/n8n:latest
    container_name: n8n
    restart: unless-stopped
    ports:
      - "5678:5678"
    environment:
      - N8N_HOST=localhost
      - N8N_PORT=5678
      - N8N_PROTOCOL=http
      - WEBHOOK_URL=http://localhost:5678/
      - GENERIC_TIMEZONE=Asia/Kolkata
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:
    driver: local
Enter fullscreen mode Exit fullscreen mode

Run it

docker compose up -d
Enter fullscreen mode Exit fullscreen mode

Then open http://localhost:5678 in your browser.
Create your owner account on first visit and you are inside n8n.

What each key line does

  • image: n8nio/n8n:latest — pulls the official n8n image
  • restart: unless-stopped — auto restarts on reboot
  • ports 5678:5678 — exposes n8n in your browser
  • GENERIC_TIMEZONE — keeps your scheduled workflows on time
  • n8n_data volume — persists all your workflows and credentials

Full Video Walkthrough

I have covered this step by step in a video on my YouTube channel ArrayAcademy including every line of the compose file explained.

📺 Watch here — https://www.youtube.com/watch?v=t3RSWkvB8_Y
📄 Compose file — https://gist.github.com/abinash889/9c0f9ab02c160c95134a86fcef87b323

What's Next

In the next video I am covering the full n8n interface overview
followed by building a real Gmail to Telegram notification workflow — completely free.

Subscribe to ArrayAcademy on YouTube to follow along.


Drop a comment if you have any questions. Happy to help!

Top comments (0)