Upgrading Nginx from version 1.18 to 1.25 (Ubuntu 20.04)

Tofunmi Samuel
2 min readJan 26, 2024

Introduction

This article delves into the step-by-step process of upgrading Nginx from version 1.18 to 1.25 on an Ubuntu 20.04 server, highlighting the intricacies and considerations involved in such a task.

The Challenge

Nginx, a popular web server known for its performance and flexibility, often releases updates that introduce new features, security patches, and performance improvements. For a system administrator, keeping Nginx up-to-date is essential. However, this task can be challenging, especially when the required version is not available in the standard Ubuntu repositories. This was the case with Nginx 1.25, which at the time of the upgrade was only available in the mainline repository.

Upgrading Nginx from version 1.18 to 1.25 on an Ubuntu 20.04 server involves several steps. You need to add the Nginx mainline repository to your system, update the package list, and then perform the upgrade. Here’s a step-by-step guide:

Step 1: Backup Configuration Files: Before making any changes, it’s always a good practice to backup existing configuration files. You can do this by copying the /etc/nginx directory.

sudo cp -r /etc/nginx /etc/nginx-backup

Step 2: Add Nginx Mainline Repository: Since Nginx 1.25 is available in the mainline repository, you need to add this repository to your system.

--

--

Tofunmi Samuel

I lose touch of time when I am engaged with — technology, stoicism, sustainability, and future living. Reach out https://cal.com/tofunmi/would-love-to-meet-you