Production deployment of n8n workflow automation platform
Secure n8n Deployment using Docker, NGINX & Let’s Encrypt SSL
Overview
This document provides a complete, production-ready installation and configuration guide for deploying n8n on Ubuntu 22.04, including:
Docker-based installation
Reverse proxy configuration using NGINX
HTTPS enablement using Let’s Encrypt
The guide ensures a secure, stable, and scalable deployment suitable for enterprise use.
System Requirements
Virtual Machine Specifications
Operating System
Ubuntu 22.04 LTS
–
CPU
2 vCPU
2–4 vCPU
RAM
4 GB
4–8 GB
Storage
20 GB
40–50 GB SSD
Network
Public IP Address
Static IP Preferred
Required Ports
SSH
22
n8n Web UI
5678
HTTP (NGINX)
80
HTTPS (NGINX)
443
Prerequisites
Ensure the following before starting:
A working Ubuntu 22.04 VM Public IP reachable over the internet Domain name pointing to the server
To verify domain DNS resolution:
Step1: Install Docker & Docker Compose
1.1 Update System Packages
1.2 Install Docker Engine
1.3 Install Docker Compose
1.4 Verification
Check Docker service:
Check versions:
Step2: Deploy n8n using Docker Compose
2.1 Create Directory
2.2 Create Docker Compose File
2.3 Add the Following Configuration
save the file in nano.
Press CTRL + O → then press Enter to save
Press CTRL + X to exit nano
2.4 Start n8n Service
2.5 Validate Service
Step3: Access n8n Web Interface
If domain is not configured:
If Basic Authentication is enabled:
Username: admin
Password: hello@123
After login, set:
Email
First Name
Last Name
New admin password
This will create the primary Owner Account.
Step4: Configure NGINX Reverse Proxy
4.1 Install NGINX
4.2 Create Reverse Proxy Configuration
Paste:
save the file in nano.
Press CTRL + O → then press Enter to save
Press CTRL + X to exit nano
4.3 Enable Configuration

Step5: Enable HTTPS using Let’s Encrypt
5.1 Install Certbot
5.2 Generate SSL Certificate


Follow prompts:
Enter email
Accept Terms of Service: Yes
Choose whether to share email
Certbot applies SSL automatically
5.3 Validate HTTPS
Open:
Expected:
SSL padlock Secure connection n8n dashboard loads without port
Step6: Deployment Completed Successfully
n8n has been successfully installed on Ubuntu 22.04 with Docker, configured with NGINX Reverse Proxy, and secured with HTTPS using Let’s Encrypt.

Last updated