32blogby StudioMitsu
Archive8 min read

Install n8n Locally with Docker Desktop: Complete Setup Guide

Step-by-step guide to running n8n on your local PC using Docker Desktop. Covers data persistence, auto-restart, basic workflow creation, and updates — for Windows and Mac.

If you've been curious about workflow automation but found tools like Zapier or Make too expensive or too limited, n8n is worth a serious look.

n8n is an open-source workflow automation tool: you connect services visually by wiring "trigger" nodes to "action" nodes. When something happens in one app, n8n automatically does something in another. No coding required for most use cases.

The best part? You can self-host it. Run it on your own machine or server, pay nothing for the software, and have no limits on how many automations you run.

This guide walks through installing n8n on your local PC using Docker Desktop — step by step, with commands you can copy and paste directly.

What can you do with n8n?

Before diving into setup, here's a quick sense of what n8n can automate:

  • When a new email arrives in Gmail with a specific label, add a row to Google Sheets
  • When a form is submitted, send a Slack notification and create a Notion page
  • Every morning at 9am, fetch today's weather and send it via LINE or Telegram
  • When a GitHub PR is merged, mark the corresponding task as done in your project manager
  • Connect to any REST API, even custom internal ones

n8n has 400+ pre-built integrations. Each one is a node you drag onto a canvas and configure with a form — no code needed for standard use cases.

Why self-host instead of using Make or Zapier?

Cloud tools charge per execution. If you run 10,000 automations per month, you're paying for that. With a self-hosted n8n instance on your local machine (or a cheap VPS), the software cost is zero and you own your data.

Prerequisites

Windows: verify virtualization is enabled

Docker requires CPU virtualization. Check if it's on:

  1. Press Ctrl + Shift + Esc to open Task Manager
  2. Click the Performance tab
  3. Select CPU
  4. Look for Virtualization: Enabled in the bottom right

If it says Disabled, you'll need to enable it in BIOS/UEFI. Reboot and press Delete or F2 (varies by manufacturer) during startup. Look for settings named "Virtualization Technology", "VT-x", or "SVM" and enable them.

Mac

Docker Desktop works on both Intel and Apple Silicon (M1/M2/M3) Macs. No extra configuration needed.

What you'll need

  • Administrator/sudo access on your machine
  • A stable internet connection (Docker will download a few hundred MB)

Step 1: Install Docker Desktop

n8n is distributed as a Docker image. Docker Desktop is the software that runs Docker containers on your machine.

Download Docker Desktop from docker.com/products/docker-desktop — choose the right version for your OS.

Installing on Windows

  1. Run the downloaded .exe installer
  2. When prompted, keep "Use WSL 2 instead of Hyper-V" checked (WSL 2 is preferred)
  3. Follow the on-screen prompts and click OK
  4. Restart your PC when asked

Installing on Mac

  1. Open the downloaded .dmg file
  2. Drag Docker to the Applications folder
  3. Launch Docker from Applications
  4. Approve the permissions prompt with your password

Verify the installation

After Docker Desktop launches, the status bar at the bottom left should show "Engine running" with a green indicator.

Confirm in the terminal:

bash
docker --version

You should see something like Docker version 27.x.x, build ...

Step 2: Create a data directory

By default, Docker containers lose their data when they're removed. To keep your n8n workflows, credentials, and settings safe, we'll map a local folder on your machine to n8n's data directory inside the container.

On Windows (PowerShell):

powershell
mkdir C:\n8n_data

On Mac / Linux:

bash
mkdir -p ~/.n8n

You only need to do this once. All n8n data will be saved here, surviving container restarts and updates.

Step 3: Start n8n

Open a terminal and run the command for your OS.

Windows (PowerShell):

