Share your love
Check Nginx Version Installed on Linux Terminal – 3 Easy Steps
This tutorial intends to show you how you can Find and Check Nginx Version Installed on Linux Terminal Command Line. 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.
Table of Contents
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 Check Nginx Version Installed on Linux Terminal.
Step 1 – Get the Nginx Version Installed From the Linux Command Line
As you may know, you can use the -v or -V to get your Check Nginx Version Installed on Linux Terminal. 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 Check Nginx Version Installed on Linux Terminal. For example:
/usr/sbin/nginx -v
Example Output
nginx version: nginx/1.18.0 (Ubuntu)
Step 3 – Use the apt-cache Command to Find the 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 the Nginx status in the 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 Nginx Version Installed on Linux 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.