Files
beszel/supplemental/systemd/readme.md
2024-07-31 17:37:38 -04:00

1.4 KiB

Run the hub as a system service (Linux)

This runs the hub in the background continuously using systemd.

  1. Create the system service at /etc/systemd/system/beszel.service
[Unit]
Description=Beszel Hub Service
After=network.target

[Service]
# update the values in the curly braces below (remove the braces)
ExecStart={/path/to/working/directory}/beszel serve
WorkingDirectory={/path/to/working/directory}
User={YOUR_USERNAME}
Restart=always

[Install]
WantedBy=multi-user.target
  1. Start and enable the service to let it run after system boot
sudo systemctl daemon-reload
sudo systemctl enable beszel.service
sudo systemctl start beszel.service

Run the agent as a system service (Linux)

This runs the agent in the background continuously using systemd.

  1. Create the system service at /etc/systemd/system/beszel-agent.service
[Unit]
Description=Beszel Agent Service
After=network.target

[Service]
# update the values in curly braces below (remove the braces)
Environment="PORT={PASTE_YOUR_PORT_HERE}"
Environment="KEY={PASTE_YOUR_KEY_HERE}"
ExecStart={/path/to/directory}/beszel-agent
User={YOUR_USERNAME}
Restart=always

[Install]
WantedBy=multi-user.target
  1. Start and enable the service to let it run after system boot
sudo systemctl daemon-reload
sudo systemctl enable beszel-agent.service
sudo systemctl start beszel-agent.service