
Install n8n with Docker
This guide shows how to install n8n, the workflow automation tool with 400+ integrations, manually with Docker Compose on your Linux server, including reverse proxy and owner account. Alternatively, Server4You offers n8n as a ready-to-use app template on Debian, accessible via SSH tunnel.
Step 1: Create the Project Directory and Files
Log in to your server via SSH and create a directory for n8n. Inside it, create the Compose file and a .env file for your configuration variables:
Paste the following content into the docker-compose.yml file:
Binding to 127.0.0.1:5678 ensures n8n is only accessible locally for security reasons. External access is handled by the reverse proxy in Step 4. Your workflows and credentials are stored in the Docker volume n8n_data.
Step 2: Configure Environment Variables
Open the .env file with nano .env and paste the following content. Adjust the values to match your setup:
WEBHOOK_URL is critical: This variable must be set to the final, public URL of your n8n instance — otherwise webhooks will not function correctly. When using HTTPS, it must start with https://.
Step 3: Start n8n
Start the n8n container with the following command. Docker will pull the image and start the container in the background.
Step 4: Set Up a Reverse Proxy (Required)
Since n8n is only accessible locally by default (127.0.0.1:5678), you must set up a reverse proxy to access it from the internet via your domain. The reverse proxy forwards requests from your public domain (e.g. https://n8n.yourdomain.com) to the local n8n container and handles HTTPS termination.
Common tools for this are Nginx Proxy Manager, Traefik, or Caddy. All three can run as Docker containers and integrate well with this setup.
Step 5: First Access and Account Setup
Once your reverse proxy is configured, open your browser and navigate to your n8n domain (e.g. https://n8n.yourdomain.com).
On first load, you will be prompted to create an owner account — enter an email address and a secure password. This will be your main administrator account for n8n.
Further Documentation
For advanced configuration, workflow templates, and integration guides, refer to the official n8n documentation.