How to add the myguard APT repository to Debian and Ubuntu
Add the myguard APT repository, deb.myguard.nl, to a Debian or Ubuntu server to install NGINX, Angie, Postfix, Dovecot and other packages with apt. You get newer builds without compiling them. For the package and release coverage, start with the repository overview.
Use the manual setup if you want to see exactly what changes. It limits trust in the signing key to this repository. The bootstrap method below does the setup for you, but it installs the key where APT can trust it for other sources too.
An APT repository serves .deb files and the metadata that describes them. APT verifies the signature on the repository metadata and checks downloaded packages against the recorded hashes. After setup, use apt update and apt install as you would for the distribution’s own packages.
Manual setup (recommended)
Five short steps: install the tools, save the signing key in its own keyring, register the source with signed-by, refresh APT and install your first package. Step 1 runs as root, as on a fresh server; the later steps use sudo, which you can drop when you are already root.
Step 1: install the prerequisites
You need curl to download the signing key, ca-certificates so HTTPS is trusted, and lsb-release to detect your distribution codename automatically. Most systems already have these.
apt-get update
apt-get -y install lsb-release ca-certificates curl
Step 2: install the repository keyring
Create a dedicated keyrings directory and save the signing key in its own file there. The signed-by option in the next step ties this key to this one repository, so APT never uses it to accept packages from anywhere else on your system. The key is published in binary form, so you can save it as it is; no gpg --dearmor step is needed.
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://deb.myguard.nl/deb.myguard.nl.gpg \
| sudo tee /etc/apt/keyrings/deb.myguard.nl.gpg >/dev/null
Step 3: add the repository source
Add the repository to your system, using the keyring created in the previous step. The codename of your release (e.g. bookworm or noble) is detected automatically, so this command is the same for all supported releases. It points to the full per-distribution tree under /apt/dists/, which contains all packages built for your release. (If you only want one package, see the repository layout below.)
CODENAME=$(lsb_release -cs)
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/deb.myguard.nl.gpg] https://deb.myguard.nl/apt/dists/$CODENAME $CODENAME main" \
| sudo tee /etc/apt/sources.list.d/deb.myguard.nl.list
Read from left to right, the line says: this is a binary package source (deb), use it for amd64 packages and accept only what the myguard key signed. Then come the repository URL, the suite named after your release and its main component. On an arm64 server, change arch=amd64 to arch=arm64. The file lives in /etc/apt/sources.list.d/, so deleting it later removes the repository cleanly.

