In this post, we will see what n8n is and how to install it locally with Docker.
But first of all, what is n8n?
“n8n (pronounced ‘n-eight-n’) is a free and open-source workflow automation tool designed for technical users who want to build complex automations without the limitations of traditional no-code platforms. Built with a node-based approach, n8n allows us to create sophisticated workflows by connecting different services, APIs, and data sources through an intuitive visual interface.
Unlike many automation platforms, n8n gives us complete control over your data and workflows.
We can self-host it, customize it to your needs, and integrate it with virtually any service that has an API or webhook support.”
In a nutshell, n8n is a node-based workflow automation platform that enables us to visually design workflows that connect different services, whether they’re SaaS applications, internal APIs, or databases.
What can we do with n8n?
n8n allows us to automate nearly any repetitive task like for example automatically capturing a new website lead, adding them to our CRM, and sending a welcome email without lifting a finger.
We can sync customer data between our payment processor and a spreadsheet, or build nightly reports that are waiting in our inbox each morning. From complex business processes to simple personal productivity hacks, n8n orchestrates the flow of data between our tools to save us time.
n8n with AI
Integrating AI transforms our automations from simple to intelligent.
n8n acts as the orchestrator, connecting powerful AI models like GPT-4 or Gemini directly into our workflows. This allows us to automatically draft personalized sales emails, analyze customer feedback for sentiment, or summarize lengthy documents.
We can even use AI as a decision-making brain to intelligently route support tickets to the correct department based on their content. By embedding AI, we turn n8n from a simple automation tool into a platform for building smart, autonomous processes.
Self-Hosting vs. n8n Cloud
While this post focuses on self-hosting, it’s not our only option.
For maximum convenience, n8n Cloud is the official managed service that handles all setup, updates, and scaling for us. It’s the fastest way to start automating if we prefer to avoid technical overhead.
On the other hand, the self-hosted path we will see, offers complete control over data, privacy, and customization. This makes it the ideal choice for developers or organizations with specific security and compliance needs.
Essentially, our decision is between the managed convenience of the Cloud versus the total control of self-hosting.
For all information about n8n cloud, see the official web site: https://n8n.io/
Now, let’s see how to run locally n8n.
First of all, we start preparing the Docker compose file
[DOCKER-COMPOSE.YML]
version: "3.8"
services:
n8n:
image: n8nio/n8n
ports:
- "5678:5678"
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=pass123
- N8N_HOST=n8n.local
- N8N_PORT=5678
- NODE_ENV=production
volumes:
- ./n8n_data:/home/node/.n8n
This configuration will:
- Expose the UI on port 5678.
- Enable basic authentication for security.
- Persist workflow data inside the
./n8n_datadirectory.
Then, we run the container with the command:
docker-compose up -d

Now, open a browser and go to:
http://localhost:5678

In this last step, we have to set up the owner account and request the license key:


Now, we can start using n8n locally:
