ngx_pagespeed

Install ngx_pagespeed for nginx

Install the maintained PageSpeed module for nginx from a signed repository, or build it from source. It is open source under the Apache License 2.0 — free to install and run, in development and in production.

Install from the signed repository

Add the We-Amp signed apt/yum repository, then install the module with your distribution's package manager. The packages are signed by a repository We-Amp operates.

# Add the signed repository
curl -fsSL https://packages.modpagespeed.com/install.sh | sudo sh

# Install the nginx module
sudo apt install nginx-module-pagespeed    # Debian/Ubuntu
sudo dnf install nginx-module-pagespeed    # AlmaLinux/RHEL

After installing, load the module, add a minimal pagespeed configuration, and reload nginx. The configuration reference covers the directives you need to get optimization running.

Per-distribution guides

Step-by-step install commands for each supported distribution: Ubuntu, Debian, AlmaLinux, Rocky Linux, RHEL, and Amazon Linux.

Signed packages cover Debian 11, 12, and 13 and Ubuntu 22.04 and 24.04 on amd64 and arm64; AlmaLinux, RHEL, and Rocky Linux 9 on x86_64 and aarch64, and 10 on x86_64.

Verify it is running

Once nginx is reloaded with the module enabled, an optimized response carries the X-Page-Speed header:

curl -sI https://yoursite/ | grep -i x-page-speed

A version string in that header means the worker is optimizing. If the header is absent, check that the module is loaded and pagespeed on; is set — the configuration reference walks through it.

Build from source

The maintained module ships prebuilt, so there's rarely a reason to compile. If you want to build the legacy open-source module yourself — for parity with an existing upstream deployment — the walkthrough covers it.

Build ngx_pagespeed from source

Also running Apache?

The maintained Apache module installs from the same signed repository under the package name mod-pagespeed:

sudo apt install mod-pagespeed    # Debian/Ubuntu
sudo dnf install mod-pagespeed    # AlmaLinux/RHEL

One nginx module

mod_pagespeed 2.1 is the single line We-Amp offers and maintains for nginx. There is one module to install, with the existing pagespeed_* directive surface — the commands on this page install it.

Licensing

mod_pagespeed 2.1 is open source under the Apache License 2.0 — free to install and run, in development and in production, on any number of servers. No license key, no registration.

What We-Amp sells alongside it is support and hardened, attested builds. A subscription changes who answers when you need help; it never changes what the software does, and it is not required to run it. Contact us to talk about one.