Free tool

systemd Service Generator

Correct unit files to turn any executable into a Linux service with auto-restart and boot startup.

Generates systemd units ready for /etc/systemd/system/.

[Unit]
Description=Mi aplicacion
After=network.target

[Service]
User=app
Group=app
WorkingDirectory=/opt/miapp
ExecStart=/usr/bin/node /opt/miapp/server.js
Restart=on-failure
RestartSec=5s
Environment="NODE_ENV=production"
Environment="PORT=3000"

[Install]
WantedBy=multi-user.target

sudo nano /etc/systemd/system/mi-servicio.service
sudo systemctl daemon-reload
sudo systemctl enable --now mi-servicio.service

Built by

Miguel Ángel Colorado Marin (MACM)

Full-Stack Developer · Guadalajara, España

I develop web apps, digital tools and full projects — from design to deployment.

Contact me

Turning an application into a modern Linux service means writing a systemd unit file: the .service file defining how it starts, under which user, when to restart after failure and at which boot stage to come up. systemd documentation is enormous and most tutorials copy incomplete configs that work until the server reboots. This generator produces units with the directives that matter in production: After=network.target so it doesn't race the network, non-root User/Group instead of running as root, Restart with RestartSec to revive crashed processes and WantedBy=multi-user.target for boot autostart. Several services in one session, each with its own ready-to-paste block.

Features

  • Complete [Unit], [Service] and [Install] sections
  • Non-root user and group by default
  • Restart policies with configurable delay
  • Line-by-line environment variables
  • Install commands reminder at the end

How do I create a systemd service?

  1. 1

    Fill in the process details

    Absolute ExecStart, working directory, user and group.

  2. 2

    Choose the restart policy

    on-failure rescues crashes; always for critical daemons.

  3. 3

    Save the file

    At /etc/systemd/system/my-service.service with 644 permissions.

  4. 4

    Enable it

    daemon-reload, then systemctl enable --now to start and autostart.

Frequently asked questions

Why shouldn't it run as root?

If the service gets compromised the attacker gains full root. Running under a dedicated user limits damage to its permissions; also add ProtectSystem=strict and NoNewPrivileges=true once it's working.

Difference between Restart=on-failure and Restart=always?

on-failure restarts only when the process exits with an error, abnormal signal or timeout; always restarts unconditionally even after clean exits. For services admins stop manually, use on-failure or add RemainAfterExit as appropriate.

How do I see the service logs?

journalctl -u my-service.service shows its full history; add -f to follow live and --since today to filter by date. systemd captures stdout/stderr automatically with zero config.

Related tools

Embed systemd Service Generator on your site

Add systemd Service Generator to any web page with a simple iframe. Free, with attribution to miguelacm.es.

<iframe
  src="https://miguelacm.es/embed/systemd-service-generator"
  width="100%"
  height="700"
  frameborder="0"
  title="systemd Service Generator — miguelacm.es"
></iframe>
View embed in new tab →