n8n

How to Install n8n Locally Using Docker Desktop

Introduction 

Installing n8n locally using Docker Desktop is one of the easiest ways to get started with this powerful workflow automation tool. Whether you are on macOS or Windows, Docker Desktop offers an intuitive graphical interface that eliminates the need for command-line Docker commands. This article will guide you through the entire process.

Prerequisites

Before you begin, make sure you have:

  • A computer running Windows or macOS
  • Administrative (root) access for installing Docker Desktop
  • An active internet connection

n8n itself will run inside a Docker container managed by Docker Desktop.

Step 1 — Install Docker Desktop

The first step is to get Docker Desktop installed on your machine.

  1. Open your browser and visit docker.com.
  2. Choose Docker Desktop for your operating system.
  3. Select the appropriate binary:
  • Apple Silicon for newer Macs with M-series chips
  • Intel builds for older Intel Macs
  • Windows builds that support WSL2 on Windows 10/11

4. Download and install Docker Desktop.

  • On macOS: mount the disk image and drag the Docker app to Applications.
  • On Windows: run the installer; it will handle WSL2 installation if needed.

After installing Docker Desktop, launch the application. You need to provide administrative privileges, as Docker requires system-level access.

Step 2 — Create a Persistent Volume

Docker volume is where n8n will store all of its data (workflows, credentials, settings, etc.). Using a volume ensures that your data persists even if the container is recreated or Docker Desktop restarts.

  1. In Docker Desktop, click Volumes in the sidebar.
  2. Click Create Volume.
  3. Give your volume a meaningful name, such as n8n-data.

This volume will be used later when we start the n8n container.

Step 3 — Pull the n8n Docker Image

Next, you need the official n8n image from Docker Hub.

  1. In Docker Desktop, go to the Images tab.
  2. Search for n8n.
  3. Click Pull to download the image locally.

This step ensures the container image is ready before configuration.

Step 4 — Configure and Run the n8n Container

Once the image is downloaded, you can configure and start the container.

Create the Container

  1. Still in the Images tab, locate the n8n image.
  2. Click Run or Create Container.
  3. Fill in the container configuration details.

Basic Settings

  • Container Namen8n
  • Host Port5678
     This is the port you will use to access n8n in your browser:
     http://localhost:5678
  • Volume Mapping:
  • Host Path / Volume: select your n8n-data volume
  • Container Path/home/node/.n8n

This mapping ensures that n8n’s internal data directory points to the persistent Docker volume you created.

Environment Variables

Set the following environment variables to ensure proper operation:

These variables configure timezone information, allowing n8n to run with the correct file permissions and settings.

Once these are set, click Run.

Docker Desktop will launch the container. In a few seconds, n8n will be running.

Step 5 — Access n8n

Open your browser and navigate to:

http://localhost:5678

You should see the n8n interface, where you can start creating workflows, integrations, and automations.

Notes and Limitations

  • Webhooks and External URLs
     Local n8n instances cannot receive external webhooks without tunneling (e.g., via ngrok). If you need to expose webhooks publicly, a separate tutorial is recommended.
  • Data Persistence
     Because you used a Docker volume, your workflows and settings will remain intact even if you stop or restart the container.

Using Docker CLI

From your terminal, run the following commands, replacing the <YOUR_TIMEZONE> placeholders with your timezone:

docker volume create n8n_data
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-e GENERIC_TIMEZONE="<YOUR_TIMEZONE>" \
-e TZ="<YOUR_TIMEZONE>" \
-e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true \
-e N8N_RUNNERS_ENABLED=true \
-v n8n_data:/home/node/.n8n \
docker.n8n.io/n8nio/n8n

Conclusion

Installing n8n locally using Docker Desktop is easy for users on both macOS and Windows. The Docker Desktop GUI simplifies the setup process, and utilizing a persistent volume ensures that your data stays safe between restarts.

Once n8n is running, it offers an interactive workspace for creating automations without the need for coding. This makes it an ideal tool for developers, IT teams, and automation enthusiasts alike.

Leave a Reply

Your email address will not be published. Required fields are marked *