Step 4: update the package index
Refresh APT to read the new repository. If the signature check passes, you are ready to install. If you get a NO_PUBKEY or signature error, repeat step 2.
sudo apt-get update
Step 5: install any package
Install NGINX, Angie or anything else from the repository with apt-get install. Note that the Rspamd package here is called rspamd-git and replaces the distribution’s rspamd. Installing plain rspamd would install the distribution’s older version.
# Web server with HTTP/3
sudo apt-get install nginx
# NGINX alternative with built-in ACME/Let's Encrypt
sudo apt-get install angie
# Mail stack
sudo apt-get install postfix dovecot-core rspamd-git
# WAF for NGINX
sudo apt-get install libnginx-mod-http-modsecurity libmodsecurity3 modsecurity-crs
The package list contains everything else in the repository, including mail servers, database servers, and PHP hardening.
Verify the signing key (recommended)
Before trusting any third-party repository, make sure the key fingerprint matches the published one. Run:
gpg --no-default-keyring --keyring /etc/apt/keyrings/deb.myguard.nl.gpg --fingerprint
The fingerprint must be exactly:
D18B 8E5A DF7D 55CE 2A00 D581 67F9 C3D8 456D 7F62
Thijs Eilander <eilander@myguard.nl>
It is an RSA 4096-bit key, valid until 27 May 2028. If the output does not match this fingerprint character for character, stop: do not run apt update, and download the key again from https://deb.myguard.nl/deb.myguard.nl.gpg over a trusted connection.
Repository layout: pick what you pull in
The repository is published in three layouts so you can pull in everything or just one package. The signing key and codename are the same for all three; only the URL in your source line changes. Pick one, or combine them:
| Layout | URL pattern | What you get |
|---|---|---|
| Full per-distribution (recommended) | /apt/dists/<codename> | Everything built for your release in one source line. This is what the setup above uses. |
| Single package | /apt/<package>/<codename> | Just one package plus its dependencies, nothing else. Useful if you only want, say, the NGINX build and don’t want the rest in your apt index. |
| Legacy mixed (being retired) | / <codename> (site root) | The old flat layout where every release shared one tree. Still live so existing setups keep working; please move to one of the layouts above when convenient. |
The <package> trees currently published are nginx, angie, postfix, dovecot, rspamd, mariadb and openssh.
See all the options: browse the live repository at deb.myguard.nl/apt to see every full-distribution and per-package tree, and copy the exact URL for your source line.
Curious why the repository is split up this way, and how it works underneath? The deb.myguard.nl repository layout guide tells the whole story.
Add a single package only
Want just one package, for example NGINX, without adding the whole distribution tree? Point the source line at that package’s own tree under /apt/<package>/<codename>. The keyring from the steps above is reused unchanged; only the path differs.
CODENAME=$(lsb_release -cs)
# Example: only our NGINX (and its dependencies)
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/deb.myguard.nl.gpg] https://deb.myguard.nl/apt/nginx/$CODENAME $CODENAME main" \
| sudo tee /etc/apt/sources.list.d/deb.myguard.nl-nginx.list
sudo apt-get update
sudo apt-get install nginx
Swap nginx for any published tree name to add only that one. You can add several single-package source lines side by side; give each its own file in /etc/apt/sources.list.d/ (for example deb.myguard.nl-postfix.list) so they are easy to manage and remove later. The mariadb and openssh trees currently exist for trixie, forky and resolute only.
Supported distributions
The repository publishes one suite per release codename: Debian 11, 12, 13 and the Debian 14 testing branch, and Ubuntu 22.04, 24.04 and 26.04. Each suite has amd64 and arm64 builds. Use the codename of your release (the manual setup above detects it for you with lsb_release -cs):
- Debian: 11 (
bullseye), 12 (bookworm), 13 (trixie), 14 (forky, testing) - Ubuntu: 22.04 (
jammy), 24.04 (noble), 26.04 (resolute)
The component is main; the published architectures are amd64, arm64 and all (architecture-independent packages). Ubuntu 20.04 focal is no longer built.
Not every package is built for every release and architecture (checked against the package indexes in November 2026). Debian 11 on arm64 has no NGINX or Angie, and on amd64 it carries an older NGINX and Angie with fewer modules. On arm64, Postfix and Dovecot are missing for Debian 11 and 12 and Ubuntu 22.04 and 24.04, and Dovecot also for Debian 14. If a myguard build is missing, apt may select the distribution’s package instead. Run apt-cache policy <package> to check the candidate and where it comes from.
APT pinning (optional)
Pinning makes packages from this repository take precedence over the versions in the default Debian or Ubuntu archive (important if the package is present in both). The configuration below matches the repository by its Origin field (deb.myguard.nl). It raises the priority of this repository only and leaves the distribution’s own repositories (including security updates) at their default priority:
sudo tee /etc/apt/preferences.d/99-deb-myguard-nl >/dev/null <<EOF
Package: *
Pin: release o=deb.myguard.nl
Pin-Priority: 501
EOF
A priority of 501 beats the default archive (500) without downgrading anything already installed, and holds still apply. Check the result with apt-cache policy nginx. Remove the file to undo pinning. Skip this section if you only want the occasional package and prefer your distribution’s versions everywhere else.
The lazy way: the myguard.deb bootstrap
Short on time? The myguard.deb bootstrap package writes the source line, installs the key and sets up pinning in one go. Use this if you trust the project and want it working now.
# Prerequisites (HTTPS download + codename detection)
apt-get update
apt-get -y install lsb-release ca-certificates curl
# Fetch and install the bootstrap package
curl -fsSLO https://deb.myguard.nl/myguard.deb
sudo dpkg -i myguard.deb
sudo apt-get update
That’s it; you can install packages straight away. The result is not quite the same as the manual setup above, so it is worth knowing what the package does:
- It writes
/etc/apt/sources.list.d/deb.myguard.nl.listfor your codename, pointing at the port8888host over plain HTTP (see the backup mirror below), without anarch=restriction. - It ships the key as
/etc/apt/trusted.gpg.d/deb.myguard.nl.gpg. Note that APT will trust keys in that directory for any source, so the key is not limited to this repository as it is with the manual method. - It ships
/etc/apt/preferences.d/99myguard, which pins the origin deb.myguard.nl at priority901, a stronger preference than the 501 pin above. - It removes source and key files left over from the old deb.paranoid.nl and Launchpad repositories.
To undo it, run sudo apt remove myguard: that deletes the source, the key and the pin, while packages you already installed stay on the system. If you want to audit the package first, it is a normal .deb: inspect it with dpkg-deb -e myguard.deb and read the maintainer scripts before installing.
What to install next
- Web server: NGINX mainline (100+ dynamic modules) or Angie (native ACME support, no need for Certbot)
- Lean NGINX: nginx-minimal build: same build minus 12 rarely used modules for a smaller attack surface
- WAF:
sudo apt-get install libnginx-mod-http-modsecurity libmodsecurity3 modsecurity-crs - Mail stack:
sudo apt-get install postfix dovecot-core rspamd-git - Docker images: Daily-rebuilt NGINX & Angie Docker images
Troubleshooting
- Wrong codename / 404 on update: run
lsb_release -csand confirm it matches a codename in the supported list above. Run step 3 again with the correct one. - NO_PUBKEY or signature errors: the keyring is missing or corrupt. Run step 2 again, then check the fingerprint as shown in the verify section.
- Package not found after update: the source line may point at the wrong codename, or the package name differs (Rspamd is
rspamd-git): runapt-cache search <name>. - Distribution version installed instead: enable pinning (see above) so the myguard packages take priority, then check with
apt-cache policy <package>. - arm64 servers: change
arch=amd64toarch=arm64in/etc/apt/sources.list.d/deb.myguard.nl.list, then runsudo apt-get update. - TLS, proxy or firewall problems on the main host: use the backup mirror on port
8888(see below): it serves the same packages over plain HTTP from a separate web server.
Backup mirror on port 8888
If you can’t reach the main HTTPS endpoint, a separate server offers the repository over HTTP on port 8888. APT still verifies the signed repository metadata and checks the package hashes against it. HTTP gives you no transport encryption, so use HTTPS when it works.
Swap the host in your source line for http://deb.myguard.nl:8888 (the same /apt/dists/<codename> path applies):
CODENAME=$(lsb_release -cs)
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/deb.myguard.nl.gpg] http://deb.myguard.nl:8888/apt/dists/$CODENAME $CODENAME main" \
| sudo tee /etc/apt/sources.list.d/deb.myguard.nl.list
sudo apt-get update
The signing key, codenames, components and package set are the same; only the host and port differ. Switch back to https://deb.myguard.nl once the main endpoint is healthy again.
Still stuck? Report problems at github.com/myguard-labs/deb.myguard.nl.
Related guides
- deb.myguard.nl repository layout: why the repo is split into per-distribution and per-package trees and how it works
- NGINX modules overview: dynamic modules available through APT
- Angie modules overview: native ACME, HTTP/3 and all modules
- Angie web server guide: ACME, monitoring and moving from NGINX
- nginx TLS configuration: get A+ on SSL Labs