Introduction
n8n is a popular open-source automation tool that lets you connect apps, transform data, and build workflows with minimal coding. If you are new to n8n, the variety of installation options can be confusing. This guide walks a basic user through the most common and reliable ways to run n8n: the Desktop app, n8n.cloud (hosted), npm (local), Docker (quick), and Docker Compose (recommended for self-hosting). Each method includes simple, copy-paste commands, basic configuration tips, and best practices for security and updates.
Quick overview: Which method should you choose?
- n8n Desktop: Best for learning and experimenting on a single machine. No server setup.
- n8n.cloud: Easiest production-ready option. Managed hosting with SSL and updates handled for you.
- npm (local): Simple if you want a quick local server and are comfortable with Node.js.
- Docker: Fast and isolated. Good for testing or production when combined with environment variables.
- Docker Compose: Recommended for production self-hosting (add Postgres, persistence, and reverse proxy).
1) n8n Desktop (Fastest for beginners)
The Desktop app is the simplest way to get started. It installs n8n with a GUI and local storage.
Steps:
1. Download the n8n Desktop app for your OS from the official site.
2. Install and launch the app.
3. The editor opens in your browser or a bundled window. Start building workflows.
Pros: No command line required, quick start. Cons: Not for production, stores data locally.
2) n8n.cloud (Managed hosting, easiest for production)
If you want production reliability without sysadmin work, n8n.cloud is the managed option.
Steps:
1. Go to the n8n.cloud signup page.
2. Create an account and follow the onboarding to create your instance.
3. Use the provided URL and credentials to open the editor.
Pros: SSL, backups, and updates handled. Cons: Paid for most production tiers.
3) npm (Local install, simple but limited)
This method uses Node.js and is great for local development. You need Node.js installed (Node 18+ recommended).
Install and run:
Install globally (you may need sudo on Linux/macOS)
npm install -g n8n
Start n8n
n8n start
Defaults: n8n will start on port 5678 and use a local SQLite database. For basic use, this is fine.
Tips:
4) Docker (Quick, portable)
Docker is an easy way to run n8n in an isolated container. It works well for testing or simple production setups.
Run with Docker:
Simple Docker run for testing
docker run --name n8n -p 5678:5678 -e GENERIC_TIMEZONE="UTC" -d n8nio/n8n:latest
To enable basic authentication, add environment variables:
docker run --name n8n -p 5678:5678 \
-e N8N_BASIC_AUTH_ACTIVE=true \
-e N8N_BASIC_AUTH_USER=myuser \
-e N8N_BASIC_AUTH_PASSWORD=mypassword \
-d n8nio/n8n:latest
Pros: Portable, easy to stop/start, and reproducible. Cons: Need to handle persistent volumes and production DB.
5) Docker Compose (Recommended for self-hosting production)
For a stable self-hosted instance, pair n8n with Postgres and persistent volumes using Docker Compose.
Example docker-compose.yml:
version: "3.8"
services:
n8n:
image: n8nio/n8n:latest
ports:
- "5678:5678"
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=n8n
- DB_POSTGRESDB_PASSWORD=password
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=securepassword
depends_on:
- postgres
volumes:
- n8n_data:/home/node/.n8n
postgres:
image: postgres:14
environment:
- POSTGRES_DB=n8n
- POSTGRES_USER=n8n
- POSTGRES_PASSWORD=password
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
n8n_data:
pgdata:
Run:
docker compose up -d
Notes:
Basic reverse proxy example (NGINX)
A minimal NGINX server block to proxy requests and enable LetsEncrypt:
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://127.0.0.1:5678;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Use certbot to enable HTTPS after the domain is pointing to your server.
Security and best practices
Updating and maintenance
– docker pull n8nio/n8n:latest
– docker compose up -d
Troubleshooting tips
– Docker: docker logs n8n
– Systemd/pm2: journalctl or pm2 logs
Conclusion and next steps
Installing n8n can be as simple as using the Desktop app or n8n.cloud, or as flexible as running a production-ready stack with Docker Compose and Postgres. For beginners, start with Desktop or n8n.cloud. When you need durability and multiple users, move to Docker Compose with Postgres and a reverse proxy for SSL.
Next steps:
Happy automating!