Overview
This lesson is part of the n8n AI Automation - Zero to Hero course, Section: 2. Getting Started.
Watch the video above for the full tutorial, or read the written guide below.
What is Docker-based n8n installation and why does it exist?
Docker-based n8n installation runs n8n inside an isolated container on your local machine, separating it from the host operating system to prevent compatibility conflicts. The Docker method gives you direct control over the database backend (SQLite by default, Postgres if you prefer), makes migrating to a new host straightforward, and produces a cleaner security boundary than a bare NPM install. It works on Mac and Windows via Docker Desktop; Linux users need Docker Engine and Docker Compose instead.
How to install n8n on a local Mac or Windows machine using Docker Desktop
Docker Desktop is the required prerequisite. Download it from the official Docker documentation page, choosing the Apple Silicon or Intel build if you are on a Mac. Docker Desktop is free for personal use and for companies with fewer than 250 employees and less than $10 million USD in annual revenue; larger enterprises need a paid subscription. Drag the downloaded file into your Applications folder, open it, and click "Use recommended settings" to finish setup.
With Docker Desktop running, open a terminal and run the first command from the n8n Docker documentation to create a volume named n8n_data. You can confirm it exists by opening Docker Desktop and checking the Volumes section. Then paste the second command from the docs to pull the latest stable n8n image and start the container. n8n prints a URL, localhost:5678, when the container is ready.
Open localhost:5678 in a browser. Even if you already installed n8n via NPM on the same machine, this container treats itself as a fresh installation because it is fully isolated. Fill in the owner account form, complete the onboarding survey, and optionally enter an email address to receive a free license key that unlocks workflow history, advanced debugging, execution search, and folder tagging. From Docker Desktop's Containers view you can monitor CPU and memory usage and stop or restart the container with one click at any time.
Key Takeaways
- Docker Desktop n8n installation runs on Mac and Windows only; Linux requires Docker Engine plus Docker Compose and a separate docker-compose setup covered in a dedicated guide.
- The
n8n_datavolume created by the first terminal command persists your workflows and credentials outside the container, so your data survives restarts and updates. - A Docker container is isolated from the host OS, so a Docker install and an NPM install can coexist on the same machine and each behaves as a completely independent instance.
- Docker gives you the option to run Postgres instead of the default SQLite database, a level of database control the standard NPM install does not offer.
- Self-hosting via Docker means you own security, scaling, and server configuration; the n8n cloud version handles all of that for you, making it the better choice if that responsibility feels too technical.
Related Lessons
- Lesson 4: How to Set Up n8n Cloud in 2025 - Step by Step | n8n Cloud vs Self-Hosting
- Lesson 5: [Free n8n] How to Install n8n on local machine using NPM Node.js
- Lesson 7: n8n Interface Walkthrough 2025 | Complete n8n UI Guide - Admin Panel, Settings
- Lesson 8: n8n Node Types Explained (2025) | How to Build Workflow with Triggers, Apps, Core & Actions
- Lesson 9: Build Your First n8n Workflow - Send Welcome Emails Automatically
Next Steps
Continue your n8n journey with the full n8n AI Automation - Zero to Hero course.