n8n install guide
n8n Installation: How to Install n8n With Docker
Install n8n with Docker in one command, then run it safely. This guide covers requirements, the one-line setup, the single docker run alternative, where your data lives, how to update, and why npm installs stop working in n8n 3.0.
Commands quoted from n8n's docs. 3.0 ready.
How do you install n8n?
The quickest way to install n8n yourself is n8n's one-line setup script, which runs n8n in Docker on your own machine or server. n8n's install guide gives this command, and n8n then opens at http://localhost:5678:
curl -fsSL https://get.n8n.io | shThe script checks that Docker is running, creates an n8n folder with a compose.yml and a .env file of generated secrets, then downloads and starts n8n. It is safe to run again: if n8n already exists in that folder, it changes nothing. If you'd rather read the script first, download it with curl -fsSL https://get.n8n.io -o get-n8n.sh and run it with sh get-n8n.sh.
What do you need before installing n8n?
You need Docker with the Docker Compose v2 plugin and a running Docker daemon. n8n's Docker Compose guide also asks for at least 4 GB of RAM and 2 vCPUs, and a dedicated machine or VM, because its default setup includes a code sandbox that runs in privileged mode.
On Windows, use WSL and keep the n8n folder inside the Linux filesystem rather than under /mnt/c. For production, n8n recommends a 64-bit Linux host and PostgreSQL rather than the built-in SQLite database.
Can you still install n8n with npm?
Only on n8n 2.x. From n8n 3.0, n8n no longer publishes a runnable npm package, so self-hosted installs must use Docker, according to the 3.0 breaking-changes page.
If you run n8n with npm or npx today, move to Docker before you upgrade to 3.0. Our n8n 3.0 upgrade guide covers the rest of the changes.
How do you run n8n with a single Docker command?
You can still start n8n with one docker run command, though n8n now marks that guide as outdated and recommends Docker Compose instead. The documented command creates a volume for your data and starts the official image on port 5678:
docker volume create n8n_data
docker run -it --rm --name n8n -p 5678:5678 \
-e GENERIC_TIMEZONE="Asia/Karachi" -e TZ="Asia/Karachi" \
-e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true \
-v n8n_data:/home/node/.n8n n8nio/n8nSet both timezone variables to your own timezone: TZ sets the system time and GENERIC_TIMEZONE is what schedule-based nodes use. We've used Asia/Karachi as the example.
Where does n8n store its data?
With the one-line setup, your settings and .env file live in the ./n8n folder and your data lives in a Docker volume called n8n-data, using SQLite by default. n8n recommends switching to PostgreSQL for teams or production use.
The data directory also holds your encryption key, so back up the volume, not just your exported workflows. Losing the key means losing access to saved credentials.
How do you update n8n?
If you used the one-line setup, re-run the script with the upgrade flag; n8n's guide says it keeps your data, secrets and settings:
curl -fsSL https://get.n8n.io | sh -s -- --upgradeTo install a specific version instead, use --version followed by the version number. Before a major upgrade such as 2.x to 3.0, back up first and run the Migration Report, because that upgrade can't be reversed.
Is it safe to expose n8n to the internet?
Not directly. n8n's production requirements say to put a reverse proxy or load balancer in front of n8n, point a hostname at it and terminate TLS there.
The one-line setup's code sandbox runs in privileged mode and is meant for development and testing, so run that setup on a dedicated machine and don't expose it to the internet. For a production server, plan the proxy, HTTPS, backups and updates before you connect real customer data.
Should you self-host n8n or use n8n Cloud?
Self-host if you're comfortable running a server and want the lowest software cost; choose n8n Cloud if you'd rather not manage installs, updates and backups. Our n8n pricing guide includes a calculator that compares the two for your workflow volume.
If you want n8n installed, secured and maintained for you, see our n8n and Make.com automation service. New to n8n? Start with what is n8n.