Skip to content

Installing the Nginx web server

Learn how to set up the high-performance Nginx web server on an unmanaged hosting environment.

This guide explains how to install Nginx, a fast and efficient web server originally created as a high-speed alternative to Apache.

Installing Nginx
Follow the steps that match the Linux distribution running on your server. If your system uses a different distribution, refer to its documentation for installation instructions.

Debian and Ubuntu
To install Nginx:

  1. Log in to your server through SSH.
  2. As the root user, run:
apt update
apt install nginx
  1. Visit your server’s IP address or domain name in a web browser. You should see the default “Welcome to nginx!” page.

AlmaLinux and Fedora
To install Nginx:

  1. Log in to the server using SSH.
  2. As root, run:
yum -y update
yum -y install epel-release
yum -y install nginx
systemctl enable nginx
  1. Visit your server’s IP address or domain name in a browser to confirm the default Nginx Welcome page is displayed.

Publishing Web Content
The document root (where you place your website files) depends on your Linux distribution:

  • Debian / Ubuntu:
    /var/www/html
  • AlmaLinux / Fedora:
    /usr/share/nginx/html

Upload your files to the appropriate directory so visitors can access your website.

More Information
Official Nginx documentation is available at:
nginx.org/en/docs