Course page
Log in

You are watching a free preview. Enroll to open all 27 lessons, track progress and ask the course tutor.

Enroll for $59.99

Section 1: n8n fundamentals

Running n8n locally with Docker

Article 10 min Lesson 2 of 27 Preview

The quickest way to try n8n is a single Docker container on your own machine. This gives you a full n8n instance for learning and building, with your data kept in a Docker volume.

Start n8n

Open a terminal and run:

docker volume create n8n_data

docker run -it --rm \
  --name n8n \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n

What each part does:

  • docker volume create n8n_data creates persistent storage so your workflows survive container restarts.
  • -p 5678:5678 exposes n8n's web interface on port 5678.
  • -v n8n_data:/home/node/.n8n mounts the volume where n8n stores its database, settings and encryption key.
  • --rm removes the container when it stops; your data is safe in the volume.

Open http://localhost:5678 in your browser. n8n asks you to create an owner account. This account is local to your instance.

Where data lives

By default, n8n stores workflows, credentials and execution history in a SQLite database inside the .n8n folder. That is fine for learning. For production we will switch to Postgres in section 3.

The same folder holds an encryption key used to encrypt stored credentials. If you lose this key, saved credentials cannot be decrypted. In production you set it explicitly with an environment variable and back it up.

Setting the time zone

Schedules depend on the time zone. Add environment variables to the run command:

-e GENERIC_TIMEZONE="Europe/Berlin" -e TZ="Europe/Berlin"

Use your own zone. Without this, a schedule set for 9am may run at 9am UTC.

Exploring the editor

Create a new workflow. You will see:

  • The canvas, where nodes are placed and connected.
  • The nodes panel, opened with the plus button or the Tab key, listing triggers, app nodes and core nodes.
  • The execution log, showing every run with its data.

Add a Manual Trigger node, then a Set node (called Edit Fields in recent versions) that adds a field greeting with the value Hello from n8n. Click Execute workflow and inspect the output of each node in the table, JSON and schema views.

Stopping and updating

Press Ctrl and C in the terminal to stop n8n. To update, pull the latest image with docker pull docker.n8n.io/n8nio/n8n and start the container again. Always read the release notes before updating a production instance, which we cover later.

← → switch lessons