APT Repository Setup
The GetPageSpeed Extras APT repository hosts nginx-module-* packages for
supported Debian and Ubuntu releases.
1. 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
2. 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
After adding the repository, run:
sudo apt-get update
You can then install modules such as:
sudo apt-get install nginx-module-brotli