Installing the Web Server NGINX to a Debian Server

by Lance Gold

A web server presents static file documents. An app server handles output from code.

Return to index

For this example. We can start with the email you get from the service provider.

Do I have nginx


dpkg -l "nginx*”
apt info nginx

From the AI Overview

Step one: Update the server&rsq;s package index


sudo apt update
sudo apt upgrade

Step two: Install Nginx using apt package management


sudo apt install nginx

Step three: Start and Enable the Nginx Service


sudo systemctl start nginx
sudo systemctl enable nginx

Step four: Verify the installation


sudo systemctl status nginx

you@de:~$ sudo systemctl status nginx
• nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running) since Sat 2026-01-17 18:09:35 PST; 3min 19s ago
 Invocation: 4058e3a5e1554dedb22aaad3f1972d10
       Docs: man:nginx(8)
   Main PID: 1610787 (nginx)
      Tasks: 2 (limit: 2303)
     Memory: 2.3M (peak: 5.2M)
        CPU: 92ms
     CGroup: /system.slice/nginx.service
             ??1610787 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;"
             ??1610790 "nginx: worker process"

Jan 17 18:09:35 c7.xcvvc.com systemd[1]: Starting nginx.service - A high performance web server and a reverse proxy server...
Jan 17 18:09:35 c7.xcvvc.com systemd[1]: Started nginx.service - A high performance web server and a reverse proxy server.
you@de:~$

Step five: Adjust the Firewall (Optional but Recommended)

Take a look at the nftables.conf file.


you@de:~$ sudo nft list ruleset
[sudo] password for x:
table inet filter {
        chain input {
                type filter hook input priority filter; policy drop;
                ct state established,related accept
                iifname "lo" accept
                icmp type echo-request accept
                tcp dport 22 accept
                tcp dport { 80, 443 } accept
                tcp dport { 3000, 3306 } accept
                log prefix "Server Block: " flags all
        }

        chain forward {
                type filter hook forward priority filter; policy accept;
        }

        chain output {
                type filter hook output priority filter; policy accept;
        }
}
you@de:~$

Step six: Access the Default Nginx Page

Open your web browser and navigate to your server's IP address (e.g., http://your_server_ip). You should see the default "Welcome to nginx!" landing page, confirming the server is working correctly.

Or also can use curl:


C:\Users\you>curl c7.xcvvc.com
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

C:\Users\you>