For the complete documentation index, see llms.txt. This page is also available as Markdown.

One-line setup

Who this is for

This guide sets up a brand-new n8n instance with a single command that replaces the old npm install n8n / npx n8n approach, which no longer works from n8n 3.0 (launching October 2026). It's the fastest way to get n8n running, whether you've used Docker before or not.

It's meant for fresh installs, not for changing an existing setup:

  • Already self-hosting with your own Docker Compose file? You don't need to switch to this script, but feel free to take inspiration from the Docker Compose setup process.

  • Currently installing n8n with npm? From n8n 3.0, n8n is only distributed through Docker. Your existing npm install keeps working for now, but new installs (and future upgrades) should use this method instead. A step-by-step migration guide is coming soon.

What you need before you start

This method uses Docker, a tool that runs n8n in a self-contained package so you don't have to install or configure anything else yourself. If you don't already have it:

  • Install Docker. This includes Docker Compose, which the setup command also needs.

You don't need to know Docker to use this guide; just have it installed and running in the background.

The one-line setup command requires the docker compose v2 plugin specifically (not the older standalone docker-compose binary), and checks that the Docker daemon is running. If you're using Podman, Colima, or other Docker-compatible engines, install the docker CLI with the compose plugin and point DOCKER_HOST at their socket.

Watch a video guide covering this setup, from installing Docker to turning on n8n Assistant:

Run the command

Open a terminal and run:

This does everything for you:

  1. Checks that Docker is installed and running, and tells you how to fix it if not.

  2. Creates a new folder called n8n in your current directory to hold everything.

  3. Writes the configuration files n8n needs to run.

  4. Downloads n8n and starts it up.

It's safe to run more than once. If n8n is already set up in that folder, the command just tells you it's already there instead of changing anything.

A successful run looks like this:

What's included by default

Running the command sets up everything below automatically. There's nothing extra to install:

Component
What it's for

n8n

The workflow editor itself, running at http://localhost:5678.

A built-in database

Stores your workflows, credentials, and execution history. This is SQLite, a lightweight database that lives in a file. You don't need to install or manage a separate database server.

n8n Assistant support services

A sandbox that safely runs the code n8n Assistant writes, and a bundled search tool so it can look things up on the web. These start automatically alongside n8n, but the assistant itself stays switched off until you add an AI provider key. See Turn on n8n Assistant

If you're setting n8n up for a team or a production environment, consider a more robust database like Postgres rather than the built-in default. See Install using Docker Compose for that setup.

The same goes for the sandbox: this setup uses n8n's own bundled sandbox, which is a good fit for trying things out, but for production, n8n currently recommends Daytona instead. See Set up n8n Assistant for how to configure it.

Optional: Turn on n8n Assistant

n8n works fully without n8n Assistant, which is an optional extra. Once n8n is running, the easiest way to turn it on is from the UI in the instance's AI settings. Add your model API key there. Prefer to configure it before you ever log in? Edit .env instead:

  1. Open the .env file the command created (in ./n8n/.env by default).

  2. Add your AI provider key to the N8N_INSTANCE_AI_MODEL_API_KEY line.

  3. Restart n8n: docker compose -f ./n8n/compose.yml up -d

Full setup steps, including the supported providers, are in Set up n8n Assistant.

By default, n8n Assistant's web search runs through a bundled search tool with no setup needed. If you'd rather use Brave Search, add your Brave API key to INSTANCE_AI_BRAVE_SEARCH_API_KEY in the same .env file. It's used automatically once it's set.

You don't need to open any extra ports or configure anything for these services. Only n8n itself (port 5678) is ever reachable from outside your machine. Everything else stays private by default.

Everyday commands

To do this
Run this

Stop n8n

docker compose -f ./n8n/compose.yml down

Start it again

docker compose -f ./n8n/compose.yml up -d

Upgrade to the latest version

curl -fsSL https://get.n8n.io | sh -s -- --upgrade

Remove n8n and delete its data

docker compose -f ./n8n/compose.yml down -v then rm -rf ./n8n

Flags (for more control)

Adding these to the end of the install command changes what it does:

Flag
What it does

--version

On its own, shows the script's version and the latest n8n version it would install. Followed by a version number (for example, --version 2.31.4), installs or upgrades to that specific version.

--no-start

Sets up the configuration files without starting n8n yet.

--upgrade

Upgrades an existing install to a newer n8n version. Only updates the version number. Your data, settings, and any customizations stay untouched.

--help

Shows all available options.

Prefer not to run a script from the internet?

You can download and read it first, then run it yourself:

Windows users

The one-line setup command needs a terminal that understands shell scripts, which the standard Windows Command Prompt or PowerShell don't. Run it instead from:

  • WSL (Windows Subsystem for Linux), with Docker Desktop's WSL2 integration turned on.

  • Git Bash (installed alongside Git for Windows) with Docker Desktop running can also run POSIX shell scripts, but n8n hasn't verified it end-to-end for the one-line setup command. Stick with WSL unless you've confirmed Git Bash works for your setup.

Last updated

Was this helpful?