This directory contains example systemd units for running the Portier broker as a system service. Care has been taken to provide reasonably secure defaults.
To get started:
-
Unpack the broker binaries in
/opt/portier-broker
. (If you'd like them elsewhere, modifyportier-broker.service
.) -
Prepare your configuration, either by creating
config.toml
in/opt/portier-broker
, or by modifyingportier-broker.service
to provide configuration some other way. -
Place
portier-broker.service
in/etc/systemd/system
. -
As root, run
systemctl daemon-reload
to reload the unit files. -
As root, run
systemctl start portier-broker.service
to start the service. Usejournalctl -u portier-broker
to inspect the broker log output. -
Verify the broker HTTP server is available.
-
As root, run
systemctl enable portier-broker.service
to have systemd always start the service on system startup.
The broker also supports socket activation, which allows systemd to provide the listening socket to the broker.
-
Place
portier-broker.socket
in/etc/systemd/system
, alongsideportier-broker.service
. -
As root, run
systemctl daemon-reload
to reload the unit files. -
As root, run
systemctl stop portier-broker.service
to stop any running broker service. -
As root, run
systemctl start portier-broker.socket
to have systemd create the socket. -
Verify the broker HTTP server is available. Systemd should start the broker on-demand, when the server is first accessed.
-
As root, run
systemctl enable portier-broker.socket
to have systemd always create the socket on system startup. -
If desired, run
systemctl disable portier-broker.service
to have systemd always start the broker on-demand.