This guide will step you through how to install Nginx on Debian 10 Buster. Nginx is an opensource web server, reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, load balancer and an HTTP cache.
Install Nginx on Debian 10 Buster
Nginx is available on the default Debian 10 Buster repos and can be installed using the APT package manager.
Run system update
To resynchronize your system packages to their latest versions, run the commands below
apt update
apt upgrade
Install Nginx on Debian 10 Buster
apt install nginx
Running Nginx
Upon installation, Nginx is started and enabled to run on system boot.
systemctl status nginx
● 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 Thu 2019-07-18 20:48:37 EAT; 17s ago
Docs: man:nginx(8)
Main PID: 1497 (nginx)
Tasks: 2 (limit: 1150)
Memory: 3.1M
CGroup: /system.slice/nginx.service
├─1497 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
└─1498 nginx: worker process
systemctl is-enabled nginx
enabled
To stop or restart Nginx;
systemctl stop nginx
systemctl restart nginx
To reload Nginx;
systemctl reload nginx
To verify Nginx for any configuration errors;
nginx -t
Allow Nginx on Firewall
If UFW is running, allow access to Nginx.
ufw allow 'Nginx Full'
The above command open ports 80 (HTTP) and 443 (HTTPS) on firewall. If you need to open just port 80 (allow HTTP traffic) or port 443 (allow HTTPS traffic), you can run either of the commands below respectively.
ufw allow 'Nginx HTTP'
ufw allow 'Nginx HTTPS'
Accessing Nginx
To verify that Nginx is ready to server your web pages, navigate to the browser and enter the server IP address, http://<server-IP>.
If all is well, you should land on Nginx welcome page.
Nginx is installed successfully on Debian 10 Buster
You can also check our other articles using the below links;
Install phpMyAdmin on Debian 10 Buster