Skip to content

APT Repository Setup

The GetPageSpeed Extras APT repository hosts nginx-module-* packages for supported Debian and Ubuntu releases.

A single .deb lays down the keyring, the deb822 sources file with all three channels, and a getpagespeed-extras-channel helper to switch between them.

curl -fsSL https://extras.getpagespeed.com/release-latest.deb \
  -o /tmp/getpagespeed-extras-release.deb
sudo apt-get install -y /tmp/getpagespeed-extras-release.deb

The package writes /etc/apt/sources.list.d/getpagespeed-extras.sources with three deb822 stanzas: stable (Enabled: yes), <codename>-mainline (Enabled: no), and <codename>-nginx-mod (Enabled: no). Stable is always on; flip the other two with the helper:

sudo getpagespeed-extras-channel stable      # only stable
sudo getpagespeed-extras-channel mainline    # stable + mainline
sudo getpagespeed-extras-channel nginx-mod   # stable + nginx-mod (+ APT pin)

Pick the channel you want, then update and install:

sudo apt-get update
sudo apt-get install nginx-module-brotli

Tip

getpagespeed-extras-channel nginx-mod also installs the recommended APT pin at /etc/apt/preferences.d/getpagespeed-nginx.pref. If you run stable or mainline and have another nginx source on the system (e.g. the ondrej PPA or nginx.org), see the Pin GetPageSpeed nginx packages section below.

Channel reference

Channel Suites enabled When to use
stable <codename> Production-grade NGINX stable + dynamic modules.
mainline <codename> + <codename>-mainline Latest NGINX mainline (and matching modules).
nginx-mod <codename> + <codename>-nginx-mod GetPageSpeed-patched stable nginx (upstream_check, upstream_api, extended limit_req_rate units).

nginx-mod is ABI-compatible with the stable nginx package, so any nginx-module-* package from the matching stable suite loads against it without rebuild. Installing nginx-mod swaps out any existing nginx package (it declares Conflicts: nginx). Supported codenames at launch: jammy, noble, bookworm.

Migrating from other nginx repositories

If you already have nginx installed from the ondrej PPA, nginx.org, or stock Debian/Ubuntu packages:

  1. Run the Quick install above. Pick the channel you want (mainline for the latest, nginx-mod for the patched stable, stable for plain stable).
  2. The helper auto-installs the APT pin for nginx-mod. For stable or mainline, set the pin yourself — see Pin GetPageSpeed nginx packages.
  3. Update and replace nginx in one command:

    sudo apt-get update
    sudo apt-get install nginx nginx-module-geoip2
    

    APT will automatically replace conflicting packages (nginx-core, nginx-common, nginx-full, nginx-extras, nginx-light) with GetPageSpeed's transitional packages that depend on the unified nginx package.

  4. Verify the active source:

    apt-cache policy nginx
    

    The output should show extras.getpagespeed.com with priority 1001.


Manual setup (advanced)

If you'd rather configure the keyring and source list yourself — for example to inspect every step, drop a custom-shaped source file, or avoid running a third-party .deb — follow the manual flow below. It produces the same end state, minus the getpagespeed-extras-channel helper.

Install the APT keyring

Download the repository keyring and place it under /etc/apt/keyrings:

sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://extras.getpagespeed.com/deb-archive-keyring.gpg \
  | sudo tee /etc/apt/keyrings/getpagespeed.gpg >/dev/null

Add the APT source

You can either use the interactive helper below or copy one of the static examples.

Interactive generator

Select your distribution, codename, and NGINX branch to generate both the sources.list entry and a ready-to-run shell command:

sources.list contents:

Shell command to create file:

Alternative: auto-detect distro and codename

If you prefer a single universal command that works on any supported Debian or Ubuntu system, you can use lsb_release to detect the distribution and codename automatically.

For the stable branch:

distro=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
codename=$(lsb_release -cs)
echo "deb [signed-by=/etc/apt/keyrings/getpagespeed.gpg] https://extras.getpagespeed.com/${distro} ${codename} main" \
  | sudo tee /etc/apt/sources.list.d/getpagespeed-extras.list

For the mainline branch:

echo "deb [signed-by=/etc/apt/keyrings/getpagespeed.gpg] https://extras.getpagespeed.com/${distro} ${codename}-mainline main" \
  | sudo tee -a /etc/apt/sources.list.d/getpagespeed-extras.list

For the nginx-mod branch, enable both the nginx-mod suite and the matching stable suite so dynamic nginx-module-* packages remain installable alongside the patched nginx:

sudo tee /etc/apt/sources.list.d/getpagespeed-extras.list <<EOF
deb [signed-by=/etc/apt/keyrings/getpagespeed.gpg] https://extras.getpagespeed.com/${distro} ${codename}-nginx-mod main
deb [signed-by=/etc/apt/keyrings/getpagespeed.gpg] https://extras.getpagespeed.com/${distro} ${codename} main
EOF

Pin GetPageSpeed nginx packages

If you have (or may later add) another nginx source such as the ondrej/nginx PPA or nginx.org packages, create an APT preferences file so that GetPageSpeed packages always take priority:

sudo tee /etc/apt/preferences.d/getpagespeed-nginx.pref > /dev/null <<'EOF'
Package: nginx nginx-mod nginx-common nginx-core nginx-full nginx-extras nginx-light nginx-module-* libnginx-mod-*
Pin: origin extras.getpagespeed.com
Pin-Priority: 1001
EOF

Priority 1001 tells APT to prefer these packages even if it means downgrading or replacing versions from other repositories. The pin is scoped to nginx-related packages only — no other system packages are affected.

Tip

This step is recommended for all installations and required if any other nginx repository is configured on the system.

After adding the source and pin, run sudo apt-get update, then sudo apt-get install nginx-module-<name>.