Systemd Service Generator

Build systemd unit files for services, timers, and mounts with ThisDevTool.

Last reviewed: April 2026

New to this tool? Click here for instructions

Configuration
Presets
[Unit]
[Service]
Environment Variables
[Install]
Generated Unit File
Configure your unit file above to generate output.

How to use the Systemd Service Generator

The Systemd Service Generator is a tool that helps you create and modify systemd unit files for services, timers, and mounts. To use it, follow these steps:

1. Choose a unit type: Service (daemon process), Timer (scheduled job), or Mount (filesystem mount).

2. Select a preset for common runtimes: Node.js app, Python app, Go binary, or Docker container.

3. Fill in the required fields such as ExecStart, WorkingDirectory, User, restart policy, and environment variables.

4. Copy or download the generated unit file and save it to the appropriate directory on your Linux server (e.g., /etc/systemd/system/).

5. Activate the service using the install commands provided in the output.

  • Choose a unit type (Service, Timer, or Mount)
  • Select a preset for common runtimes
  • Fill in required fields
  • Copy/download the unit file
  • Save to /etc/systemd/system/

When to use the tool in real workflows

Use the Systemd Service Generator when you need to create or modify systemd unit files for services, timers, or mounts. This tool is particularly useful when working with Linux distributions that use systemd, such as Ubuntu, Debian, Fedora, RHEL/CentOS 7+, Arch Linux, and openSUSE.

How it works

The Systemd Service Generator creates systemd unit files based on user input. The tool includes presets for common runtimes, making it easier to generate unit files for Node.js apps, Python apps, Go binaries, or Docker containers.

Tips, edge cases, or limitations

After creating or modifying a unit file, always run `systemctl daemon-reload` to notify systemd of the change.

The `Restart` directive controls automatic restart behavior. `Restart=always` is appropriate for production web servers and APIs, while `Restart=on-failure` is suitable for workers where a clean exit (code 0) should stop the service.

Frequently Asked Questions

A systemd service file is a configuration file that defines a service, including its metadata, dependencies, and behavior.
Restart=always means that the service will automatically restart regardless of its exit code.
To create a systemd timer, select the 'Timer' unit type and configure the OnCalendar field to schedule the timer.
After changing a service file, run `systemctl daemon-reload` to reload systemd and apply the changes.
After=network.target ensures that the service starts after the network is fully up and running.

Quick reference

Systemd Service Generator Quick Reference
Service Name Description User Common Options
nginx High-performance web server www-data After=network.target, Restart=always
mysql MySQL database server mysql After=network.target, Restart=on-failure
chronyd Network time protocol daemon root After=network.target, Restart=on-abnormal
custom-service Example custom application custom-user After=network.target, Restart=unless-exited

Example walk-through

Worked example: step-by-step

Step 1. Navigate to the Systemd Service Generator webpage and locate the input form for service configuration parameters.

Step 2. Enter the service name (e.g., myapp.service), executable path (/usr/bin/myapp), user (www-data), and working directory (/var/www/myapp).


[Unit]
Description=My Application Service
After=network.target

[Service]
ExecStart=/usr/bin/myapp
User=www-data
WorkingDirectory=/var/www/myapp
Restart=always

[Install]
WantedBy=multi-user.target

Step 3. Click the "Generate Service File" button to trigger the systemd service file creation process.

Step 4. The webpage outputs the generated service file content, which can be copied to /etc/systemd/system/myapp.service.


# Generated by Systemd Service Generator
[Unit]
Description=My Application Service
After=network.target

[Service]
ExecStart=/usr/bin/myapp
User=www-data
WorkingDirectory=/var/www/myapp
Restart=always

[Install]
WantedBy=multi-user.target

Step 5. Save the file and run systemctl daemon-reload to apply changes.

Step 6. Enable and start the service with systemctl enable myapp.service and systemctl start myapp.service.