🌟 What is n8n?
n8n is an open source workflow automation tool that connects 200+ services (Google Sheets, Slack, Telegram, etc.) to automate complex tasks.
✅ Codeless interface
✅ Self-hosted available
✅ Highly scalable node-based structure
🔥 Think of it as a business-grade version of “If This Then That (IFTTT)”!
—.
🐳 Why install with Docker Compose?
Benefits | Description |
---|---|
Simplicity | 1 file to set up without complicated dependencies! |
Consistency | Ensure your dev/test/production environments are the same |
Extensibility | Easy to integrate additional services such as PostgreSQL, Redis, etc. |
Manageability | Integrated management with docker-compose command |
—]
⚙️ Preparation
- Install Docker
See official documentation
sudo apt update && sudo apt install docker.io docker-compose
- Create a directory
mkdir n8n-docker && cd n8n-docker
—]
🛠️ write docker-compose.yml (basic)
version: '3.8'
services:
n8n:
image: n8nio/n8n
restart: always
ports:
- "5678:5678" # Web interface ports.
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin # 🔑 username
- N8N_BASIC_AUTH_PASSWORD=securepassword123! # 🔒 Password
volumes:
- N8N_DATA:/home/node/.N8N # Ensure data persistence.
networks:
- n8n_network
volumes:
n8n_data: # Create volumes
networks:
n8n_network:
—.
🔥 Advanced Settings (DB + HTTPS)
version: '3.8'
services:
postgres:
image: postgres:13
environment:
POSTGRES_USER: n8n_user
POSTGRES_PASSWORD: db_password123!
POSTGRES_DB: n8n_db
volumes:
- pg_data:/var/lib/postgresql/data
n8n:
image: n8nio/n8n
depends_on:
- postgres
environment:
DB_TYPE: postgresdb
DB_POSTGRESDB_DATABASE: n8n_db
DB_POSTGRESDB_USER: n8n_user
DB_POSTGRESDB_PASSWORD: db_password123!
DB_POSTGRESDB_HOST: postgres
N8N_HOST: yourdomain.com # 🌐 Domain Settings
N8N_PROTOCOL: https # 🔐 Force HTTPS
VUE_APP_URL_BASE_API: https://yourdomain.com/
volumes:
- n8n_data:/home/node/.n8n
ports:
- "443:5678" # HTTPS standard port mapping
volumes:
n8n_data:
pg_data:
# 💡 Tip: Add an Nginx reverse proxy for extra security!
—.
🚀 Run and stop commands
# start
docker-compose up -d
# Check the status
docker-compose ps
# View logs
docker-compose logs -f n8n
# Stop (preserve data)
docker-compose down
—]
📍 Initial Setup Guide
- Enter the Access Address:
http://서버IP:5678
- Create a workflow
- ➕ Set trigger (starting point) with
Add Node
- 🔗 Connect nodes to configure automation flow
- Example: Receive Gmail → Send Slack notification
- ➕ Set trigger (starting point) with
- **Save Credentials 🔐 Securely manage your integration service API keys!
—.
⚠️ Precautions & Optimization Tips
- **Security enhancements
- Require basic authentication (
N8N_BASIC_AUTH_ACTIVE=true
) - Encrypt sensitive data by setting
N8N_ENCRYPTION_KEY
.
- Require basic authentication (
- backup strategy
# backup volume data docker run --rm -v n8n_data:/source -v $(pwd):/backup busybox tar cvf /backup/n8n_backup.tar /source
- **Resource Limitations
# Add docker-compose.yml deploy: Resources: limits: cpus: '1.0' memory: 2G
—.
🎯 Finish
> “n8n + Docker Compose = infinite automation possibilities” 🚀 Increase business efficiency by 200%. 💡 Save money compared to commercial tools (Free to self-host!) 🔧 Flexible customization possible
Start automating your daily tasks with the infrastructure you configure today. Your time is already being saved on your first successful workflow run!
> ✨ Recommended next steps: > – Learn advanced nodes from the official documentation > – Set up GitHub integration to notify you when code is pushed > – Implement a workflow to automatically generate daily reports
If you have any questions, please leave a comment. May your IT infrastructure grow with you! 😊 D