Check Nginx Version Installed on Linux Terminal

This tutorial intends to show you how you can find and check the Nginx Web Server Version Installed on your Linux distro from the Command line Terminal. Nginx is a great web server that is used for load balancing, caching, proxy, etc. It is a great alternative to Apache. If you want to check your Nginx version from the command line, follow the steps below.

Quick Guide To Check Nginx Version Installed on Linux Terminal

You can use this guide for most Linux distributions based on RHEL and Debian such as Ubuntu 22.04, AlmaLinux 9, Debian 12, etc.

Now follow the steps below to complete this guide.

Step 1 – Get Nginx Version Installed From Linux Command Line

As you may know, you can use the -v or -V to get your Nginx version on your Linux distro. The command is like the following:

nginx -v
Example Output
nginx version: nginx/1.18.0 (Ubuntu)

Or you can use the -V:

nginx -V
Example Output
nginx version: nginx/1.18.0 (Ubuntu)
built with OpenSSL 3.0.2 15 Mar 2022
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -ffile-prefix-map=/build/nginx-zctdR4/nginx-1.18.0=. ...

As you can see, when you use capital V to get your Nginx version, it will show more information including compiler and configuration parameters.

Step 2 – Nginx -v Command Not Found on Linux Terminal

If you run the Nginx version command, you may get the command not found error. Here we show you can find your Nginx version if this happens.

First, you need to find your Nginx path by using one of the following commands:

# whereis nginx
# which nginx
# echo "$PATH"
Example Output
/usr/sbin/nginx

When you find your Nginx full path, use it to get your version. For example:

/usr/sbin/nginx -v
Example Output
nginx version: nginx/1.18.0 (Ubuntu)

Step 3 – Use apt-cache Command to Find Nginx Version on Debian and Ubuntu

At this point, if you are a Debian and Ubuntu user, you can use another command to check your Nginx version. To do this, run the command below:

apt-cache policy nginx
Example Output
nginx:
  Installed: 1.18.0-6ubuntu14.4
  Candidate: 1.18.0-6ubuntu14.4
  Version table:
 *** 1.18.0-6ubuntu14.4 500
        500 http://de.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1.18.0-6ubuntu14.3 500
        500 http://de.archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages
     1.18.0-6ubuntu14 500
        500 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

Step 4 – How do I Check Nginx status in Linux Terminal?

When you install Nginx on your Linux distro, you can find that your service is up and running on your server by using the command below:

systemctl status nginx
Example Output
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:>
     Active: active (running) since Wed 2023-10-25 08:43:44 UTC; 12min ago
       Docs: man:nginx(8)
    Process: 101990 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_pro>
    Process: 101991 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; >
   Main PID: 102085 (nginx)
      Tasks: 3 (limit: 4575)
     Memory: 4.2M
        CPU: 53ms
     CGroup: /system.slice/nginx.service
...

Step 5 – What is the latest Nginx version?

At the current time, the latest version of the Nginx web server is 1.25 which was released on 23 May 2023.

Conclusion

At this point, you have learned to find and check the Nginx Web Server Version Installed on your Linux distro from the Command line Terminal. Also, you have learned to find the Nginx version if you get the Nginx -v command not found error.

Hope you enjoy it. To get Nginx installation and configuration guides, you can visit the Nginx Webserver Tutorials.

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!