Skip to content
100% local

systemd unit file generator

Build a valid systemd .service, .timer, .socket or .mount file from a few fields.

Output

systemd unit file generator

Paste no config file at all — just fill in a handful of fields and this tool writes a complete systemd unit file you can drop straight into /etc/systemd/system/. It covers the four unit types systemd admins write by hand most often: service, timer, socket and mount, and produces the [Unit], [Service] and [Install] sections with the directives in the order systemd expects.

For a service unit, set the description and documentation URL, the ExecStart command (with optional ExecStartPre and ExecStop hooks), the service Type (simple, exec, forking, oneshot or notify), the user and group to run as, a working directory, and environment variables either inline or via EnvironmentFile. The restart policy and RestartSec control how systemd reacts when the process dies; After and Requires wire up dependency ordering, and WantedBy sets which target pulls the unit in at boot. A hardening block adds NoNewPrivileges, PrivateTmp, ProtectSystem and ProtectHome with one click each, which is most of what a distro's own service files use for sandboxing.

Choosing timer, socket or mount instead still fills in the shared [Unit] and [Install] sections, but leaves the type-specific block as a comment rather than guessing at OnCalendar=, ListenStream= or What=/Where= syntax it can't verify — see the cron to systemd timer converter for a ready-made schedule. The unit name is sanitized to the characters systemd allows, and the tool warns instead of freezing if a field is pasted in absurdly large.

Everything runs locally in your browser: nothing you type, including hostnames, paths or credentials in EnvironmentFile, is ever sent anywhere. Copy the result, download it as a .txt file to rename and install yourself, or send it to another tool to keep editing.

FAQ

Where do I put the generated file?
Save it as /etc/systemd/system/<name>.service (or .timer/.socket/.mount), then run systemctl daemon-reload followed by systemctl enable --now <name>.
Why does choosing "timer" or "socket" leave part of the file as a comment?
Those unit types use directives this generator doesn't fabricate for you — OnCalendar= for a timer, ListenStream= for a socket, What=/Where= for a mount. Add them where the comment points instead of copying guessed syntax.
What does the hardening block actually do?
NoNewPrivileges blocks privilege escalation, PrivateTmp gives the service its own /tmp, and ProtectSystem/ProtectHome make most of the filesystem read-only or inaccessible to it. Together they match the sandboxing many distro-shipped services already use.
Can I generate a unit for multiple environment variables at once?
Yes. List them comma- or newline-separated as KEY=VALUE pairs in the Environment variables field; each becomes its own Environment= line, and malformed entries are skipped rather than breaking the file.
Is anything I type sent to a server?
No. The unit file is generated entirely in your browser — including any paths, hostnames or environment values you enter — and nothing is uploaded.