How to Install n8n Workflow Automation Platform on AlmaLinux 9

n8n is an open-source, extendable workflow automation tool that allows you to connect various services (like APIs, databases, CRMs, cloud platforms, and more) using a visual interface. It’s ideal for automating repetitive tasks without needing deep programming skills.

Prerequisites

Before beginning, ensure the following:

  • A fresh AlmaLinux 9 VPS/server

  • A registered domain (we will use n8n.domainhere.info)

  • root or sudo access

  • Open ports: 80 and 443

  • Docker and Nginx will be used for running and proxying n8n

Install Docker on AlmaLinux 9

Docker will run n8n in an isolated container.

Update your system:

dnf update -y

Install required packages:

dnf install -y dnf-plugins-core

This adds useful tools for working with repositories.

Add Docker repo:

dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Install Docker engine:

dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Start and enable Docker service:

systemctl enable --now docker

Verify Docker is installed:

docker version

Output:

[root@vps ~]# docker version
Client: Docker Engine - Community
 Version:           28.3.3
 API version:       1.51
 Go version:        go1.24.5
 Git commit:        980b856
 Built:             Fri Jul 25 11:37:02 2025
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          28.3.3
  API version:      1.51 (minimum version 1.24)
  Go version:       go1.24.5
  Git commit:       bea959c
  Built:            Fri Jul 25 11:33:59 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.27
  GitCommit:        05044ec0a9a75232cad458027ca83437aae3f4da
 runc:
  Version:          1.2.5
  GitCommit:        v1.2.5-0-g59923ef
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Install Nginx

Nginx will be used as a reverse proxy to expose n8n over HTTPS.

Install Nginx using below command,

dnf install -y nginx

Enable and start Nginx,

systemctl enable --now nginx

Check and verify it’s running,

systemctl status nginx

Output:

[root@vps ~]# systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: disabled)
     Active: active (running) since Thu 2025-07-31 12:42:02 UTC; 3s ago
    Process: 32695 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
    Process: 32696 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
    Process: 32697 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
   Main PID: 32698 (nginx)
      Tasks: 5 (limit: 23132)
     Memory: 5.0M
        CPU: 40ms
     CGroup: /system.slice/nginx.service
             ├─32698 "nginx: master process /usr/sbin/nginx"
             ├─32699 "nginx: worker process"
             ├─32700 "nginx: worker process"
             ├─32701 "nginx: worker process"
             └─32702 "nginx: worker process"

Configure Nginx for n8n Reverse Proxy

Create a custom Nginx config to proxy n8n.domainhere.info to the Docker container.

Note: Replace n8n.domainhere.info with actual domain name

Create config file,

nano /etc/nginx/conf.d/n8n.domainhere.info.conf

Add the following,

server {
    listen 80;
    server_name n8n.domainhere.info;

    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;
    }
}

Note: Replace n8n.domainhere.info with actual domain name

Test and reload Nginx,

nginx -t && systemctl reload nginx

Output:

[root@vps ~]# nginx -t && systemctl reload nginx
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Configure Firewall for HTTP and HTTPS

Open the required ports so your domain can be accessed via web.

Allow HTTP, HTTPS, and n8n Docker port (5678):

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --permanent --add-port=5678/tcp
firewall-cmd --reload

Output:

[root@vps ~]# firewall-cmd --reload
success

Disable SELinux Enforcement (Optional but Recommended)

Some setups—especially Docker and reverse proxy—can face permission issues due to SELinux being in enforcing mode. It's safe to disable enforcement temporarily or permanently if you're running trusted containers.

Temporarily disable SELinux enforcement,

setenforce 0

Test and reload Nginx,

nginx -t && systemctl reload nginx

Install Certbot for SSL (Let's Encrypt)

Certbot automatically issues free SSL certificates and sets up HTTPS.

Install EPEL and Certbot with Nginx plugin,

dnf install -y epel-release
dnf install -y certbot python3-certbot-nginx

Execute certbot with Nginx plugin,

certbot --nginx -d n8n.domainhere.info

Note: Replace n8n.domainhere.info with actual domain name

Output:

[root@vps ~]# certbot --nginx -d n8n.domainhere.info
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
 (Enter 'c' to cancel): admin@test.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.5-February-24-2025.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y
Account registered.
Requesting a certificate for n8n.domainhere.info

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/n8n.domainhere.info/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/n8n.domainhere.info/privkey.pem
This certificate expires on 2025-10-29.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for n8n.domainhere.info to /etc/nginx/conf.d/n8n.domainhere.info.conf
Congratulations! You have successfully enabled HTTPS on https://n8n.domainhere.info

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le

Test and reload Nginx,

nginx -t && systemctl reload nginx

Install and Run n8n with Docker

We will now deploy n8n containerized with persistent storage.

Create a Docker volume to persist n8n data

docker volume create n8n_data

Run n8n container,

docker run -it --rm --name n8n \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n

Output:

[root@vps ~]# docker run -it --rm --name n8n \
  -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n
Unable to find image 'docker.n8n.io/n8nio/n8n:latest' locally
latest: Pulling from n8nio/n8n
fe07684b16b8: Pull complete 
49b72e7e39fe: Pull complete 
c1ab3b052759: Pull complete 
845179b1d451: Pull complete 
ad03744990d9: Pull complete 
4f4fb700ef54: Pull complete 
08dc440bdf76: Pull complete 
f4108e6f40e2: Pull complete 
4348799b9d73: Pull complete 
d1e307a589c8: Pull complete 
9d7c2520a08d: Pull complete 
dbc8d4c589e0: Pull complete 
16cd460c3798: Pull complete

Access n8n Web UI

Once everything is set, access n8n in your browser,

https://n8n.domainhere.info

Note: Replace n8n.domainhere.info with actual domain name

Fill in the admin details to set up the owner account.

images

images

You should see the n8n interface like below,

images


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS