Project for running n8n with access through aimost.pl domain using Cloudflare Tunnel.
- n8n: Workflow automation platform (port 5678)
- Cloudflare Tunnel: Traffic proxying from aimost.pl to n8n
- Docker Compose: Container orchestration
- Redis: Queue backend for n8n executions
- n8n worker: Executes jobs from the Redis queue
- Docker and Docker Compose
.envfile with environment variablescloudflared/credentials.jsonfile with Cloudflare credentials
DOMAIN_NAME=example.com
# n8n
WEBHOOK_URL=https://n8n.example.com
N8N_HOST=n8n.example.com
N8N_PORT=5678
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=admin@example.com
N8N_BASIC_AUTH_PASSWORD=supersecret
N8N_ENCRYPTION_KEY=please_set_a_secure_random_key
# Database
POSTGRES_DB=n8n
POSTGRES_USER=n8n
POSTGRES_PASSWORD=changeme# Copy from your Cloudflare dashboard
cp ~/.cloudflared/credentials.json cloudflared/credentials.json./start.sh./stop.shdocker ps --filter "name=n8n" --filter "name=n8n-worker" --filter "name=redis" --filter "name=cloudflared"docker run --rm -v n8n_data:/data -v $(pwd):/backup alpine tar czf /backup/n8n_backup.tar.gz -C /data .docker run --rm -v n8n_data:/data -v $(pwd):/backup alpine tar xzf /backup/n8n_backup.tar.gz -C /data# If you have existing n8n_data/ folder, run this once:
docker run --rm -v n8n_data:/dest -v $(pwd)/n8n_data:/src alpine cp -a /src/. /dest/After startup, n8n will be available at: https://aimost.pl
project_root/
├── cloudflared/
│ ├── config.yml # Cloudflare Tunnel configuration (not in git)
│ ├── config.yml.template # Cloudflare Tunnel configuration template
│ └── credentials.json # Credentials (not in git)
├── docker-compose.yml # Docker Compose configuration
├── start.sh # Start script
├── stop.sh # Stop script
└── .env # Environment variables (not in git)
Docker volumes:
└── n8n_data # n8n persistent data (Docker named volume)
└── postgres_data # Postgres persistent data
└── redis_data # Redis persistent data (AOF)
- n8n data is saved in Docker named volume
n8n_data(persistent across deployments) - Make sure
.envandcredentials.jsonfiles are not committed to git - n8n is configured with basic authentication and HTTPS protocol