How to Install n8n: Cloud vs Docker vs npm
· By AI Compare
Three ways to run n8n, with exact commands and when to choose each one.
Three ways to run n8n
| Option | Setup time | Cost | Best for |
|---|---|---|---|
| n8n Cloud | 2 minutes | From €20/month | Non-technical teams, quick start |
| Docker | 10–30 minutes | Free + server | Production self-hosting |
| npm / npx | 5 minutes | Free | Trying n8n on your laptop |
Option 1: n8n Cloud
- Go to n8n.io and start a free trial.
- Pick a workspace name. You get a URL like
yourname.app.n8n.cloud. - Start building. Updates, backups and SSL are handled for you.
Choose Cloud if nobody on your team wants to maintain a server. You pay per execution (2,500 on Starter), so check your volume first.
Option 2: Docker (recommended for self-hosting)
Docker runs n8n in an isolated container, so it is easy to update and move. Install Docker Desktop on your computer or Docker Engine on a Linux server, then run:
docker volume create n8n_data
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-e GENERIC_TIMEZONE="Europe/Budapest" \
-e TZ="Europe/Budapest" \
-e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true \
-e N8N_RUNNERS_ENABLED=true \
-v n8n_data:/home/node/.n8n \
docker.n8n.io/n8nio/n8n
Open http://localhost:5678 and create the owner account.
What each part does:
n8n_datavolume keeps your workflows and credentials when the container restarts. Without it, you lose everything on restart.-p 5678:5678exposes the n8n editor on port 5678.GENERIC_TIMEZONEmakes Schedule Trigger nodes run in your local time.
For a real server, n8n recommends Docker Compose with PostgreSQL and a reverse proxy for HTTPS. We walk through that setup in self-host n8n on a VPS.
Option 3: npm or npx (quick local test)
n8n needs Node.js 20.19 to 24.x. Check your version with node -v.
Try it without installing:
npx n8n
Or install globally:
npm install n8n -g
n8n start
Then open http://localhost:5678.
npm is great for learning and testing. For anything other people depend on, use Docker, because upgrades and backups are simpler and you avoid Node version conflicts.
Webhooks on a local install
Apps like Stripe or Typeform need a public URL to send data to your webhook nodes. On a laptop, localhost is not reachable from the internet. Options:
- Use a tunnel such as Cloudflare Tunnel (
cloudflared) for testing. - Deploy to a VPS with a domain for anything real.
Updating n8n
- Cloud: automatic.
- Docker:
docker pull docker.n8n.io/n8nio/n8n, then recreate the container. Your data stays in the volume. - npm:
npm update -g n8n.
Back up first. Read release notes for breaking changes before major upgrades.
Which option should you choose?
- Just exploring: npx.
- Running real business workflows and someone can manage a server: Docker on a VPS.
- No technical person available: n8n Cloud.
