systemctl daemon-reload

systemd Unit File Builder

Build a correct systemd .service file without consulting the manual every time.

Quick Reference

[Unit]
DescriptionHuman-readable name
AfterStart ordering
RequiresHard dependency
WantsSoft dependency
[Service]
ExecStartCommand to run
ExecStopStop command
RestartRestart policy
RestartSecDelay before restart
UserRun as this user
WorkingDirectoryStarting directory
EnvironmentEnv variable
[Install]
WantedByTarget to attach to
Common targets
multi-user.targetNormal boot
network.targetNetwork up
graphical.targetGUI boot

Linux 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.