n8n on AlmaLinux 9 (Docker Compose + Nginx + SSL)
n8n is an open-source workflow automation and integration platform that allows users to connect applications, APIs, and databases through a visual, no-code/low-code interface. It’s often compared to Zapier or Make (Integromat) — but with one key advantage: you own your data and infrastructure. With n8n, you can create custom workflows, trigger real-time events, and automate tasks across hundreds of services while keeping everything self-hosted.
Running n8n on AlmaLinux 9, a RHEL-compatible enterprise operating system, offers stability, performance, and long-term support. With SELinux enforcement, systemd 252, OpenSSL 3, and modern Docker + Compose support, AlmaLinux 9 provides an excellent foundation for deploying n8n with Nginx reverse proxy and SSL encryption for production-grade reliability.
Architecture Overview
| Layer | Component | Role |
|---|---|---|
| OS | AlmaLinux 9 | Enterprise-grade, RHEL-compatible Linux distribution |
| Runtime | Docker Engine + Compose | Runs n8n and supporting containers |
| Database | PostgreSQL / SQLite | Stores workflows, executions, credentials, and user data |
| Application | n8n Server (Node.js) | Provides workflow logic and web-based builder |
| Reverse Proxy | Nginx / Traefik | Handles HTTPS, compression, caching, and routing |
| TLS | Let’s Encrypt / PKI | Provides secure SSL for dashboard and webhooks |
Why Use n8n?
- Open-source alternative to Zapier/Make – automate your stack without recurring costs.
- Visual builder – design workflows with drag-and-drop logic.
- Over 400 native integrations – supports popular apps and APIs out of the box.
- Self-hosted – ensures privacy, compliance, and full control.
- Extensible – build custom nodes and integrate proprietary APIs.
- Event-driven – execute automations instantly with webhooks or triggers.
n8n vs Other Automation Platforms
| Feature/Capability | n8n (Self-hosted) | Zapier (Cloud) | Make (Cloud) | Node-RED (Self-hosted) |
|---|---|---|---|---|
| Hosting | Self-hosted | SaaS only | SaaS only | Self-hosted |
| Cost | Free, open-source | Subscription | Subscription | Free, open-source |
| Integrations | 400+ | 5000+ | 1500+ | 100+ |
| Extensibility | High (custom code) | Low | Moderate | High (JS-based) |
| Privacy | Full control | Cloud storage | Cloud storage | Local only |
| Ideal for | Developers / SMEs | Non-tech users | SMBs | Engineers / DIY setups |
n8n is the perfect choice for teams and organizations that value automation flexibility, data privacy, and scalability without vendor lock-in.
Security & Best Practices
- Deploy n8n behind Nginx with HTTPS enabled.
- Use environment variables or Docker secrets to store API keys securely.
- Run Docker containers with non-root permissions when possible.
- Enable and properly configure SELinux and firewalld.
- Restrict external access to only ports 80/443.
- Keep Docker, n8n images, and AlmaLinux packages updated regularly.
- Backup workflow and database volumes daily.
- Automate SSL renewals with Certbot or Traefik ACME integration.
Typical Use Cases
- Business process automation – connect CRMs, email systems, and APIs.
- DevOps and IT automation – trigger CI/CD, deploy updates, and monitor systems.
- Data integration and ETL – sync data between databases and cloud apps.
- Webhook-based event automation – respond to external API events instantly.
- Marketing automation – schedule campaigns or connect lead management tools.
- AI workflows – connect OpenAI, Hugging Face, or local LLM APIs.
Deploying n8n on AlmaLinux 9 with Docker Compose and Nginx delivers a secure, scalable, and enterprise-grade automation environment — combining the flexibility of open-source software with the reliability of a Red Hat-compatible platform.
Step 1: Create a Shape.Host Cloud Instance
Go to Shape.Host and log in.
Click Create → Instance.

Choose a data center location close to your target users.

