mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 17:59:28 +08:00
move systemd instructions to the supplemental directory
This commit is contained in:
60
supplemental/systemd/readme.md
Normal file
60
supplemental/systemd/readme.md
Normal file
@@ -0,0 +1,60 @@
|
||||
## 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`
|
||||
|
||||
```bash
|
||||
[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
|
||||
```
|
||||
|
||||
2. Start and enable the service to let it run after system boot
|
||||
|
||||
```bash
|
||||
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`
|
||||
|
||||
```bash
|
||||
[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
|
||||
```
|
||||
|
||||
2. Start and enable the service to let it run after system boot
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable beszel-agent.service
|
||||
sudo systemctl start beszel-agent.service
|
||||
```
|
Reference in New Issue
Block a user