Apache

NGINX One-Line Installer: Get nginx.org Security Fixes Faster

A new script sets up the official nginx.org repository on common Linux distributions so NGINX security fixes arrive on release…

3 December 2026  ·  5 min read  ·  Anand

NGINX One-Line Installer: Get nginx.org Security Fixes Faster

When a security flaw in NGINX is announced, nginx.org publishes fixed packages the same day. Distribution packages can take days or even months to follow. The NGINX team has now released a one-line installer script that points a server at the official nginx.org repository, so it gets those fixes straight away. It handles signing keys, repository setup and module packages for the common server distributions. The script is still in development and not officially supported, so try it on a non-production machine first. For anyone who runs public-facing web servers, it is well worth a look.

What the script does

  • Detects your distribution, version and CPU architecture.
  • Adds the nginx.org repository and installs NGINX, using the mainline branch unless you ask for stable.
  • Pins the fingerprints of nginx.org’s signing keys and stops if a downloaded key does not match.
  • On apt and dnf systems, limits the new repository to packages whose names start with nginx, so it cannot replace other software.
  • Shows its plan and waits 10 seconds before making changes, so you can cancel with Ctrl+C.
  • Only starts working once the whole script has downloaded, so a broken download does nothing.
  • Confirms afterwards that NGINX came from nginx.org and runs nginx -t.

Supported systems

The script supports x86_64 and aarch64 and works with apt, dnf, microdnf, zypper and apk. It even runs on minimal images such as UBI minimal.

Family Versions
RHEL, CentOS Stream, Rocky Linux, AlmaLinux, Oracle Linux 8, 9, 10
Debian 12, 13
Ubuntu 22.04, 24.04, 26.04
SLES 15 SP7 or later (x86_64 only), 16
openSUSE Leap 16
Alpine 3.22, 3.23, 3.24
Amazon Linux 2023

Running it

Run it as root, or as a normal user who has sudo or doas. Pipe it into sh, not sudo sh, because the script asks for elevated rights itself when it needs them. Start with a dry run, which prints the plan without changing anything:

curl --proto '=https' --tlsv1.2 -fsSL https://raw.githubusercontent.com/nginx/nginx-demos/main/nginx/get-nginx-org/nginx.sh | sh -s -- --dry-run

The default install uses the mainline branch. Add --stable for the stable branch, and add --module once for each dynamic module you need. The available modules are acme, geoip, image-filter, njs, otel, perl and xslt:

curl --proto '=https' --tlsv1.2 -fsSL https://raw.githubusercontent.com/nginx/nginx-demos/main/nginx/get-nginx-org/nginx.sh | sh -s -- --stable --module njs

On production servers, read the script before you run it. In automation such as a Dockerfile or CI job, store a reviewed copy, check its SHA-256 hash, and pass --yes to skip the 10-second pause:

curl --proto '=https' --tlsv1.2 -fsSL -o install-nginx.sh https://raw.githubusercontent.com/nginx/nginx-demos/main/nginx/get-nginx-org/nginx.sh
less install-nginx.sh
sha256sum install-nginx.sh
sh install-nginx.sh --yes

--help explains how to remove the repository and signing keys again if you change your mind.

Before you run it on an existing server

The script replaces your distribution’s NGINX package, so prepare first:

  • Back up the configuration, for example sudo cp -a /etc/nginx /etc/nginx.bak-nginx-org-switch.
  • RHEL 9, RHEL 10, their rebuilds and Amazon Linux 2023: you must remove the distribution’s NGINX package first. If it is still installed, the script stops and prints the removal command.
  • Distribution module packages, such as Ubuntu’s libnginx-mod-*, may need to be removed and replaced with the nginx.org modules.
  • Site directories differ between distributions. The script tells you whether your existing sites will still load, and if they will not, it gives you the include line to add.
  • Branch choice: decide on purpose between mainline (the default) and stable. Do not end up on mainline just because it is the default.

On Kubernetes, if you use NGINX Ingress Controller or NGINX Gateway Fabric, you do not need this script, because those projects ship their own images.

Make sure the updates actually arrive

After the switch, normal system updates install new NGINX releases. The catch is security-only automatic updates. nginx.org publishes no security advisory metadata, so tools that install only security updates will skip NGINX:

  • Debian and Ubuntu: the script adds nginx.org to the unattended-upgrades list, but a security-only configuration still will not pick NGINX up.
  • RHEL family: dnf upgrade --security skips NGINX, and so does dnf-automatic with upgrade_type = security. Set upgrade_type = default in /etc/dnf/automatic.conf if you want automatic updates to include it.
  • SLES: zypper patch skips NGINX. Use zypper update instead.

Check the result from the server itself: run nginx -v to see the running version, then reload with sudo systemctl reload nginx after each upgrade. On Debian and Ubuntu, apt-cache policy nginx shows which repository the installed package came from.

How TechProvidence can help

We look after NGINX, Apache and cPanel/WHM web servers for businesses of all sizes. That includes moving to vendor repositories safely, tuning automatic updates so security fixes actually get installed, and checking every site after a change. If you want your web servers patched the day a fix ships without the risk of breaking things, contact us.

Source: NGINX Community Blog

Running into something similar?

We look after Linux servers, control panels and virtualization for businesses every day. If an update, vulnerability or outage here affects you, we can help.