Skip to main content

Installer n8n en selfhosted dans son homelab

·456 words·3 mins

Installing n8n with Docker: my setup in 10 minutes
#

I automate a lot of tasks daily. Notifications, app syncs, backups. For a long time, I relied on Zapier and Make. They work fine, but the bill adds up fast once you exceed the free tiers. So I started looking for a self-hosted alternative. That’s how I found n8n.

n8n is an open source automation tool. Think of it as Zapier, but you host it yourself. The interface is visual, integrations are plentiful, and most importantly, you keep control over your data. The only thing left is installation. Docker makes it ridiculously easy.

Why Docker
#

I could have installed n8n directly on my machine using npm. But I prefer Docker for this kind of tool. The environment stays isolated, updates are clean, and I can remove everything without leaving traces. Plus, if I want to migrate to a VPS later, I just copy my config file.

If you don’t have Docker installed yet, now’s the time. On most Linux distributions, a simple apt install docker.io does the job. On Mac or Windows, Docker Desktop handles it.

Quick start with a single command
#

To try n8n without any hassle, one line is enough. Open your terminal and run this:

bash docker run -it –rm –name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n n8nio/n8n

This command downloads the official image, creates a volume to persist your workflows, and exposes the interface on port 5678. Open your browser at http://localhost:5678, and you’re good to go. The interface shows up, you create your admin account, you start building your first workflows.

I appreciate this simplicity. No dependencies to manage, no Node.js to configure. It just works.

Moving to Docker Compose for serious use
#

The previous command is great for discovery. But if you want a persistent setup that’s easy to maintain, Docker Compose fits better. Here’s the file I use:

yaml services: n8n: image: n8nio/n8n restart: unless-stopped ports: - “5678:5678” volumes: - n8n_data:/home/node/.n8n environment: - N8N_SECURE_COOKIE=false

volumes: n8n_data:

Save this in a docker-compose.yml file, then run docker compose up -d. The container runs in the background, restarts automatically if your server reboots. For updates, a simple docker compose pull && docker compose up -d does the trick.

My first impressions
#

After a few weeks of use, I’m sold. The n8n interface is more technical than Zapier’s, but also more powerful. You can write JavaScript directly in your workflows, manipulate data however you want. The official documentation is thorough and well organized.

The main limitation is you. If you want to expose n8n to the internet, you’ll need to set up a reverse proxy and HTTPS. Nginx or Traefik handle that nicely. But that’s a topic for another article.