Installation from packages
Prebuilt packages for amd64 and arm64 are published to Cloudsmith, each built and tested against the exact nginx package it is for. Add the repository, then install the package that matches your nginx:
| Your nginx | Repository | Package | Enabled on install |
|---|---|---|---|
| nginx.org stable | ngx_mzstd | nginx-module-mzstd | no |
| nginx.org mainline | ngx_mzstd-mainline | nginx-module-mzstd | no |
| Debian’s or Ubuntu’s own | ngx_mzstd | libnginx-mod-http-mzstd | yes |
| RHEL-compatible or Fedora’s own | ngx_mzstd | nginx-mod-mzstd | yes |
Packages for nginx.org’s nginx are built for every distribution release that nginx.org currently packages (Debian, Ubuntu, RHEL 8 to 10 and compatible, Amazon Linux 2023). Packages for the distributions’ own nginx are built for Debian, Ubuntu, RHEL-compatible (the default AppStream nginx) and the current Fedora releases, where that nginx is 1.25.4 or newer, the oldest version the module builds against: today Debian 13, Ubuntu 26.04, RHEL 10 and Fedora.
Packages are built for NGINX only. For freenginx, Angie or any other build, build the module from source: both forks are tested in CI.
Add the repository
On Debian or Ubuntu:
curl -1sLf 'https://dl.cloudsmith.io/public/m-compressors/ngx_mzstd/setup.deb.sh' | sudo -E bash
On RHEL, CentOS, AlmaLinux, Rocky Linux, Amazon Linux or Fedora:
curl -1sLf 'https://dl.cloudsmith.io/public/m-compressors/ngx_mzstd/setup.rpm.sh' | sudo -E bash
For nginx.org mainline, add ngx_mzstd-mainline instead:
curl -1sLf 'https://dl.cloudsmith.io/public/m-compressors/ngx_mzstd-mainline/setup.deb.sh' | sudo -E bash
curl -1sLf 'https://dl.cloudsmith.io/public/m-compressors/ngx_mzstd-mainline/setup.rpm.sh' | sudo -E bash
With nginx.org’s nginx
sudo apt-get install nginx-module-mzstd # Debian, Ubuntu
sudo dnf install nginx-module-mzstd # RHEL-compatible, Fedora
Like nginx.org’s own nginx-module-* packages, it installs the module without
enabling it. Add this line to the top of /etc/nginx/nginx.conf and reload
nginx:
load_module modules/ngx_mzstd.so;
The package requires the exact nginx package it was built for, so upgrade both
together. Its version is <nginx version>+<module version>, as with nginx.org’s
module packages.
With the distribution’s nginx
sudo apt-get install libnginx-mod-http-mzstd # Debian, Ubuntu
sudo dnf install nginx-mod-mzstd # RHEL-compatible, Fedora
As with the distribution’s own module packages, the module is enabled on
installation: by /etc/nginx/modules-enabled/50-mod-http-mzstd.conf on Debian
and Ubuntu, and /usr/share/nginx/modules/mod-mzstd.conf on RHEL and Fedora.
Configure zstd and reload nginx.
Conflicts
The packages conflict with those of tokers/zstd-nginx-module
(nginx-module-zstd, and the distribution’s own where it has one), which
provide the same directives. Remove those first; the configuration itself can
stay as it is (see Migrating).
The packages are built and published by the Publish workflow; see Development and releases.
Package repository hosting is graciously provided by Cloudsmith.