powershell
docker run -d `
  --name n8n `
  -p 5678:5678 `
  --restart unless-stopped `
  -v C:\n8n_data:/home/node/.n8n `
  -e GENERIC_TIMEZONE="Asia/Tokyo" `
  -e TZ="Asia/Tokyo" `
  n8nio/n8n

Mac / Linux:

bash
docker run -d \
  --name n8n \
  -p 5678:5678 \
  --restart unless-stopped \
  -v ~/.n8n:/home/node/.n8n \
  -e GENERIC_TIMEZONE="Asia/Tokyo" \
  -e TZ="Asia/Tokyo" \
  n8nio/n8n

Change the timezone values if you're not in Tokyo (Asia/Tokyo → your timezone, e.g. America/New_York, Europe/London).

What each flag does:

FlagPurpose
-dRun in detached (background) mode
--name n8nName the container "n8n" for easy reference
-p 5678:5678Map port 5678 on your machine to n8n's port
--restart unless-stoppedAuto-start n8n when your PC reboots
-v ~/.n8n:/home/node/.n8nMount your local data folder into the container
-e GENERIC_TIMEZONESet n8n's internal timezone

The first run will download the n8n Docker image — this takes a few minutes depending on your connection speed. When the command completes and shows a long hex string (the container ID), n8n is running.

Verify it's up:

bash
docker ps

You should see a row with the name "n8n" and status "Up".

Step 4: First launch and account setup

Open your browser and go to:

http://localhost:5678

You'll see n8n's initial setup screen. Fill in:

  • Your email address
  • A password

This creates a local account for your n8n instance. Click Get started and you'll land on the n8n dashboard.

Building your first workflow

Once you're in, here's how to create a simple test workflow to get familiar with n8n:

  1. Click + New workflow on the dashboard
  2. Click the + button on the canvas to add a node
  3. Search for and select Schedule Trigger (runs on a time interval)
  4. Configure the interval — for testing, set it to every minute
  5. Click the + after the Schedule trigger to add another node
  6. Search for Code and select it
  7. In the Code node, write:
javascript
return [{ json: { message: "n8n is working!", time: new Date().toISOString() } }];
  1. Click Execute node to test it — you should see the output immediately
  2. Click Save to save the workflow
  3. Toggle Active to on — n8n will now run this on your schedule

Congratulations — your first n8n workflow is running.

Essential container management commands

bash
# Stop n8n
docker stop n8n

# Start n8n (after manually stopping it)
docker start n8n

# Restart n8n
docker restart n8n

# View logs
docker logs n8n

# Follow logs in real time
docker logs -f n8n

# Check n8n version
docker exec n8n n8n --version

Updating n8n

When a new version of n8n is released, update like this:

bash
# Pull the latest image
docker pull n8nio/n8n

# Stop and remove the old container (your data is safe — it's in your local folder)
docker stop n8n
docker rm n8n

# Start a new container with the latest image (same command as Step 3)
docker run -d \
  --name n8n \
  -p 5678:5678 \
  --restart unless-stopped \
  -v ~/.n8n:/home/node/.n8n \
  -e GENERIC_TIMEZONE="Asia/Tokyo" \
  -e TZ="Asia/Tokyo" \
  n8nio/n8n

Your workflows and credentials are stored in ~/.n8n (or C:\n8n_data on Windows), not in the container. Removing and re-creating the container doesn't touch your data.

Limitations of running locally

Running n8n on your laptop or desktop has one significant constraint: when your machine is off or asleep, n8n stops running.

This is fine for development and testing. But if you want automations to run while you're away from your desk — overnight tasks, scheduled reports, webhooks from external services — you'll need a server that's always on.

The practical next step is a VPS (Virtual Private Server). For around $5–10/month, you get a server that runs 24/7 in a data center. You'd run the exact same Docker commands on that server, and your n8n instance would be accessible from anywhere.

Popular options: DigitalOcean, Linode (Akamai), Vultr, or domestic providers like ConoHa VPS and Sakura VPS. A 1-core / 1GB RAM instance is enough to run n8n with typical automation loads.

A full guide on deploying n8n to a VPS is on the roadmap.

Wrapping up

Installing n8n locally with Docker comes down to four steps:

  1. Install Docker Desktop and verify it's running
  2. Create a local data folder (~/.n8n or C:\n8n_data)
  3. Run the docker run command to start n8n
  4. Open http://localhost:5678 and complete initial setup

From there, the n8n canvas is waiting. Start with something small — automating a manual copy-paste task you do every week — and you'll quickly start seeing where else the time savings add up.

Once you've validated your automations locally and want them running 24/7, moving to a VPS is the natural next step.