1. Purpose
This guide explains how to deploy n8n on a ReadySpace Cloud Server using Docker, including secure HTTPS setup with SSL and recommended system hardening.
2. Who Should Use This Guide
- Familiar with basic Linux command-line operations
- Knowledgeable about Docker & Docker Compose
- Able to configure DNS and reverse proxy using Nginx
- Understands SSL certificate issuance via Let’s Encrypt / Certbot
3. Prerequisites
3.1 Server Requirements
- Ubuntu 20.04 or newer on ReadySpace Cloud Server
- Root or sudo privileges
- Domain or subdomain pointing to your server (e.g., n8n.example.com)
3.2 Install Required Packages
sudo apt update && sudo apt upgrade -ysudo apt install -y docker.io docker-compose nginx certbot python3-certbot-nginxsudo systemctl enable dockerVerify installation:
docker -vdocker compose versionnginx -vcertbot --version4. Step‑by‑Step Implementation
4.1 Prepare Working Directory
mkdir -p /opt/n8n && cd /opt/n8n4.2 Create .env File
# .envN8N_BASIC_AUTH_ACTIVE=trueN8N_BASIC_AUTH_USER=yourusernameN8N_BASIC_AUTH_PASSWORD=yourstrongpasswordN8N_HOST=n8n.example.comN8N_PORT=5678N8N_PROTOCOL=httpsWEBHOOK_TUNNEL_URL=https://n8n.example.com4.3 Create docker-compose.yml
version: "3.7"services:  n8n:    image: n8nio/n8n    restart: always    environment:      - DB_SQLITE_FILE=/home/node/.n8n/database.sqlite      - N8N_BASIC_AUTH_ACTIVE=${N8N_BASIC_AUTH_ACTIVE}      - N8N_BASIC_AUTH_USER=${N8N_BASIC_AUTH_USER}      - N8N_BASIC_AUTH_PASSWORD=${N8N_BASIC_AUTH_PASSWORD}      - N8N_HOST=${N8N_HOST}      - N8N_PORT=${N8N_PORT}      - N8N_PROTOCOL=${N8N_PROTOCOL}      - WEBHOOK_TUNNEL_URL=${WEBHOOK_TUNNEL_URL}    ports:      - "5678:5678"    volumes:      - ./n8n_data:/home/node/.n8n4.4 Configure Nginx Reverse Proxy
sudo nano /etc/nginx/sites-available/n8n# Paste the following content:server {  listen 80;  server_name n8n.example.com;  location / {    proxy_pass http://localhost:5678;    proxy_set_header Host $host;    proxy_set_header X-Real-IP $remote_addr;    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;    proxy_set_header X-Forwarded-Proto $scheme;  }}sudo ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/sudo nginx -tsudo systemctl reload nginx4.5 Issue SSL with Certbot
sudo certbot --nginx -d n8n.example.comsudo crontab -e# Add this line:0 3 * * * /usr/bin/certbot renew --quiet4.6 Start n8n
docker compose up -d5. Post‑Deployment Checklist
| Task | Command / Action | 
|---|---|
| Access n8n | https://n8n.example.com | 
| Login | Use credentials in the .envfile | 
| Test workflow | Create a webhook and trigger using Postman or browser | 
| Restart n8n | docker compose restart | 
| View logs | docker compose logs -f | 
6. Maintenance & Upgrades
docker compose pulldocker compose downdocker compose up -d7. Security Hardening
- Enable UFW firewall:
sudo ufw allow 22,80,443/tcpsudo ufw enable- Install and configure fail2ban
- Use SSH key-based login; disable password authentication
- Backup the ./n8n_datadirectory regularly