Self-Hosting Guide
How to deploy AntiRaid on your own infrastructure using Docker Compose or native systemd.
AntiRaid is a multi-service system. Running it yourself means deploying several components together: the Discord bot (Rust), the HTTP API (Go), the job server (Go), the template worker (Rust), a PostgreSQL database, object storage, and a reverse proxy. This guide explains your options and helps you choose the right approach.
This is for advanced users
Self-hosting requires Linux server administration experience, familiarity with Docker or systemd, and the ability to troubleshoot service failures. If you just want to use AntiRaid in your server, invite the hosted bot instead.
Deployment options
Docker Compose (recommended for most)
All services are defined in a single docker-compose.yml. Docker handles networking, dependency ordering, and restarts automatically. This is the fastest way to get a working stack.
Best for: developers who want a reproducible environment, or anyone new to self-hosting AntiRaid.
Native / systemd
Each service runs as a native Linux process managed by systemd. You build each binary yourself, write unit files, and manage configuration manually. This gives you full control over the process lifecycle, resource limits, and system integration.
Best for: production servers where you want tight OS integration, custom monitoring, or minimal container overhead.
Comparison
| Docker Compose | Native (systemd) | |
|---|---|---|
| Setup difficulty | Low | High |
| Reproducibility | High | Medium |
| OS integration | Limited | Full |
| Monitoring | docker logs, Compose CLI | journalctl, systemd status |
| Upgrading | docker compose pull && up | Rebuild binaries, restart units |
| Customisation | Medium | Full |
What you'll need
Regardless of the deployment method, you'll need:
- A Linux server (Ubuntu 22.04+ or Debian 12+ recommended)
- PostgreSQL 15+
- A Discord application with bot token and OAuth2 credentials
- S3-compatible object storage (MinIO works well for self-hosted setups)
- A domain name with TLS (if exposing the API externally)
Services overview
| Service | Language | Purpose |
|---|---|---|
bot | Rust | Handles Discord gateway events, slash commands, and moderation |
api | Go | HTTP API for the dashboard and external integrations |
jobserver | Go | Background jobs — backups, pruning, scheduled tasks |
template-worker | Rust | Executes user-defined Luau scripts in a sandboxed environment |
For detailed information on each service, see the Services docs.