systemd Unit File Builder
Build a correct systemd .service file without consulting the manual every time.
Quick Reference
DescriptionHuman-readable nameAfterStart orderingRequiresHard dependencyWantsSoft dependencyExecStartCommand to runExecStopStop commandRestartRestart policyRestartSecDelay before restartUserRun as this userWorkingDirectoryStarting directoryEnvironmentEnv variableWantedByTarget to attach tomulti-user.targetNormal bootnetwork.targetNetwork upgraphical.targetGUI bootLinux systemd Unit File Reference
Use this systemd unit file builder to create correct service definitions for Linux daemons, background jobs, and homelab applications without memorising every directive.
systemd FAQ
What is a systemd unit file?
A systemd unit file is a configuration file that tells systemd how to manage a process, socket, or timer. Service unit files define how to start, stop, and restart a daemon.
Where do I put a custom systemd service file?
Place user-created service files in /etc/systemd/system/. After adding or editing a file, run systemctl daemon-reload to reload the configuration.
What does Restart=on-failure mean?
Systemd will automatically restart the service if it exits with a non-zero status code. It will not restart if the service is stopped with systemctl stop.
How do I enable a service to start on boot?
Run systemctl enable servicename.service. This creates a symlink so the service starts automatically when the system reaches the configured target.