#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⚙️ FREE · .SERVICE UNIT

Systemd Service Generator: Keep Your App Running After Reboot

Describe how your app starts, and get a unit file plus the commands to install it.

  • 🔁 Restart on failure
  • 👤 Runs as its own user
  • 🛡️ Basic hardening

How to use the Systemd Service File Generator

  1. 1. Name the serviceGive it a name and a short description.
  2. 2. Say how it startsThe full ExecStart path, working folder, user and environment.
  3. 3. InstallCopy the file, reload systemd and enable it with the commands shown.

The default unit file

The example runs a Node.js API as myapp.service. The [Unit] section waits for network-online.target. The [Service] section uses Type=simple, runs as user and group myapp in /opt/myapp, sets NODE_ENV and PORT, starts /usr/bin/node /opt/myapp/server.js, and restarts it five seconds after a crash with Restart=on-failure. The [Install] section links it to multi-user.target so it starts at boot.

Underneath, the tool lists the five commands to copy the file to /etc/systemd/system, run daemon-reload, enable and start it, check its status and follow its log with journalctl.

Options worth knowing

  • Type: simple for most apps, notify for apps that tell systemd when they are ready, forking for old daemons, oneshot for scripts that run and exit.
  • Restart: on-failure restarts after crashes; always also restarts after a clean exit.
  • Hardening: NoNewPrivileges, PrivateTmp, ProtectSystem=full and ProtectHome reduce what a compromised app can touch. Turn them off if your app writes to /home or system folders.
  • EnvironmentFile loads settings from a file, which keeps secrets out of the unit.

ExecStart must use an absolute path; find it with which node or which python3. Put Nginx in front with the Nginx config generator, and automate the install with the Ansible playbook generator.

Frequently asked questions

Why does my service fail with status 203/EXEC?

systemd could not run the ExecStart program. Check the path is absolute, the file exists and it is executable by the service user.

Is pm2 or systemd better for Node.js?

Both work. systemd is already on most Linux servers and handles logs and restarts without extra software.

Is the Systemd Service File Generator free?

Yes, the Systemd Service File Generator is free. The first time you generate your first unit file, you are asked for your name and WhatsApp number once. After that, this and every other Uncodemy tool opens straight away without the form.

More free tools

See all free tools