Hero Image

Install Nginx on AlmaLinux 9

Install Nginx on AlmaLinux 9

This guide walks through installing and starting Nginx on AlmaLinux 9.

Step 1 – Update the system and enable EPEL

dnf update -y
dnf install epel-release -y

Step 2 – Install Nginx

dnf install -y nginx

Step 3 – Start and enable Nginx

systemctl enable --now nginx

Step 4 – Allow HTTP and HTTPS traffic

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload

Step 5 – Verify the installation

nginx -v
curl -I http://localhost

Nginx is now running. Its main configuration file is /etc/nginx/nginx.conf and virtual-host snippets go in /etc/nginx/conf.d/.

Next steps