
In this tutorial, I will explain how to install Nginx version 1.27.X on Ubuntu 24.04 (this also works for Ubuntu version 22.04).
At the time of writing this tutorial, the version of Nginx available on Ubuntu repositories is 1.24.X. On the Nginx.org website, the Mainline version of Nginx is 1.27X and the Stable version is Nginx 1.26.X.
In order to install the Mainline version of Nginx on Ubuntu, we will go through the repository PPA for NGINX Mainline with HTTP/2 : Ondřej Surý
When version 1.2X.X goes Mainline, the Nginx version will change.
To begin, we will install the repository:
sudo add-apt-repository ppa:ondrej/nginx-mainline
Update the list of available packages:
sudo apt update
Install Nginx on Ubuntu 24.04:
sudo apt install nginx -y
Once installed, validate the installation of Nginx with the following command to display the version:
sudo nginx -v
If you need add-ons for Nginx, list the available modules with the following command:
apt list | grep libnginx-mod
Then to install Nginx module enter the following command:
sudo apt install libnginx-mod-http-xxxx -y
Restart Nginx to take effect:
sudo systemctl restart nginx
Now you know how to install the Mainline version of Nginx on Ubuntu 24.04.