How to Install The Latest Version of Nginx on Ubuntu Bionic maintains a repository for Ubuntu. We can use this repository to install the latest version of Nginx.
First off, let's create a repository source file for Nginx with the following command.

1vim /etc/apt/sources.list.d/nginx.list

Paste in the following two lines to the file:

1deb [arch=amd64] bionic nginx
2deb-src bionic nginx

In order to verify the integrity of packages downloaded from this repository, we need to import Nginx public key using the commands below.

2apt-key add nginx_signing.key

You should see 'OK' so that we can move on.
Run the following command to update the repository info, remove the former version, finally install the latest version of nginx.

1apt update
2apt remove nginx nginx-common nginx-full nginx-core
3apt install nginx
4systemctl status nginx

Beautiful! Right? ;)
On CentOS 8:

1dnf -y upgrade
2dnf -y install
3systemctl enable --now nginx

Happy coding! ๐Ÿ˜Ž

comments powered by Disqus