Easy Tech Tuts
n8n

How to Install n8n With Docker Easily 2026

By Impran M N

Docker is a popular way to self-host n8n because it isolates the app and its dependencies into a single container you can spin up or tear down cleanly. This guide covers preparing your environment, running the container with the correct port mapping, and setting up persistent storage so your workflow data survives restarts.

01Verify Docker is installed

Check that Docker and Docker Compose are installed and working on your machine before starting.

02Create a project directory

Set up a dedicated folder for your n8n project and configure persistent data volume mappings inside it.

03Prepare your container command

Review the official container build configuration, including the standard port mapping for port 5678.

04Add environment variables

Append any required environment variables and port mapping flags to your deployment command.

05Run the container

Execute the command to pull the official n8n image and spin up the background container instance.

06Access the setup wizard

Open your browser to the local instance address and complete the onboarding screen to create your owner account.

FAQ

Frequently asked questions

Why use Docker instead of npm for self-hosting?

Docker packages n8n and its dependencies together, making it easier to deploy consistently and tear down without affecting the rest of your system.

Will my workflow data survive a container restart?

Yes, as long as you've configured persistent storage volumes, your workflow database and credentials remain intact across restarts.

What port does n8n run on by default?

n8n's default port is 5678, which needs to be mapped correctly in your Docker run command to access the interface.

Can I run n8n with Docker Compose instead of a single run command?

Yes, Docker Compose is a common alternative that lets you define your container configuration, including volumes and environment variables, in a single file.

Watch the full walkthrough

The same steps, demonstrated on screen from start to finish.