DEV Community

Cover image for How to Install n8n Docker Locally Free
Pritesh Bhoi
Pritesh Bhoi

Posted on • Originally published at priteshbhoi.com

How to Install n8n Docker Locally Free

Running n8n locally via Docker is the best way to get started with workflow automation for free. It is fast, keeps your data isolated, and allows for unlimited workflow executions on your own machine.

Prerequisites

Before you begin, ensure your system is ready:

  • Virtualization: Ensure virtualization is enabled in your computer's BIOS/UEFI.
  • Docker Desktop: Installed and running.
  • WSL2 (Windows Users): Enabled for better performance.

Step 1: Create Persistent Storage

To prevent losing your workflows and settings when the container stops or restarts, we need to create a Docker volume.

Want to build more? For more related automation guides and tutorials, visit priteshbhoi.com/blog.

Open your terminal (PowerShell or Command Prompt) and run:
docker volume create n8n_data

Step 2: Launch n8n with Docker

Instead of pulling the image separately, you can launch the container directly. This command handles the image download, port mapping, and volume mounting in one go.

Run the following command in your terminal:
docker run -d \
--name n8n \
--restart always \
-p 5678:5678 \
-v n8n_data:/home/node/.n8n \
-e GENERIC_TIMEZONE="Europe/London" \
docker.n8n.io/n8nio/n8n

Understanding the Command:

-d: Runs the container in the background.

--name n8n: Names the container for easy management.

--restart always: Ensures n8n starts automatically if your computer restarts.

-p 5678:5678: Maps your local port 5678 to the container's port 5678.

-v n8n_data:/home/node/.n8n: Links the persistent volume to the container's storage folder.

-e GENERIC_TIMEZONE="...": Sets the internal timezone for your workflows.

Step 3: Accessing n8n

Give the container a moment to initialize the database, then:

  • Open your browser.
  • Navigate to: http://localhost:5678
  • Follow the on-screen instructions to create your admin account and start automating!

Frequently Asked Questions

Is n8n free to self-host?
Yes, the n8n Community Edition is open-source and free to self-host locally.

What happens if I forget the volume?
If you run the container without a volume, your workflows, credentials, and settings will be deleted every time the container is removed or updated. Always use the -v flag.

Can I use this for production?
While perfect for testing and personal automation, for production environments, you would typically look into adding a reverse proxy (like Nginx) and SSL certificates for secure, public-facing access.

Top comments (0)