Install n8n locally: Windows, Mac or Linux, with npx, npm or Docker Desktop
By Clément Lacaille (Tech-Bharat) · Published 14 October 2026 · 4 min read · how we build and test
FlowKit Self-Hosting Kit — €79
Tested Docker Compose, encrypted backups, updates, monitoring, EN/FR guide
To install n8n locally, the shortest route is npx n8n with Node.js 20.19 to 24.x, then open http://localhost:5678; for an install that lasts, run the official image in Docker Desktop (Windows, Mac or Linux) with a named volume to keep your workflows. Both methods give you the same editor and the same free Community Edition, with no execution quota. This guide gives the exact commands from the official documentation (checked on October 14, 2026), says where your data is stored, and what changes the day a workflow has to run without your computer.
Which local method to pick
| Method | Prerequisite | Who it's for | Weak spot |
|---|---|---|---|
npx n8n |
Node.js 20.19 to 24.x | trying n8n in two minutes | depends on the installed Node.js version |
npm install n8n -g |
Node.js 20.19 to 24.x | regular use without Docker | updates and Node.js version to keep an eye on |
| Docker Desktop | Docker Desktop (Mac, Windows, Linux) | a lasting install, close to a server | one more piece of software to install |
On Windows, the documentation points to Microsoft's Node.js install guide if you run into trouble: most npx n8n failures come from a Node.js version outside the supported range. Check it first with node -v.
Method 1: npx or npm (Windows, Mac, Linux)
# Check the Node.js version (expected: 20.19 to 24.x)
node -v
# Try it without installing anything
npx n8n
# Or install n8n for good, then start it
npm install n8n -g
n8n start
The editor answers at http://localhost:5678. On first start, n8n asks you to create the instance's owner account. To update an npm install: npm update -g n8n.
Method 2: Docker Desktop
Install Docker Desktop, then, in a terminal (PowerShell on Windows, replacing the trailing \ with backticks `):
docker volume create n8n_data
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-e GENERIC_TIMEZONE="America/New_York" \
-e TZ="America/New_York" \
-e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true \
-v n8n_data:/home/node/.n8n \
n8nio/n8n
This is the command from n8n's Docker documentation, with a time zone filled in (use your own). GENERIC_TIMEZONE sets the time used by scheduled nodes such as the Schedule Trigger; without it, an "every day at 8 am" workflow can fire at the wrong hour (details in our guide to the Schedule Trigger and time zones). The --rm flag removes the container when it stops, but not the n8n_data volume: your workflows survive from one run to the next.
If a workflow running in Docker needs to reach a service on your machine (a local database, Ollama), localhost means the container, not your computer: that is the ECONNREFUSED error covered in our n8n Docker and localhost guide.
Where your data lives (and why it matters)
By default, n8n stores workflows, credentials and execution history in a SQLite database inside its data folder: ~/.n8n with npm, the n8n_data volume (mounted on /home/node/.n8n) with Docker. That folder also holds the credentials encryption key. Two consequences:
- deleting the volume or folder wipes everything, workflows included;
- copying the database without the key is not enough: saved credentials (API keys, OAuth accounts) can no longer be decrypted elsewhere.
What a local n8n does not do
An instance on your own machine is enough to learn, build and test. It stops, however, as soon as the computer sleeps, and it cannot be reached from the internet: a Schedule Trigger does not fire while the machine is off, and Stripe, a CRM or a form cannot call http://localhost:5678. To test webhooks, a tunnel is enough (see testing n8n webhooks locally); n8n's documentation states it is for development only and not safe in production.
From local to server
When a workflow has to run around the clock, it moves to a server. The n8n CLI commands export everything from the local instance:
n8n export:workflow --all --output=workflows.json
n8n export:credentials --all --decrypted --output=credentials.json
# With Docker: prefix with docker exec -u node -it n8n
Then, on the server, n8n import:workflow --input=workflows.json and n8n import:credentials --input=credentials.json. The decrypted credentials file holds your secrets in plain text: move it over a secure channel and delete it afterwards. The same approach works for migrating from n8n Cloud.
On the server, the database moves from SQLite to PostgreSQL, and you need HTTPS, tested backups and updates: that is what our guide to installing n8n with Docker Compose and PostgreSQL covers. If you would rather start from a proven stack, the FlowKit Self-Hosting Kit (€79, one-time payment) ships Docker Compose with PostgreSQL 18, automatic HTTPS through Caddy, queue mode, and scripts for encrypted backup, restore, and updates with rollback, tested end to end on October 12, 2026.
A first workflow to import
To check that your local n8n works on a real case, AI email sorting over IMAP only needs standard nodes and a model API key: import the JSON, connect a test mailbox, run a manual execution.
FAQ
Frequently asked questions
What is the fastest way to install n8n locally?
With Node.js installed (a version between 20.19 and 24.x according to the official documentation), the npx n8n command downloads and starts n8n without a global install; the editor then opens at http://localhost:5678. For a lasting install, prefer Docker Desktop with a named volume, which avoids Node.js version conflicts.
Do I need Docker to run n8n on Windows or Mac?
No. n8n also installs with npm on Windows, macOS and Linux, as long as you have a supported Node.js version. Docker Desktop remains the most stable choice over time, because the official image ships the right Node.js version and its dependencies.
Where does n8n store my workflows when it runs locally?
By default in a SQLite database and a configuration folder: ~/.n8n with npm, the volume mounted on /home/node/.n8n with Docker. That folder also holds the credentials encryption key: without it, saved credentials can no longer be decrypted on another machine.
Can a local n8n receive webhooks?
Not directly: http://localhost:5678 cannot be reached from the internet. For testing, you go through a tunnel (cloudflared, ngrok), which the n8n documentation reserves for development. For production webhooks, you need an instance on a server with a domain name over HTTPS.