Free guide
Self-Host n8n in 10 Minutes
Stop renting your automation stack and run your own pipelines for free.
What You Need
- Tools: Docker and Docker Compose installed on your computer or a cloud server.
- Accounts: None required for self-hosting. (Optional: An n8n Cloud account if you prefer managed hosting).
- Cost: 100% free for the self-hosted Community Edition (fair-code license). You only pay for your own server hosting if you run it in the cloud (usually $5/month for a basic VPS), or $0 if running locally on your own machine for testing.
Step-by-Step Guide
1. Set up your server or local environment Open your terminal (Mac/Linux) or PowerShell/WSL (Windows). Ensure Docker is running. Check your installation by running:
docker --version2. Create a project folder Make a dedicated directory for your n8n instance and navigate into it:
mkdir n8n-local && cd n8n-local3. Create your configuration file Create a file named docker-compose.yml and paste this exact setup:
version: "3.8"
services:
n8n:
image: n8nio/n8n:latest
restart: always
ports:
- "5678:5678"
environment:
- N8N_PORT=5678
volumes:
- ~/.n8n:/home/node/.n8n4. Launch n8n Run the following command in your terminal to start the container in the background:
docker compose up -d5. Open your dashboard Open your web browser and go to:
http://localhost:5678(If running on a remote server, replace localhost with your server's IP address).
6. Create your owner account Follow the on-screen prompts to set up your username and password. You are now ready to build workflows, combine visual blocks with JavaScript/Python code, and connect your tools.
Common Mistakes and Fixes
- Mistake: You cannot load the page at
localhost:5678. Fix: Check if Docker is running properly. Rundocker psto verify then8ncontainer is active. - Mistake: Connection refused on a remote server. Fix: Make sure port
5678is open in your server's firewall (e.g., runufw allow 5678on Ubuntu) and your cloud provider's security group settings. - Mistake: Workflows disappear after restarting Docker. Fix: Ensure your
docker-compose.ymlincludes thevolumesline (- ~/.n8n:/home/node/.n8n) so your data saves locally on your machine, not just inside the temporary container.
Ready to build smarter AI agents and custom automation pipelines? Follow @letagentswork for more practical guides.
Building agents too? Ask questions and get new builds first in Agent Lab on Telegram (free).
Made by Let Agents Work — follow @letagentswork
From the reel: Stop paying for Zapier use this free GitHub repo instead