Skip to main content
This guide shows how to install Prometheus Alertmanager and configure it to be managed by systemd so you can start, stop, and enable it with systemctl. High-level workflow:
  • Download and extract Alertmanager.
  • Create a dedicated alertmanager system user.
  • Create configuration and storage directories and place the config.
  • Install binaries and set correct permissions.
  • Create a systemd unit file, reload systemd, and enable/start the service.
This lesson uses Alertmanager v0.24.0 as an example. Replace the version in the commands if you need a newer/older release. For releases see the Alertmanager GitHub releases: https://github.com/prometheus/alertmanager/releases
Summary of important paths and settings:

1. Download and extract Alertmanager

Example (v0.24.0):
You should see the extracted files, for example:

2. Create a dedicated system user

Create a non-login system user to run Alertmanager:
Using --system is recommended for service accounts; it keeps user IDs in the system range.

3. Create configuration and storage directories

Create the config and storage directories, copy the shipped config into place, and set ownership to the alertmanager user:
Be careful with chown -R — do NOT run sudo chown -R alertmanager:alertmanager /etc/ or similarly broad commands. Target only /etc/alertmanager (and other specific directories) to avoid damaging system ownerships.

4. Install the binaries

Copy the alertmanager binary and the amtool helper to a directory on PATH, set execute permissions, and set ownership:
Notes:
  • Keeping the binaries owned by root and world-executable is common and safe; the process will run as the alertmanager user when started by systemd.
  • If you prefer, you can set ownership to alertmanager:alertmanager, but root:root is typical.

5. Create the systemd service unit

Create /etc/systemd/system/alertmanager.service with the following content:
Key points:
  • --config.file points to your Alertmanager config (/etc/alertmanager/alertmanager.yml).
  • --storage.path sets the data directory (/var/lib/alertmanager).
  • The unit runs the process as alertmanager:alertmanager.
After creating the unit file, reload systemd so it recognizes the new service:

6. Start, enable, and verify the service

Start and enable the service so it runs on boot:
Check status and follow logs:
Troubleshooting checklist:
  • Validate that /etc/alertmanager/alertmanager.yml is valid YAML (use a linter or amtool check-config if available).
  • Confirm ownership and permissions: the alertmanager user must be able to read the config and write to /var/lib/alertmanager.
  • Inspect journalctl output for startup errors and missing flags or permission issues.

Reference: Example final systemd unit

For convenience, here is the final unit again:
Congratulations — Alertmanager should now be installed and managed by systemd. Links and references:

Watch Video

Practice Lab