Running N8N on Your Own Server: The Complete Production Deployment Guide

Step-by-step guide to deploying N8N with Docker, PostgreSQL, Traefik SSL, automated backups, and production hardening. Copy-paste configs included.

Server Requirements

Step 1: Initial Server Setup

Step 2: Create the Project Directory

Step 3: Create the Environment File

Step 4: Create the Docker Compose File

Step 5: Configure DNS

Step 6: Launch and Verify

Step 7: Firewall Configuration

This guide walks you through every step from bare server to production-ready N8N instance. Every command is copy-paste ready. Every config file is complete. By the end, you will have N8N running with PostgreSQL, automatic SSL certificates, automated nightly backups, and basic monitoring.

N8N is not resource-hungry for most SMB workloads, but undersizing your server causes workflow execution delays and timeouts that are painful to debug.

SSH into your fresh server and run the following. This updates the system, installs Docker and Docker Compose, and verifies everything is working.

You should see Docker 24+ and Docker Compose v2+. If either command fails, the installation did not complete correctly. Check the Docker install script output for errors.

The environment file stores your secrets and configuration. Generate strong random values for each secret. Never reuse passwords from other systems.

This configuration runs three containers: Traefik (reverse proxy with automatic SSL), PostgreSQL (database), and N8N itself. Traefik handles HTTPS termination and certificate renewal automatically via Let's Encrypt.