Install n8n locally on Windows, Mac or Linux: npx, npm or Docker Desktop
By Clément Lacaille (Tech-Bharat) · Published 14 October 2026 · updated 23 November 2026 · 7 min read · how we build and test
First Workflows: 9 Step-by-Step Workshops — €19
PDF guide in English on this topic · 21 pages · October 2026 edition · 14-day guarantee
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. There is no separate n8n installer to download: the official installation methods for a self-hosted n8n are npm and Docker. Both 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 November 23, 2026), says where your data is stored, and what changes the day a workflow has to run without your computer.

Install n8n locally in 4 steps
- Check Node.js with
node -v: you need a version between 20.19 and 24.x. If not, use Docker Desktop, whose image ships its own Node.js. - Start n8n:
npx n8n(nothing to install) or, with Docker,docker runwith a named volume (full command below). - Open
http://localhost:5678in your browser. - Create the instance's owner account, then add your first credentials (API keys, OAuth accounts) from the Credentials menu.
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.
With npx, npx n8n@latest forces a download of the latest published version instead of the cached one.
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.
With -p 5678:5678, Docker publishes the port on every address of your machine: another device on your network can then reach the editor. To keep it to your computer, write -p 127.0.0.1:5678:5678 (docker ps then shows 127.0.0.1:5678->5678/tcp), as described in Docker's documentation on publishing ports.
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.
Is n8n free when installed locally?
Yes. What you install with npx, npm or Docker is the self-hosted Community Edition: no subscription, no execution quota imposed by n8n, only the machine that runs it. It is published under the Sustainable Use License, which allows use for your own internal or personal purposes; it does, however, forbid offering n8n to clients who would connect their own accounts, which requires a commercial agreement with n8n.
The editions comparison page lists three tiers: the Community Edition, the same edition registered for free with an email address (which unlocks folders and debugging in the editor), and the paid Business and Enterprise plans. Features and limits of the free version are detailed in our guide n8n for free: what the Community Edition really includes.

Local, server or n8n Cloud: where to install n8n
| Option | Installation | Reachable from the internet | Who it's for |
|---|---|---|---|
| Local (this page) | npx, npm or Docker Desktop | no, except through a test tunnel | learning, building, testing |
| Server (VPS) | Docker Compose, maintained by you | yes, with a domain over HTTPS | workflows running around the clock, public webhooks |
| n8n Cloud | none, hosted by n8n | yes | nothing to administer; prices on n8n.io/pricing |
Local remains the right starting point: what you build there exports as is to a server (see below). To pick the machine, our guide to choosing a VPS for n8n compares the real needs.
Common n8n installation errors
- Node.js version out of range.
npx n8nfails or crashes on startup: checknode -vand get back within the 20.19 to 24.x range of n8n's npm documentation. On Windows, the documentation points to Microsoft's Node.js install guide. - Port 5678 already in use. Another instance (or an old container) holds the port. With npm, start n8n on another port with the
N8N_PORTvariable (for exampleN8N_PORT=5679 n8n starton Mac or Linux); with Docker, change only the left-hand port:-p 5679:5678. - Docker without a volume. Without
-v n8n_data:/home/node/.n8n, your workflows live inside the container and disappear with it, all the faster with--rm. - Docker Desktop stopped, or WSL 2 missing on Windows. The
dockercommand says it cannot find the engine: start Docker Desktop. On Windows, its default backend is WSL 2 (Docker Desktop install guide): if it is missing, Docker Desktop does not start. - Permissions on a mounted folder. If you mount a folder from your machine instead of the named volume, it must be writable by the container's
nodeuser; the named volume from the official command avoids the problem. - Secure cookie error. When you open n8n over HTTP from an address other than
localhost(the machine's network IP, for instance), the editor refuses the login:N8N_SECURE_COOKIEdefaults totrueand restricts the session cookie to HTTPS (security variables). Locally, openhttp://localhost:5678; only set the variable tofalseon a test machine, never on an exposed server, which must run over HTTPS.
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. Backups are up to you too: copy the data folder regularly, encryption key included. 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.
Updating n8n installed locally
Export your workflows to JSON first (the n8n export:workflow command above): an update can migrate the database, and rolling back then means reverting that migration, as the documentation points out. Then:
# npm
npm update -g n8n
# npx
npx n8n@latest
# Docker: pull the new image, then recreate the container with the same volume
docker pull n8nio/n8n
With Docker, stop the container and run the same docker run command again: the n8n_data volume is attached to the new container, and your workflows and credentials are kept.
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
Is there an n8n installer to download?
No separate installer: the official self-hosted installation methods are npm (npx n8n or npm install n8n -g) and the Docker image n8nio/n8n. On Windows or Mac, install Node.js 20.19 to 24.x and run npx n8n, or install Docker Desktop and run the official image with a named volume; the editor then opens at http://localhost:5678.
Is n8n free if I install it myself?
Yes. The Community Edition you install with npx, npm or Docker is free, with no subscription and no execution quota: the only limit is your machine. It is published under the Sustainable Use License, which allows use for your own internal or personal purposes, but not reselling n8n as a service to clients who would connect their own accounts. A few features (folders, debugging in the editor) need a free registration by email; others are reserved for paid plans.
Which Node.js version do I need to install n8n?
The official documentation asks for a Node.js version between 20.19 and 24.x inclusive. Check yours with node -v before running npx n8n: an older or newer version is the first cause of a failed install. With Docker the question does not arise: the official image ships its own Node.js.
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.
How do I update n8n installed locally?
Export your workflows first. With npm: npm update -g n8n. With npx: npx n8n@latest. With Docker: docker pull n8nio/n8n, then stop the container and start it again with the same volume (n8n_data); your workflows and credentials are kept because they live in the volume, not in the container.