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

LayerComponentRole
OSAlmaLinux 9Enterprise-grade, RHEL-compatible Linux distribution
RuntimeDocker Engine + ComposeRuns n8n and supporting containers
DatabasePostgreSQL / SQLiteStores workflows, executions, credentials, and user data
Applicationn8n Server (Node.js)Provides workflow logic and web-based builder
Reverse ProxyNginx / TraefikHandles HTTPS, compression, caching, and routing
TLSLet’s Encrypt / PKIProvides 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/Capabilityn8n (Self-hosted)Zapier (Cloud)Make (Cloud)Node-RED (Self-hosted)
HostingSelf-hostedSaaS onlySaaS onlySelf-hosted
CostFree, open-sourceSubscriptionSubscriptionFree, open-source
Integrations400+5000+1500+100+
ExtensibilityHigh (custom code)LowModerateHigh (JS-based)
PrivacyFull controlCloud storageCloud storageLocal only
Ideal forDevelopers / SMEsNon-tech usersSMBsEngineers / 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.

Shape.host Resources dashboard with Create > Instance highlighted.

Choose a data center location close to your target users.

Shape.host instance form with the data center location selector highlighted.

Select a plan with at least 2 CPUs, 4 GB RAM, and 20 GB SSD.

Choose AlmaLinux 9 (64-bit) as the OS.

Shape.host instance form with the operating system image selector highlighted.

Click Create Instance.

Shape.host instance form with the Create Instance button highlighted.

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

Shape.host Resources dashboard with the server IP address highlighted.

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
Terminal showing DNF/YUM package management commands and output.

Step 4: Install Docker and Dependencies

Install necessary packages and Docker repository tools:

dnf install curl ca-certificates gnupg2 yum-utils -y
Terminal showing DNF/YUM package management commands and output.

Add the official Docker CE repository:

dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Terminal showing dnf commands or output during Install Docker and Dependencies.

Install Docker and the Compose plugin:

dnf install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
Terminal showing DNF/YUM package management commands and output.

Enable and start the Docker service:

systemctl enable --now docker

Check Docker and Docker Compose versions:

docker --version
docker compose version
Terminal showing the installed 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
Terminal showing file and directory setup commands.

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.com with your domain name or subdomain.

Save and exit (CTRL + O, ENTER, CTRL + X).

Terminal showing the GNU nano editor and configuration text.

Step 7: Start n8n with Docker Compose

Pull and launch the container in detached mode:

docker compose up -d
Terminal showing container image download progress.

List active containers to verify it’s running:

docker compose ps
Terminal showing docker commands or output during Start n8n with Docker Compose.

Check n8n logs:

docker logs -f n8n

Once running, n8n will be available on port 5678.

Terminal showing git commands or output during Start n8n with Docker Compose.

Step 8: Install and Configure Nginx

Install Nginx:

dnf install nginx -y
Terminal showing DNF/YUM package management commands and output.

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;
    }
}
Terminal showing web server configuration text.

Test the Nginx configuration:

nginx -t

Reload Nginx to apply the changes:

systemctl reload nginx
Terminal showing systemd service management commands or output.

Step 9: Secure n8n with SSL (Certbot)

Install Certbot and the Nginx plugin:

dnf install certbot python3-certbot-nginx -y
Terminal showing DNF/YUM package management commands and output.

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
Terminal showing Certbot certificate commands and messages.

Reload Nginx to activate HTTPS:

systemctl reload nginx

Step 10: Restart n8n

Restart the container to apply environment and SSL changes:

docker compose restart
Terminal showing the command to restart the n8n service.

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
n8n initial owner account setup form.
n8n overview with options to create or import a workflow.

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.