← Back to Blog

How to install n8n on Docker (manual and 1-click)

· MyPanel

n8n is an open-source workflow automation platform — a self-hosted alternative to Zapier/Make. The most common and stable way to run it is with Docker. This guide shows how to install n8n on Docker from scratch (both docker run and docker compose), then how to do the same thing in a single click with MyPanel.

Why run n8n with Docker?

Prerequisites

Option 1 — Quick start with docker run

Create a data volume and start the n8n container:

Terminal window
docker volume create n8n_data
docker run -d --name n8n \
-p 5678:5678 \
-v n8n_data:/home/node/.n8n \
docker.n8n.io/n8nio/n8n

Open http://SERVER-IP:5678 to create the owner account. n8n stores data (workflows, credentials) in /home/node/.n8n — the n8n_data volume — so it survives updates.

Create a docker-compose.yml:

services:
n8n:
image: docker.n8n.io/n8nio/n8n
restart: always
ports:
- "5678:5678"
environment:
- N8N_HOST=n8n.example.com
- N8N_PROTOCOL=https
- N8N_PORT=5678
- WEBHOOK_URL=https://n8n.example.com/
- GENERIC_TIMEZONE=Asia/Ho_Chi_Minh
- TZ=Asia/Ho_Chi_Minh
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:

Start it: docker compose up -d. To update later: docker compose pull && docker compose up -d.

Important: WEBHOOK_URL must be your real HTTPS URL, otherwise webhook triggers (Telegram, GitHub…) won’t work correctly.

The hard part: reverse proxy + SSL

The container above only serves unencrypted traffic on port 5678. To use it over a domain with HTTPS, you need a reverse proxy (nginx/Caddy/Traefik) pointing to 127.0.0.1:5678 and a Let’s Encrypt SSL certificate (certbot). With nginx you also have to enable WebSocket (n8n uses WS for its live UI):

location / {
proxy_pass http://127.0.0.1:5678;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}

This is the most time-consuming and error-prone step: proxy config, SSL renewal, opening the right ports, keeping WebSocket alive.

Common mistakes when self-hosting n8n on Docker

The easier way: 1-click n8n with MyPanel

If you’d rather not manage proxy, SSL and volumes yourself, MyPanel ships n8n in its Marketplace — install it in one click:

  1. Open the Marketplace, pick n8n, click Install.
  2. Enter your domain (pointed at the server).
  3. Click Install — MyPanel pulls the image, runs it in an isolated Docker container, configures the reverse proxy + WebSocket, and issues Let’s Encrypt SSL automatically.

You then manage n8n like any website: logs, start/stop, SSL, backups. Data lives in a persistent volume that survives redeploys. See the Marketplace guide.

Manual DockerMyPanel Marketplace
Start containerType commandsOne click
Reverse proxyConfigure yourselfAutomatic
SSLRun certbot yourselfAuto-issued + renewed
WebSocketAdd manuallyBuilt in
Backups & logsDIYRight in the panel

Conclusion

Running n8n on Docker gives you a powerful self-hosted automation engine. Doing it by hand is entirely possible, but the proxy + SSL + WebSocket layer is where beginners get stuck. If you want n8n running over HTTPS in minutes:

👉 Install MyPanel for free with one command, open the Marketplace, and install n8n in a single click — the Free plan is enough to get started.

MyPanel — Self-hosted control panel for websites, WordPress, databases & SSL on your Linux server.