Install Nginx Server in Digital Ocean, AWS, Google Cloud Hosting Ubunt 20.04

Nginx server has been gaining name in the world of server preference. Following guide is helfpul to install Nginx server in Ubuntu 20.04 Operating system hosted at Cloud Hosting(Digital Ocean, Amazon AWS or Google)

Nginx Server Installation

To install Nginx server, you must have to login into Ubuntu OS using Putty with non-root user and password. This non root user must have super user privileges.(If you have no idea about this, check second chapter of this tutorial series. All the chapter list are present below this article)

Following command is going to install Nginx Server and also will update all the required updates.

test@tester:~$ sudo apt update && sudo apt install nginx

After couple of minutes processing, the server will be installed.

To check if Nginx is installed and is running, use following command.

test@tester:~$ sudo service nginx status

The above command will print some thing like below.
‚óŹ nginx.service – A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-08-09 10:19:11 IST; 2min 39s ago
Docs: man:nginx(10)
Process: 89698 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 44659 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 27693 (nginx)
Tasks: 2 (limit: 1153)
Here see active status is active and it is running. So it means Nginx has successfully installed.

Now lets test the server is responding in right way. Type the ip address of your cloud hosting in the browser address and press enter. Some thing like below is going to appear in the browser window.

If you see something similar to above, then the Nginx Server is responding in right way. It is successfully installed.

Conclusion

I hope you have understood how to install Nginx in Ubuntu 20.04 (Digital Ocean Cloud hosting)