Deploy with systemd
When you need “close the terminal, reboot the machine, and people can still resolve me”, make a2ald resident as a service. On Linux there are three routes; pick the one that matches your environment.
| Route | Best for | Needs root |
|---|---|---|
| deb / rpm package | Servers, Raspberry Pi; one command and it is done | Yes |
| system-level systemd | Custom paths, custom users | Yes |
| per-user systemd | Personal workstations, no root | No |
Route one: package install
Section titled “Route one: package install”The package provides both binaries and takes care of creating the user and directories, installing the systemd unit and starting the service.
# Debian / Ubuntusudo dpkg -i a2al_<version>_amd64.deb
# CentOS / RHEL / Fedorasudo rpm -i a2al-<version>-1.x86_64.rpmOn ARM64 (Raspberry Pi, Graviton and the like), replace amd64 with arm64 (deb) or aarch64 (rpm). Packages come from GitHub Releases.
Paths after installation:
| Contents | Path |
|---|---|
| Configuration | /opt/a2al/data/config.toml (created on first start) |
| Data and keys | /opt/a2al/data/ |
| File sandbox | /opt/a2al/files/ |
| Binaries | /opt/a2al/bin/ (symlinked into /usr/local/bin/) |
Route two: manual binaries with system-level systemd
Section titled “Route two: manual binaries with system-level systemd”Use this when no package is available for your distribution, or when you need custom paths.
sudo mkdir -p /opt/a2al/binsudo cp a2ald a2al /opt/a2al/bin/sudo chmod +x /opt/a2al/bin/a2ald /opt/a2al/bin/a2alsudo ln -sf /opt/a2al/bin/a2ald /usr/local/bin/a2aldsudo ln -sf /opt/a2al/bin/a2al /usr/local/bin/a2al
sudo useradd -r -s /bin/false -M -d /opt/a2al a2alsudo mkdir -p /opt/a2al/data /opt/a2al/filessudo chown -R a2al:a2al /opt/a2al/data /opt/a2al/filesWrite the unit file /etc/systemd/system/a2ald.service:
[Unit]Description=A2AL DaemonDocumentation=https://a2al.orgAfter=network-online.targetWants=network-online.target
[Service]User=a2alGroup=a2alExecStart=/opt/a2al/bin/a2ald -data-dir /opt/a2al/dataRestart=on-failureRestartSec=5TimeoutStopSec=10
# HardeningNoNewPrivileges=truePrivateTmp=trueProtectSystem=strictReadWritePaths=/opt/a2al/data /opt/a2al/files
[Install]WantedBy=multi-user.targetsudo systemctl daemon-reloadsudo systemctl enable --now a2aldRoute three: per-user systemd
Section titled “Route three: per-user systemd”On a personal workstation, no root is needed and the service starts when you log in. The data directory is the default ~/.config/a2al/.
mkdir -p ~/.config/systemd/usercat > ~/.config/systemd/user/a2ald.service <<'EOF'[Unit]Description=A2AL DaemonAfter=network.target
[Service]ExecStart=/usr/local/bin/a2aldRestart=on-failureRestartSec=5
[Install]WantedBy=default.targetEOF
systemctl --user daemon-reloadsystemctl --user enable --now a2aldAdjust ExecStart to whatever which a2ald reports. To keep it running after you log out, enable lingering:
loginctl enable-linger $USERFirewall
Section titled “Firewall”The data-plane ports have to be open (UDP carries QUIC direct connections and address lookups, TCP carries ICE signalling):
# UFW (Ubuntu / Debian)sudo ufw allow 4121/udpsudo ufw allow 4121/tcp
# firewalld (CentOS / RHEL / Fedora)sudo firewall-cmd --permanent --add-port=4121/udpsudo firewall-cmd --permanent --add-port=4121/tcpsudo firewall-cmd --reloadLeave the administrative port 2121 listening on the local machine only, and do not open it.
Configuration
Section titled “Configuration”Do not edit files under a running service — stop, edit, start:
# system-widesudo systemctl stop a2aldsudo -u a2al nano /opt/a2al/data/config.tomlsudo systemctl start a2ald
# per usersystemctl --user stop a2aldnano ~/.config/a2al/config.tomlsystemctl --user start a2aldWhen the machine serves only as a public routing node and carries no personal identities, you can tighten it further:
disable_upnp = true # no UPnP router on a serverauto_publish = false # do not publish endpoint records automaticallylog_format = "json" # easier log aggregationThe complete set of fields is in Configuration.
SELinux (CentOS / RHEL only)
Section titled “SELinux (CentOS / RHEL only)”sudo semanage fcontext -a -t var_t '/opt/a2al/data(/.*)?'sudo restorecon -Rv /opt/a2al/data# without semanage:sudo dnf install -y policycoreutils-python-utilsLogs and operations
Section titled “Logs and operations”# system-widesudo systemctl status a2aldsudo journalctl -u a2ald -f
# per usersystemctl --user status a2aldjournalctl --user -u a2ald -fUninstalling
Section titled “Uninstalling”# package installsudo dpkg -r a2al # Debian / Ubuntusudo rpm -e a2al # CentOS / RHEL# data and keys remain in /opt/a2al/data/; to remove them entirely:sudo rm -rf /opt/a2al/datasudo userdel a2al
# manual installsudo systemctl disable --now a2aldsudo rm /etc/systemd/system/a2ald.servicesudo systemctl daemon-reloadsudo rm -f /usr/local/bin/a2ald /usr/local/bin/a2alsudo rm -rf /opt/a2al/binsudo rm -rf /opt/a2al/data # optional: this takes the keys and configuration with itsudo userdel a2alOn macOS and Windows, use the built-in a2ald service install|status|stop|start|uninstall: on macOS it writes a launchd user agent, and on Windows it offers either a system service or a scheduled task; see Quick Start and MCP Setup.
Related pages
Section titled “Related pages”| Goal | Page |
|---|---|
| Every configuration field | Configuration |
| Running in a container | Deploy with Docker |
| Advice on ports and access control | Security Practices |