Skip to main content

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:

  1. Install the ASAN package (rspamd-asan instead of rspamd)
  2. 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"
  1. 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:

FeatureDescription
Link Time Optimization (LTO)Enables cross-module optimization for better performance
Bundled LuaJIT 2.1Uses LuaJIT 2.1 beta for up to 30% performance improvement over stable LuaJIT
jemallocMemory allocator optimized for multi-threaded applications
HyperscanIntel's high-performance regex matching library (x86_64)
VectorscanHyperscan port for ARM64 and PowerPC platforms

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 (or rspamd-asan-debuginfo)
  • DEB-based: rspamd-dbg (or rspamd-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/rspamd for local configuration only
  • FastText language identification model included (CC BY-SA 3.0 license)
  • Multi-architecture support (amd64, arm64)

Available Tags

TagDescription
latestLatest stable release
3.x, 3.x.ySpecific version series
nightlyDevelopment 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:

DistributionSupported Since
Debian trixie3.13
Debian bookworm3.5
Debian bullseye
Ubuntu noble (24.04)3.9
Ubuntu jammy (22.04)3.3
Ubuntu focal (20.04)2.5

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

For information about Hyperscan and LuaJIT in Debian/Ubuntu packages, see 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 3.10.2 https://github.com/rspamd/rspamd.git

Build Requirements

DependencyDescriptionRequired
CMake 3.12+Build systemYes
C11 compilerGCC 7+ or Clang 6+Yes
C++20 compilerGCC 10+ or Clang 10+Yes
OpenSSLCryptography libraryYes
GLib2 2.28+Common utilities libraryYes
RagelState machine compilerYes
LuaJIT or Lua 5.1-5.4Scripting languageYes
SQLite3Embedded databaseYes
libmagicFile type detectionYes
libicuUnicode libraryYes
PCRE2Regular expressionsYes
zlibCompression libraryYes
HyperscanHigh-performance regex (x86_64)Recommended
VectorscanHyperscan for ARM64/PPC64Recommended
jemallocMemory allocatorRecommended
RedisIn-memory data storeRecommended

Basic Build

mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DENABLE_LUAJIT=ON
make -j$(nproc)
sudo make install

For production, enable additional optimizations:

mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_LUAJIT=ON \
-DENABLE_HYPERSCAN=ON \
-DENABLE_JEMALLOC=ON \
-DCMAKE_C_FLAGS="-flto" \
-DCMAKE_CXX_FLAGS="-flto"
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

OptionDefaultDescription
ENABLE_LUAJITONUse LuaJIT instead of Lua
ENABLE_HYPERSCANOFFEnable Hyperscan regex acceleration
ENABLE_JEMALLOCOFFUse jemalloc memory allocator
ENABLE_PCRE2ONUse PCRE2 (vs legacy PCRE)
SANITIZEEnable sanitizers (address, memory, undefined, leak)
CMAKE_INSTALL_PREFIX/usr/localInstallation 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=3.10.2
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

# 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:

  1. Installation Guide — Verify installation and configure services
  2. First Setup Guide — Integrate with your MTA
  3. Quick Start Tutorial — Get basic spam filtering working