Rspamd Packages
Rspamd provides official packages for various platforms. This page covers package installation, package types, and building from source.
Package Branches
Rspamd provides three types of packages:
Stable Packages
Stable packages are the official Rspamd releases recommended for production usage. These packages are built from tagged releases and undergo thorough testing before publication.
Experimental Packages
Experimental packages are built from the master branch of the Rspamd repository. They include the latest features and bug fixes but may occasionally contain regressions.
When to use experimental packages:
- You experience a significant issue with stable packages that is fixed in the development branch
- You want to test new features before they are released
- You are running a test environment where you can handle potential instability
- You can use mirroring in Rspamd proxy to test new versions alongside stable
Identifying experimental package versions:
Experimental packages include a git hash in their version. You can view changes between versions using:
git log <old_hash>..<new_hash>
ASAN Packages
ASAN (AddressSanitizer) packages are specially built with AddressSanitizer instrumentation for debugging memory-related issues. These packages:
- Are built with minimal optimizations for accurate debugging
- Include memory error detection (buffer overflows, use-after-free, etc.)
- Are significantly slower than regular packages (not recommended for production)
- Are essential for diagnosing crashes and memory corruption issues
Using ASAN packages:
- Install the ASAN package (
rspamd-asaninstead ofrspamd) - Configure ASAN log output by setting an environment variable:
export ASAN_OPTIONS="log_path=/tmp/rspamd-asan"
Or add to systemd service override (systemctl edit rspamd):
[Service]
Environment="ASAN_OPTIONS=log_path=/tmp/rspamd-asan"
- When a crash occurs, collect both the core file and the ASAN log (
/tmp/rspamd-asan.<pid>) for bug reports
How Packages Are Built
Official Rspamd packages are built using GitHub Actions workflows in the rspamd-packages repository. The build system:
- Builds packages in parallel for all supported distributions
- Tests packages in matching container environments
- Signs all packages with GPG keys
Build Optimizations
Official packages include several optimizations not present in distribution packages:
| Feature | Description |
|---|---|
| Link Time Optimization (LTO) | Enables cross-module optimization for better performance |
| Bundled LuaJIT 2.1 | Built from the upstream LuaJIT v2.1 branch instead of using the distribution's Lua or LuaJIT package |
| jemalloc | Memory allocator optimized for multi-threaded applications (x86_64 packages, except EL 10) |
| Hyperscan | Intel's high-performance regex matching library (x86_64) |
| Vectorscan | Hyperscan fork used in ARM64 packages and in x86_64 packages for EL 10 |
These optimizations may not be available on older platforms due to toolchain limitations.
Debug Symbols
Debug symbol packages are available for crash analysis:
- RPM-based:
rspamd-debuginfo(orrspamd-asan-debuginfo) - DEB-based:
rspamd-dbg(orrspamd-asan-dbg)
These packages can be safely installed in production environments.
Docker
The official Docker image is available at rspamd/rspamd on Docker Hub, with sources on GitHub.
Image Features
- Upstream config files in
/usr/share/rspamd/config, keeping/etc/rspamdfor local configuration only - FastText language identification model included (CC BY-SA 3.0 license)
- Multi-architecture support (amd64, arm64)
Available Tags
| Tag | Description |
|---|---|
latest | Latest stable release |
4, 4.x, 4.x.y | Latest release in a major or minor series, or a specific release |
nightly | Development builds from master branch |
asan-* | ASAN-enabled images for debugging |
Basic Usage
docker run -v rspamd_dbdir:/var/lib/rspamd -v rspamd_confdir:/etc/rspamd -ti rspamd/rspamd
Volume Requirements
/var/lib/rspamd- Required for persistent data (statistics, databases)/etc/rspamd- Optional for configuration overrides
If using bind mounts, ensure /var/lib/rspamd is writable by UID/GID 11333:11333.
Security
The root directory may be set read-only for added security.
Examples
A Docker Compose example is available in the source repository.
For detailed Docker and Kubernetes deployment, see the Installation Guide.
Debian and Ubuntu
Rspamd supports the following Debian-based distributions:
| Distribution | Supported Since |
|---|---|
| Debian trixie | 3.13 |
| Debian bookworm | 3.5 |
| Ubuntu resolute (26.04) | 4.2.2 |
| Ubuntu noble (24.04) | 3.9 |
| Ubuntu jammy (22.04) | 3.3 |
Debian bullseye and Ubuntu focal (20.04) no longer get new packages. The last version published for bullseye is 4.1.5, and focal has been removed from the repository.
Install Stable Packages
# Install prerequisites
sudo apt-get update
sudo apt-get install -y lsb-release wget gpg
# Add GPG key
sudo mkdir -p /etc/apt/keyrings
wget -O- https://rspamd.com/apt-stable/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/rspamd.gpg > /dev/null
# Add repository
CODENAME=$(lsb_release -c -s)
echo "deb [signed-by=/etc/apt/keyrings/rspamd.gpg] http://rspamd.com/apt-stable/ $CODENAME main" | sudo tee /etc/apt/sources.list.d/rspamd.list
echo "deb-src [signed-by=/etc/apt/keyrings/rspamd.gpg] http://rspamd.com/apt-stable/ $CODENAME main" | sudo tee -a /etc/apt/sources.list.d/rspamd.list
# Install
sudo apt-get update
sudo apt-get --no-install-recommends install rspamd
Install Experimental Packages
Replace apt-stable with apt in the repository URL:
# Install prerequisites
sudo apt-get update
sudo apt-get install -y lsb-release wget gpg
# Add GPG key
sudo mkdir -p /etc/apt/keyrings
wget -O- https://rspamd.com/apt-stable/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/rspamd.gpg > /dev/null
# Add experimental repository
CODENAME=$(lsb_release -c -s)
echo "deb [signed-by=/etc/apt/keyrings/rspamd.gpg] http://rspamd.com/apt/ $CODENAME main" | sudo tee /etc/apt/sources.list.d/rspamd.list
echo "deb-src [signed-by=/etc/apt/keyrings/rspamd.gpg] http://rspamd.com/apt/ $CODENAME main" | sudo tee -a /etc/apt/sources.list.d/rspamd.list
# Install
sudo apt-get update
sudo apt-get --no-install-recommends install rspamd
Install ASAN Packages
Install rspamd-asan instead of rspamd (available since version 3.5):
sudo apt-get --no-install-recommends install rspamd-asan
Hyperscan and LuaJIT
Official Debian and Ubuntu packages are built with Hyperscan on amd64, Vectorscan on arm64, and a bundled LuaJIT instead of the distribution's Lua. See Build Optimizations above and the FAQ.
Debian Standard Repository Warning
The Rspamd packages in Debian's standard repositories are not supported by the Rspamd project. They are typically outdated and issues related to those packages will be closed automatically. Always use the official Rspamd repositories.
RHEL and Compatible Distributions
Rspamd provides packages for RHEL-compatible distributions including:
- Red Hat Enterprise Linux (RHEL)
- AlmaLinux
- Rocky Linux
- Oracle Linux
- CentOS Stream
Supported versions: 8, 9, and 10
Prerequisites
These packages require EPEL as many dependencies are not in base repositories:
sudo dnf install epel-release
Install Stable Packages
# Determine EL version and add repository
source /etc/os-release
EL_VERSION=$(echo -n $PLATFORM_ID | sed "s/.*el//")
sudo curl -o /etc/yum.repos.d/rspamd.repo https://rspamd.com/rpm-stable/centos-${EL_VERSION}/rspamd.repo
# Install
sudo dnf install rspamd
Install Experimental Packages
# Determine EL version and add experimental repository
source /etc/os-release
EL_VERSION=$(echo -n $PLATFORM_ID | sed "s/.*el//")
sudo curl -o /etc/yum.repos.d/rspamd.repo https://rspamd.com/rpm/centos-${EL_VERSION}/rspamd-experimental.repo
# Install
sudo dnf install rspamd
Install ASAN Packages
Install rspamd-asan instead of rspamd:
sudo dnf install rspamd-asan
Debug Symbols
For crash debugging, install the debug info package:
sudo dnf install rspamd-debuginfo
# or for ASAN
sudo dnf install rspamd-asan-debuginfo
Other Linux Distributions
Rspamd is available in community repositories for several other distributions. Note that these packages are maintained by distribution maintainers, not the Rspamd project.
Alpine Linux
Available in the community repository:
apk add rspamd
Arch Linux
Available in the extra repository:
pacman -S rspamd
Gentoo Linux
Available in the main Portage repository:
emerge mail-filter/rspamd
openSUSE
Packages for Leap and Tumbleweed are available on OBS.
BSD Systems
FreeBSD
Available from ports or packages:
pkg install rspamd
For experimental packages, use rspamd-devel.
NetBSD
Available via pkgsrc:
cd /usr/pkgsrc/mail/rspamd && make install
OpenBSD
Available from ports:
pkg_add rspamd
macOS
Available via MacPorts:
sudo port install rspamd
sudo port load rspamd
Building from Source
If packages are not available for your platform or you need custom build options, you can build Rspamd from source.
Getting the Source
git clone --recursive https://github.com/rspamd/rspamd.git
cd rspamd
For a specific version:
git clone --recursive -b 4.2.1 https://github.com/rspamd/rspamd.git
Build Requirements
| Dependency | Description | Required |
|---|---|---|
| CMake 3.15+ | Build system | Yes |
| C11 compiler | GCC 8+ or Clang 7+ | Yes |
| C++20 compiler | GCC 10+ or Clang 10+ | Yes |
| OpenSSL | Cryptography library | Yes |
| GLib2 2.28+ | Common utilities library | Yes |
| Ragel | State machine compiler | Yes |
| LuaJIT or Lua 5.1-5.4 | Scripting language | Yes |
| SQLite3 | Embedded database | Yes |
| libicu | Unicode library | Yes |
| PCRE2 | Regular expressions | Yes |
| zlib | Compression library | Yes |
| libsodium 1.0.0+ | Cryptography library | Yes |
| libarchive 3.0+ | Archive extraction | Yes |
| Perl | Generates the Snowball stemmer modules at build time | Yes |
| Hyperscan | High-performance regex (x86_64) | Recommended |
| Vectorscan | Hyperscan for ARM64/PPC64 | Recommended |
| jemalloc | Memory allocator | Recommended |
| Redis | In-memory data store | Recommended |
Basic Build
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DENABLE_LUAJIT=ON
make -j$(nproc)
sudo make install
Recommended Production Build
For production, enable additional optimizations:
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_LUAJIT=ON \
-DENABLE_HYPERSCAN=ON \
-DENABLE_JEMALLOC=ON \
-DENABLE_LTO=ON
make -j$(nproc)
sudo make install
Building with ASAN (for debugging)
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DSANITIZE=address \
-DENABLE_LUAJIT=ON
make -j$(nproc)
Note: ASAN builds automatically disable jemalloc.
Common CMake Options
| Option | Default | Description |
|---|---|---|
ENABLE_LUAJIT | ON | Use LuaJIT instead of Lua |
ENABLE_HYPERSCAN | OFF | Enable Hyperscan regex acceleration |
ENABLE_JEMALLOC | OFF | Use jemalloc memory allocator |
ENABLE_PCRE2 | ON | Use PCRE2 (vs legacy PCRE) |
ENABLE_LTO | ON for Release and RelWithDebInfo | Enable Link Time Optimization |
SANITIZE | — | Enable sanitizers (address, memory, undefined, leak) |
CMAKE_INSTALL_PREFIX | /usr/local | Installation prefix |
Building Packages for Unsupported Systems
For Debian-based systems not officially supported, you can build packages using the in-tree fixtures:
export RSPAMD_VERSION=4.2.1
git clone -b ${RSPAMD_VERSION} https://github.com/rspamd/rspamd.git
cd rspamd
# Update changelog version
sed -i "s/(.*)/($RSPAMD_VERSION)/" debian/changelog
sed -i "s/quilt/native/" debian/source/format
# Install build dependencies
sudo apt install devscripts
mk-build-deps
sudo dpkg -i rspamd-build-deps_*.deb || sudo apt install -f -y
# debian/rules also enables LuaJIT and Hyperscan, which Build-Depends does not list
# (on arm64, install libvectorscan-dev instead of libhyperscan-dev)
sudo apt install libluajit-5.1-dev libhyperscan-dev
# Build package
debuild -us -uc
# Install
sudo dpkg -i ../rspamd_${RSPAMD_VERSION}_*.deb
For RPM-based systems, use the spec file in the rpm/ directory.
Next Steps
After installation:
- Installation Guide — Verify installation and configure services
- First Setup Guide — Integrate with your MTA
- Quick Start Tutorial — Get basic spam filtering working