How to Install NGINX on AlmaLinux or Rocky
Short answerInstall NGINX with dnf, enable and start the service, allow HTTP/HTTPS in firewalld, then verify with curl. VPSGrid provides unmanaged hosting — you administer the guest OS, applications, and data inside the VM.
Overview
This guide installs NGINX on AlmaLinux or Rocky Linux templates from VPSGrid. It covers package install, service enablement, firewall openings, and a quick health check. It does not cover Ubuntu/Debian (apt / sites-available) — use the Ubuntu/Debian NGINX article for those distributions.
Before you start
- SSH access as
root(or a sudo-capable user) - Your VPS primary IP from the welcome email or Services → My Services
- AlmaLinux or Rocky Linux selected as the guest OS
Commands
# Replace YOUR_PRIMARY_IP with the primary IP from your VPSGrid welcome email
ssh root@YOUR_PRIMARY_IP
# Update packages
dnf upgrade -y
# Install NGINX
dnf install -y nginx
# Enable and start
systemctl enable --now nginx
systemctl status nginx --no-pager
# Confirm version and local response
nginx -v
curl -I http://127.0.0.1
# Allow HTTP/HTTPS through firewalld (if firewalld is active)
systemctl is-active firewalld
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
# Test from outside (run on your laptop)
curl -I http://YOUR_PRIMARY_IPRun commands as a privileged user (root or sudo). VPSGrid support does not execute guest OS commands on your behalf for unmanaged VPS plans.
Default site location (AlmaLinux / Rocky)
On RHEL-family systems, NGINX typically serves files from /usr/share/nginx/html and loads extra config from /etc/nginx/conf.d/ (not Debian’s sites-available layout).
# Main config
ls /etc/nginx/nginx.conf
ls /etc/nginx/conf.d/
# Default document root
ls /usr/share/nginx/html
# Validate and reload after edits
nginx -t
systemctl reload nginxOptional: SELinux HTTP network access
If the service is running but remote browsers fail while local curl works, confirm SELinux is not blocking the daemon unexpectedly and that firewalld rules were applied. For custom non-standard ports you may need additional SELinux/firewall adjustments.
getenforce
# If you changed listen ports beyond 80/443, review SELinux/firewall docs before opening tickets.Rocky Linux may be temporarily unavailable for new orders depending on platform configuration. If Rocky is not listed at checkout, choose AlmaLinux (or Ubuntu) and adapt package commands accordingly.
Important notes
- VPSGrid is unmanaged — support assists with platform/billing issues; guest OS stack work is your responsibility unless a separate managed product applies.
- Point your domain with a DNS A record to your primary IP after NGINX is serving on ports 80/443.
- Refer to checkout at vpsgrid.net for current plan specs — this article does not publish fixed pricing.
VPSGrid context
VPSGrid sells unmanaged KVM VPS with root or administrator access. You are responsible for guest OS configuration, application stacks, backups inside the VM, and security hardening. VPSGrid manages hypervisor infrastructure, network connectivity to your primary IP, power controls in the client area, and billing.
Linux templates include Ubuntu, Debian, AlmaLinux, Rocky Linux. Do not assume CentOS Stream, Fedora, or other unsupported distributions are available at checkout.
Frequently Asked Questions
Does VPSGrid manage NGINX for me?
No. On unmanaged VPS plans you install and maintain NGINX yourself unless a product page explicitly includes managed application support.
Can I use this guide on Ubuntu or Debian?
Use the Ubuntu/Debian NGINX guide instead. Those systems use apt and often /etc/nginx/sites-available, which differs from AlmaLinux/Rocky.
Where do I put server blocks on AlmaLinux/Rocky?
Add .conf files under /etc/nginx/conf.d/, run nginx -t, then systemctl reload nginx.
What if I am stuck after following this guide?
Open a support ticket with your service ID, primary IP, OS version (cat /etc/os-release), and the exact commands already tried.
Related Articles
Need More Help?
Search this knowledge base for related guides. For billing, provisioning, or primary IP assignment issues, open a ticket at billing.vpsgrid.net with your service ID, primary IP, and steps already tried.
Was this answer helpful?