Install & Deploy
Ch01 Install & Deploy
This chapter covers four mainstream n8n installation methods: Docker Compose for local development, Railway for quick cloud deployment, Zeabur for Asia-Pacific users, and the official n8n.cloud for zero-ops trials. Regardless of your technical background, you can have a running n8n instance in under 15 minutes.
Comparison of Installation Methods
| Method | Best For | Cost | Data Control | Difficulty |
|---|---|---|---|---|
| Docker Compose (local) | Dev/test, local runs | Free | Full control | โญโญ |
| Railway | Quick cloud launch | From $5/mo | Self-controlled | โญ |
| Zeabur | Asia-Pacific, Chinese UI | From $5/mo | Self-controlled | โญ |
| n8n.cloud | Zero-ops, quick trial | Free 14 days / then $24/mo | Hosted | โญ (easiest) |
Method 1: Docker Compose Local Deploy (Recommended for Dev)
Docker Compose is the most flexible installation method, giving you full control over all configuration while enabling fast local iteration. Here is a production-validated docker-compose.yml:
version: '3.8'
services:
n8n:
image: n8nio/n8n:latest
container_name: n8n
restart: unless-stopped
ports:
- "5678:5678"
environment:
# Basic config
- N8N_HOST=localhost
- N8N_PORT=5678
- N8N_PROTOCOL=http
- WEBHOOK_URL=http://localhost:5678/
# Auth (change password in production!)
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=your_strong_password
# Timezone
- GENERIC_TIMEZONE=America/New_York
- TZ=America/New_York
# Database (default SQLite; use PostgreSQL in prod)
- DB_TYPE=sqlite
# Execution record retention
- EXECUTIONS_DATA_PRUNE=true
- EXECUTIONS_DATA_MAX_AGE=168
volumes:
- n8n_data:/home/node/.n8n
networks:
- n8n_network
volumes:
n8n_data:
networks:
n8n_network:
Key environment variables explained:
- N8N_HOST: Hostname n8n listens on; in production, use your domain (e.g.,
n8n.yourdomain.com) - WEBHOOK_URL: Publicly accessible full URL used for Webhook triggers โ must be reachable from the internet
- N8N_BASIC_AUTH_ACTIVE: Enable basic authentication; always enable in production
- GENERIC_TIMEZONE: Timezone used by scheduled workflow triggers
- EXECUTIONS_DATA_MAX_AGE: Execution log retention in hours; 168 = 7 days
# Run in the directory containing docker-compose.yml
docker compose up -d
# Check running status
docker compose ps
# Follow live logs
docker compose logs -f n8n
# Stop the service
docker compose down
# Upgrade n8n
docker compose pull && docker compose up -d
First launch: After running
docker compose up -d, open your browser athttp://localhost:5678and log in with the credentials you configured. The first visit will prompt you to complete an initialization wizard.
Method 2: Railway One-Click Deploy
Railway is a modern PaaS platform offering near-one-click n8n deployment, ideal for users who don't want to manage their own servers.
- Visit railway.app and sign up (GitHub login supported)
- In the Railway console, click New Project โ Deploy from Template, search "n8n" and select the official template
- On the template config page, set environment variables:
N8N_BASIC_AUTH_USER,N8N_BASIC_AUTH_PASSWORD,GENERIC_TIMEZONE - Click Deploy โ Railway automatically pulls the n8n image and starts the service, typically within 2โ3 minutes
- After deployment, find your generated domain (e.g.,
n8n-production-xxxx.up.railway.app) and set it asWEBHOOK_URL
Railway pricing: Railway's Hobby plan costs $5/month and includes 512 MB RAM โ sufficient for moderate n8n workloads. Usage beyond the plan limits is billed incrementally.
Method 3: Zeabur Deploy (Recommended for Asia-Pacific)
Zeabur is a deployment platform founded by a Chinese team, with server nodes in Hong Kong, Japan, and other Asia-Pacific regions. It offers a Chinese UI and supports AliPay and WeChat Pay โ making it a preferred choice for teams in East Asia.
- Visit zeabur.com and sign up (GitHub/Google login supported)
- Create a new project, choose Deploy from Template, search "n8n" in the template marketplace
- Select a region (HKG-Hong Kong or NRT-Tokyo are fastest for East Asian users)
- Configure environment variables and click deploy. Zeabur automatically assigns a
*.zeabur.appsubdomain - (Optional) Bind a custom domain in the Zeabur console and set it as
WEBHOOK_URL
Zeabur advantage: The Developer plan includes a built-in PostgreSQL template, so you get a production-grade setup with minimal manual configuration โ a high-value option for teams in East Asia.
Method 4: n8n.cloud Free Trial
If you just want to quickly try n8n's features, the official n8n.cloud is the simplest path โ no server knowledge needed.
- Visit n8n.io/cloud and click Start for free
- Sign up with your email; the free trial is 14 days with no credit card required
- You'll be assigned a dedicated
yourname.app.n8n.cloudsubdomain - Log in and start building workflows immediately in the visual editor
n8n.cloud limitations: After the trial, the minimum paid plan is ~$24/month and limits you to 5 active workflows. Data is stored on n8n's servers. For long-term use or data compliance requirements, self-hosting is recommended.
Post-Installation Initialization
Regardless of deployment method, the first time you access n8n you'll go through this initialization flow:
- Create admin account: Enter your email and password โ this is the master account for managing n8n
- Complete setup wizard: n8n asks about your use case (personal/team) to recommend workflow templates
- Enter workflow list: The initial screen shows sample templates you can import directly
- Add credentials: Find Credentials in the sidebar and add your first API credential (e.g., OpenAI API Key)
# Check n8n container health status
docker inspect n8n --format='{{json .State.Health}}'
# View current n8n environment variables
docker exec n8n env | grep N8N
# Manually backup n8n data (SQLite mode)
docker exec n8n cp /home/node/.n8n/database.sqlite /home/node/.n8n/database.sqlite.bak
# Export all workflows (for backup or migration)
docker exec n8n n8n export:workflow --all --output=/home/node/.n8n/workflows_backup.json
Version pinning: It's recommended to pin a specific n8n version in docker-compose.yml (e.g.,
n8nio/n8n:1.48.0) rather than usinglatest, to avoid unexpected breaking changes during auto-upgrades. Always test major version upgrades in a staging environment first.