How to check Nginx version on Linux

In this tutorial, we will show how to checck the installed version of Nginx on a Linux system. Nginx is one of the most popular web server suites deployed across the internet and can be used as both a web server and a reverse proxy server. Knowing your version of Nginx will allow you to check for updates and install new features, compatibility with other Linux or web hosting components, and with ensuring that your current version of Nginx does not contain any published security vulnerabilities.

In this tutorial you will learn:

  • How to check installed Nginx version on Linux
How to check Nginx version on Linux
How to check Nginx version on Linux
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Any Linux distro
Software Nginx web server / reverse proxy
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

How to check Nginx version on Linux




We can use the nginx command to check the installed version of Nginx, or use the system’s package manager if you used it to install Nginx originally. Check the examples below to see how.

Various ways of checking the installed Nginx version on a Linux system
Various ways of checking the installed Nginx version on a Linux system

With nginx command

There are two handy options that we can use with the nginx command to check the installed version:

  1. The -v option will show the installed version and nothing more:
    $ nginx -v
    nginx version: nginx/1.18.0 (Ubuntu)
    
  2. The -V (uppercase this time) option will show the installed Nginx version as well as information about your specific build of Nginx, like what arguments were used to configure it:
    $ nginx -V
    nginx version: nginx/1.18.0 (Ubuntu)
    built with OpenSSL 3.0.2 15 Mar 2022
    TLS SNI support enabled
    configure arguments:
    ...
    
DID YOU KNOW?
To stay on top of critical updates and security patches, it is recommended that you always keep Nginx up to date with your Linux system’s package manager. If you run the commands above and find that you are running an older version of Nginx, be sure to update it right away and then check to see if your website is still operating as expected. Also be sure to keep your other web hosting components up to date, like PHP, MySQL, etc.

Now that you know your installed version of Nginx, you may also be interested in checking the status of Nginx.

With package manager

If you installed Nginx via your system’s package manager, then you can use it as another option to check the currently installed version of Nginx. Here is how to do it on a variety of different Linux distros that use different package managers.

  1. To check the Nginx version on Debian-based systems such as Debian Linux, Ubuntu Linux, Linux Mint, Kali Linux, etc:
    $ apt info nginx
    
  2. To check the Nginx version on RHEL-based systems such as Red Hat Enterprise Linux, CentOS Linux, Fedora Linux, AlmaLinux, and Rocky Linux, etc:


    $ dnf info nginx
    
  3. To check the Nginx version on OpenSUSE Linux:
    $ zypper info nginx
    
  4. To check the Nginx version on Arch-based systems such as Arch Linux and Manjaro Linux, etc:
    $ pacman -Q --info nginx
    

Closing Thoughts

In this tutorial, we saw how to check the installed version of Nginx on a Linux system. Part of web server administration for a Linux professional or website owner is to stay on top of new updates that are needed for your hosting components. Knowing the currently installed version of Nginx will allow you to see if it matches with the latest version available, and what list of features your version currently has available.



Comments and Discussions
Linux Forum