Install
Install Raaqeb with the installer script on Linux, macOS or Windows, with Docker or Docker Compose, on Fly.io, or as a bare binary.
Raaqeb ships as seven binaries and a Docker image. The binaries sit beside a SHA256SUMS file:
raaqeb-linux-x64,raaqeb-linux-arm64: glibc, for Debian, Ubuntu, Fedora and their kind;raaqeb-linux-x64-musl,raaqeb-linux-arm64-musl: musl, for Alpine, which needsapk add libstdc++ libgccfirst;raaqeb-darwin-arm64: macOS 13 or later on Apple Silicon (no Intel Mac binary);raaqeb-windows-x64.exe,raaqeb-windows-arm64.exe: Windows 10 version 1809 or later, Windows 11, and Windows Server 2019 or later.
These are Bun's minimums, macOS 13 and Windows 10 version 1809 (docs/installation.mdx in Bun's docs); Windows Server 2019 is the server release of 1809.
Each binary holds everything it serves: the pages, the migrations and the email client. Nothing else is installed beside it. None is signed by a publisher: the macOS binary carries the ad-hoc signature Apple Silicon needs to run it, and the Windows binaries carry none, so the first run of a browser download asks once (below).
Releases are published at github.com/Taqanah/raaqeb/releases, and each release's image at ghcr.io/taqanah/raaqeb:<version>. To install a build of your own, build from a checkout with Bun: bun install, then bun run binaries writes the binaries to dist/bin, and bun run image builds the image and loads it into Docker as ghcr.io/taqanah/raaqeb:<version>. Install from the dist/bin folder with RAAQEB_DOWNLOAD_URL (next section).
Every install path ends at the onboarding page, which asks three questions: the language, the database and the operator account. Open Raaqeb at the address you mean to keep. The account screen stores that address as the public address, and sign-in works only there.
The installer script
On a Linux server with systemd or OpenRC, or a Mac with Apple Silicon (next section), the installer does the whole install as root:
curl -fsSL https://raaqeb.dev/install.sh | sudo shThe script installs the latest stable release. It asks https://github.com/Taqanah/raaqeb/releases/latest for the release it redirects to, not the GitHub API, so no rate limit applies, and downloads the binary and SHA256SUMS from that one release. Two variables change that:
RAAQEB_VERSIONnames the release to install, such as a pre-release, which is never the latest:curl -fsSL https://raaqeb.dev/install.sh | sudo RAAQEB_VERSION=0.3.0-beta.1 sh. It is also how you install an older version. The script stops if no such release exists.RAAQEB_DOWNLOAD_URLis the folder holding the binaries,SHA256SUMSandinstall.sh, a mirror or a folder on the server, and wins over both. For a server with no route to GitHub, copydist/binanddeploy/install.shover and runsudo RAAQEB_DOWNLOAD_URL=file:///root/bin sh install.sh(afile://address needs curl).
The script stops with a message when the network is down, when the repository has no release yet, and when RAAQEB_VERSION names none. Finding the latest release needs curl.
The script:
- picks the binary for the machine:
x86_64oraarch64fromuname -m, musl when the system's ownlddsays so; - downloads it and
SHA256SUMS, and refuses a binary whose checksum does not match; - on Alpine, adds
libstdc++andlibgcc; - installs
/usr/local/bin/raaqeb; - creates the
raaqebsystem user and group, and the data directory/var/lib/raaqeb, mode 0700, owned by that user; - writes
/etc/raaqeb/raaqeb.env, every line a comment, the first time only; - writes the service and starts it: a hardened systemd unit at
/etc/systemd/system/raaqeb.service, or an OpenRC script at/etc/init.d/raaqebundersupervise-daemon; - waits up to five minutes for
/healthto answer (an upgrade migrates the database first), then prints the next step.
Raaqeb then listens on 127.0.0.1:3000, this server only. Either put a reverse proxy in front of it (reverse proxy and TLS), or set RAAQEB_HOST=0.0.0.0 in /etc/raaqeb/raaqeb.env and restart the service. To onboard before a proxy exists, reach it over SSH from your own machine with ssh -L 3000:127.0.0.1:3000 <server> and open http://127.0.0.1:3000. Onboarding then pre-fills that address as the public address, so type the address you will keep instead and confirm it.
A server with neither systemd nor OpenRC gets the binary, the user and the folder, and the script prints how to start Raaqeb by hand.
The systemd unit runs Raaqeb as raaqeb with Restart=on-failure and a sandbox: no new privileges and no capabilities, the whole file system read-only except /var/lib/raaqeb, a private /tmp, no devices, no kernel tunables, modules or logs, IPv4, IPv6 and Unix sockets only, and the system calls of an ordinary service. systemctl cat raaqeb shows it. Memory that is written and then run stays allowed, since Bun's JIT compiler needs it.
macOS
On a Mac with Apple Silicon, the same command installs Raaqeb as a launchd daemon:
curl -fsSL https://raaqeb.dev/install.sh | sudo shRAAQEB_VERSION and RAAQEB_DOWNLOAD_URL work as above. On a Mac the script:
- refuses a Mac without Apple Silicon (a shell under Rosetta, which reads as
x86_64, still gets the arm64 binary); - downloads
raaqeb-darwin-arm64andSHA256SUMS, and checks it withshasum -a 256; - creates
_raaqeb, a hidden user and group with no shell and no home, with the first id from 300 that is free, as macOS names its own daemons' accounts; - creates the data directory
/usr/local/var/raaqeb, mode 0700, owned by_raaqeb, and writes/usr/local/etc/raaqeb/raaqeb.envthe first time only; - installs
/usr/local/bin/raaqeb, with any quarantine flag taken off; - writes
/Library/LaunchDaemons/raaqeb.plistand starts it withlaunchctl bootstrap system: Raaqeb runs as_raaqebfrom boot, before anyone signs in, and launchd starts it again within seconds when it exits with a failure or is killed; - waits for
/healthand prints the next step.
Raaqeb listens on 127.0.0.1:3000. The daemon's log is /usr/local/var/log/raaqeb/raaqeb.log. To restart it after editing the env file: sudo launchctl kickstart -k system/raaqeb.
Gatekeeper. A file curl downloads carries no quarantine flag, so the installer and a binary fetched with curl -fLO https://github.com/Taqanah/raaqeb/releases/latest/download/raaqeb-darwin-arm64 run without a prompt. A binary downloaded through a browser carries the flag, and macOS refuses to open it from an unidentified developer. Take the flag off before the first run:
xattr -d com.apple.quarantine raaqeb-darwin-arm64
chmod +x raaqeb-darwin-arm64Or open it once, then allow it under System Settings, Privacy & Security, "Open Anyway". The binary is already signed ad hoc as Bun compiles it; codesign --verify raaqeb-darwin-arm64 passes, and there is nothing to sign by hand.
Windows
In PowerShell run as Administrator, the Windows installer does the whole install:
irm https://raaqeb.dev/install.ps1 | iexIt installs the latest stable release. $env:RAAQEB_VERSION = '0.3.0-beta.1'; irm https://raaqeb.dev/install.ps1 | iex installs the release you name, a pre-release for one. RAAQEB_DOWNLOAD_URL wins over both and may be a URL or a local folder holding the binaries, SHA256SUMS and install.ps1: $env:RAAQEB_DOWNLOAD_URL = 'C:\raaqeb'; iex (Get-Content -Raw C:\raaqeb\install.ps1). The script:
- picks
raaqeb-windows-x64.exeorraaqeb-windows-arm64.exeby the machine's own architecture, which an emulated PowerShell does not change; - downloads it and
SHA256SUMS, and refuses a binary whose checksum does not match; - installs
C:\Program Files\Raaqeb\raaqeb.exe; - creates
C:\ProgramData\Raaqeb, owned by the Administrators. Only they and SYSTEM have full access, and the folder inherits no permissions. Local Service may read the folder and the env file.envin it, and write only in the data directory,data. The installer writes.envthe first time only. A folder of that name that another account made first is refused, since a planted.envor install key cannot be trusted: look inside it, remove it, and run the installer again; - registers the task
Raaqebin Task Scheduler: the binary itself, run as Local Service from that folder, started at boot and again within a minute whenever it is not running, with no time limit; - starts it, waits for
/healthand prints the next step.
Raaqeb listens on 127.0.0.1:3000. Windows has no service wrapper here: the binary does not speak the protocol of a Windows service, so Task Scheduler runs it. Ending the task kills the process, which SQLite recovers from at the next start. Because the task starts Raaqeb again within a minute, stop it by disabling it first:
Disable-ScheduledTask Raaqeb; Stop-ScheduledTask Raaqeb # stop
Enable-ScheduledTask Raaqeb; Start-ScheduledTask Raaqeb # startRaaqeb keeps no log on Windows: Task Scheduler gives the task no console and no file, so its output goes nowhere and past lines are not kept. To read the log, stop the task and run Raaqeb by hand in a console in that folder: cd C:\ProgramData\Raaqeb; & 'C:\Program Files\Raaqeb\raaqeb.exe' serve, then Ctrl+C.
SmartScreen. A file irm or Invoke-WebRequest downloads carries no Mark of the Web, so the installer and its binary run without a prompt. A binary downloaded through a browser carries the mark, and SmartScreen stops its first run with "Windows protected your PC": choose More info, then Run anyway. Or take the mark off first: Unblock-File .\raaqeb-windows-x64.exe.
Docker
The image runs the glibc binary on distroless, as uid 65532, with /data as its volume and raaqeb health as its health check:
docker run -d --name raaqeb --restart unless-stopped \
-p 3000:3000 -v raaqeb-data:/data ghcr.io/taqanah/raaqeb:0.2.2A named volume needs nothing more. A bind mount needs the container to run as the folder's owner: --user "$(id -u):$(id -g)" -v "$PWD/data:/data". The image has no shell; docker exec raaqeb raaqeb <command> runs the binary directly.
Docker Compose
deploy/compose.yaml runs Raaqeb with restart: unless-stopped on SQLite in a named volume. Two profiles add a service each:
--profile postgresadds Postgres 18. SetPOSTGRES_PASSWORDin a.envfile besidecompose.yaml, then on the onboarding database screen choose Postgres withpostgres://raaqeb:<POSTGRES_PASSWORD>@postgres:5432/raaqeb.--profile caddyadds Caddy in front with automatic HTTPS forDOMAIN, set in the same.env, and certificates on demand for custom domains (custom domains). With Caddy in front, delete theportsline of theraaqebservice, so Caddy is the only way in.
The compose network has a fixed subnet, 172.31.253.0/29, so Caddy's address, 172.31.253.2, is known and RAAQEB_TRUSTED_PROXIES names it. If it overlaps a network of the host, change the subnet and its ip_range, and Caddy's address in both places it appears: the caddy service's ipv4_address and RAAQEB_TRUSTED_PROXIES. A bind mount in place of the named volume needs user: "<uid>:<gid>" on the raaqeb service.
docker compose --profile caddy up -dFly.io
deploy/fly/README.md is a guide of its own, with a sample fly.toml.
The bare binary
Run the binary anywhere: ./raaqeb-linux-x64, ./raaqeb-darwin-arm64 or .\raaqeb-windows-x64.exe. With no settings it keeps its data in ./data and listens on 127.0.0.1:3000. It reads a .env file from its working directory, so boot settings can live there. Ctrl+C stops it cleanly on every platform, and so do SIGTERM and, on Windows, closing its console window.