ngx_pagespeed

Install ngx_pagespeed on Ubuntu

Install the maintained PageSpeed module for nginx on Ubuntu from a signed repository. The module is free to install and evaluate; a license is required for production optimization.

Install from the signed repository

Add the We-Amp signed apt repository, then install the module with apt. The bootstrap script detects Ubuntu and writes the source configuration; the packages are signed with the We-Amp repository key. Supported: Ubuntu 24.04 LTS (noble) and 22.04 LTS (jammy) on amd64 and arm64.

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

# Install the nginx module
sudo apt install nginx-module-pagespeed

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.

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.

Other Ubuntu releases

The signed packages cover Ubuntu 24.04 LTS (noble) and 22.04 LTS (jammy) on amd64 and arm64. On an older or newer release, build the module from source against your nginx — the walkthrough covers it.

Build ngx_pagespeed from source

1.1 nginx or 2.0 nginx?

Two maintained engines exist for nginx. mod_pagespeed 1.1 keeps the existing pagespeed_* directives, so current configs carry over. ModPageSpeed 2.0 is a new architecture (mmap serving, variant-aware caching, AVIF) for fresh installs.

Compare mod_pagespeed 1.1 vs 2.0 for nginx

Licensing

The module is free to install and evaluate — it fully optimizes and adds an X-PageSpeed-Warn: unlicensed header until a license is applied. A commercial license is required for production use; your site keeps serving either way.