@@ -46,6 +46,7 @@ https://user-images.githubusercontent.com/2183313/139728539-d69b899f-6f9b-44cb-a
4646 - [ Running using a tunneling service (easy mode)] ( #running-using-a-tunneling-service-easy-mode )
4747 - [ HTTPS Setup on a VPS (static IP required)] ( #https-setup-on-a-vps-static-ip-required )
4848 - [ HTTPS Setup using external HTTPS proxy] ( #https-setup-using-external-https-proxy )
49+ - [ Using ` systemd ` to run Atomic-Server as a service] ( #using-systemd-to-run-atomic-server-as-a-service )
4950- [ Usage] ( #usage )
5051 - [ Using Atomic-Server with the browser GUI] ( #using-atomic-server-with-the-browser-gui )
5152 - [ Use ` atomic-cli ` as client] ( #use-atomic-cli-as-client )
@@ -184,6 +185,48 @@ ATOMIC_HTTPS=false
184185ATOMIC_SERVER_URL =https://example.com
185186```
186187
188+ ### Using ` systemd ` to run Atomic-Server as a service
189+
190+ In Unix operating systems, you can use ` systemd ` to manage a
191+
192+ Create a service:
193+
194+ ``` sh
195+ vim /etc/systemd/system/atomic.service
196+ ```
197+
198+ Paste this:
199+ ```
200+ [Unit]
201+ Description=Atomic-Server
202+ #After=network.targetdd
203+ StartLimitIntervalSec=0[Service]
204+
205+ [Service]
206+ Type=simple
207+ Restart=always
208+ RestartSec=1
209+ User=root
210+ ExecStart=/root/atomic-server
211+ WorkingDirectory=/root/
212+ EnvironmentFil=/root/.env
213+
214+ [Install]
215+ WantedBy=multi-user.target
216+ ```
217+
218+ ``` sh
219+ # start service
220+ systemctl start atomic
221+ # check status
222+ systemctl status atomic
223+ # restart
224+ systemctl restart atomic
225+ # logs
226+ journalctl -u atomic.service
227+ # logs, since one hour, follow
228+ journalctl -u atomic.service --since " 1 hour ago" -f
229+ ```
187230## Usage
188231
189232There are three ways to interact with this server:
0 commit comments