Server Setup

Ubuntu: the better NGINX instructions

by , , revisited on


We have by far the largest RPM repository with NGINX module packages and VMODs for Varnish. If you want to install NGINX, Varnish, and lots of useful performance/security software with smooth yum upgrades for production use, this is the repository for you.
Active subscription is required.

The Easy Way: Installing Custom NGINX Modules on Ubuntu and Debian

In the past, if you wanted to run NGINX with specific third-party modules on Ubuntu or Debian—like the rtmp module for streaming or lua for advanced scripting—you were often stuck building everything from source.

Online, you can find guides detailing the complex process of installing build dependencies, downloading sources, patching code, and manually compiling deb packages. It worked, but it was time-consuming, hard to maintain, and left you responsible for your own security updates.

Those days are over.

You can now get the same high-performance NGINX modules for Ubuntu and Debian directly from our official APT repository. No more compiling, no more make install, and no more headaches.

1. Setup the Repository

First, you need to trust our signing key and add the repository to your system. This ensures all packages are verified and secure.

# Install prerequisites
sudo apt update
sudo apt install -y curl gnupg lsb-release

# 1. Download and install the official GPG key
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://extras.getpagespeed.com/getpagespeed-extras.gpg | sudo tee /etc/apt/keyrings/getpagespeed.gpg > /dev/null

# 2. Add the repository source
# This command automatically detects your OS codename (e.g., "jammy", "noble", "bookworm")
echo "deb [signed-by=/etc/apt/keyrings/getpagespeed.gpg] https://extras.getpagespeed.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/getpagespeed-extras.list

# 3. Update your package list
sudo apt update

2. Install NGINX and Modules

The repository supports both NGINX Stable and NGINX Mainline.

  • Stable is the default (e.g., suite jammy).
  • Mainline offers the absolute latest features (e.g., suite jammy-mainline). To use it, simply edit the source file created above and append -mainline to your distribution codename.

Now, you can simply apt install the modules you need. For example:

sudo apt install nginx-module-rtmp nginx-module-ts nginx-module-echo nginx-module-lua nginx-module-headers-more

That’s it! This command installs the base nginx package along with the specific dynamic modules requested. NGINX will be automatically configured to load these modules.

3. Why This is Better

  • Automatic Updates: When a new NGINX version is released or a security patch is available, you just run apt upgrade. We handle the rebuilding.
  • Dependency Management: We ensure that modules like lua-nginx-module are built against the correct version of LuaJIT and NGINX, so you don’t face cryptic linker errors.
  • Broad Support: We support all active LTS releases of Ubuntu (20.04, 22.04, 24.04) and Debian (12, 13).
  • Huge Selection: Beyond just RTMP and Lua, we host over 50+ dynamic modules, including Brotli, ModSecurity, PageSpeed, and more.

Stop compiling and start building great applications. Check out the full list of available modules today.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.