Select a plan with at least 2 CPUs, 4 GB RAM, and 20 GB SSD.
Choose AlmaLinux 9 (64-bit) as the OS.

Click Create Instance.

Copy the public IP address under the “Resources” tab — you’ll need it to connect via SSH.

Step 2: Connect to Your Server
Use SSH to connect as root:
ssh root@your_server_ip
Step 3: Update the System
Update all system packages to ensure the latest versions and security patches:
dnf update -y

Step 4: Install Docker and Dependencies
Install necessary packages and Docker repository tools:
dnf install curl ca-certificates gnupg2 yum-utils -y

Add the official Docker CE repository:
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Install Docker and the Compose plugin:
dnf install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y

Enable and start the Docker service:
systemctl enable --now docker
Check Docker and Docker Compose versions:
docker --version
docker compose version

Step 5: Set Up the n8n Directory
Create a dedicated folder for n8n:
mkdir -p /opt/n8n
cd /opt/n8n
Create directories for persistent storage:
mkdir n8n-data local-files
Adjust ownership so Docker can write to these folders:
chown -R 1000:1000 n8n-data local-files

Step 6: Create the Docker Compose File
Open a new configuration file:
nano docker-compose.yml
Paste the following content:
services:
n8n:
image: n8nio/n8n:latest
container_name: n8n
restart: unless-stopped
ports:
- "5678:5678"
environment:
- N8N_HOST=n8n.example.com
- N8N_PORT=5678
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://n8n.example.com
- N8N_EDITOR_BASE_URL=https://n8n.example.com
- GENERIC_TIMEZONE=UTC
- N8N_USER_FOLDER=/home/node/.n8n
volumes:
- ./n8n-data:/home/node/.n8n
- ./local-files:/files
networks:
- n8n-network
networks:
n8n-network:
driver: bridge
Replace
n8n.example.comwith your domain name or subdomain.
Save and exit (CTRL + O, ENTER, CTRL + X).

Step 7: Start n8n with Docker Compose
Pull and launch the container in detached mode:
docker compose up -d

List active containers to verify it’s running:
docker compose ps

Check n8n logs:
docker logs -f n8n
Once running, n8n will be available on port 5678.

Step 8: Install and Configure Nginx
Install Nginx:
dnf install nginx -y

Enable and start the Nginx service:
systemctl enable --now nginx
Create a reverse proxy configuration for n8n:
nano /etc/nginx/conf.d/n8n.conf
Paste the following configuration:
server {
listen 80;
server_name n8n.example.com;
location / {
proxy_pass http://localhost:5678;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
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;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_buffering off;
proxy_read_timeout 300s;
proxy_connect_timeout 75s;
}
}

Test the Nginx configuration:
nginx -t
Reload Nginx to apply the changes:
systemctl reload nginx

Step 9: Secure n8n with SSL (Certbot)
Install Certbot and the Nginx plugin:
dnf install certbot python3-certbot-nginx -y

Run Certbot to automatically obtain and apply a free SSL certificate:
certbot --nginx -d almalinux-tutorials.shape.host --email contact@shape.host --agree-tos --non-interactive

Reload Nginx to activate HTTPS:
systemctl reload nginx
Step 10: Restart n8n
Restart the container to apply environment and SSL changes:
docker compose restart

Step 11: Access n8n
You can now access the n8n dashboard in your web browser at:
https://n8n.example.com
or (for IP-based testing):
http://YOUR_SERVER_IP:5678


Step 12: Enable Firewall (Optional but Recommended)
Allow HTTP, HTTPS, and SSH connections:
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --permanent --add-service=ssh
firewall-cmd --reload
You have installed n8n on AlmaLinux 9 with Docker Compose, Nginx reverse proxy, and SSL encryption.
You now have a fully automated workflow engine running securely on your Shape.Host Linux SSD VPS.
For improved performance, backups, and scaling — Shape.Host offers flexible plans ideal for Docker-based automation environments.