Chapter 1

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)

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:

# 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 at http://localhost:5678 and 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.

  1. Visit railway.app and sign up (GitHub login supported)
  2. In the Railway console, click New Project → Deploy from Template, search "n8n" and select the official template
  3. On the template config page, set environment variables: N8N_BASIC_AUTH_USER, N8N_BASIC_AUTH_PASSWORD, GENERIC_TIMEZONE
  4. Click Deploy — Railway automatically pulls the n8n image and starts the service, typically within 2–3 minutes
  5. After deployment, find your generated domain (e.g., n8n-production-xxxx.up.railway.app) and set it as WEBHOOK_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.

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.

  1. Visit zeabur.com and sign up (GitHub/Google login supported)
  2. Create a new project, choose Deploy from Template, search "n8n" in the template marketplace
  3. Select a region (HKG-Hong Kong or NRT-Tokyo are fastest for East Asian users)
  4. Configure environment variables and click deploy. Zeabur automatically assigns a *.zeabur.app subdomain
  5. (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.

  1. Visit n8n.io/cloud and click Start for free
  2. Sign up with your email; the free trial is 14 days with no credit card required
  3. You'll be assigned a dedicated yourname.app.n8n.cloud subdomain
  4. 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:

  1. Create admin account: Enter your email and password — this is the master account for managing n8n
  2. Complete setup wizard: n8n asks about your use case (personal/team) to recommend workflow templates
  3. Enter workflow list: The initial screen shows sample templates you can import directly
  4. 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 using latest, to avoid unexpected breaking changes during auto-upgrades. Always test major version upgrades in a staging environment first.

Rate this chapter
4.7  / 5  (100 ratings)

💬 Comments