← All code files

app.service

systemd unit to run a Node/Python app as a service that restarts on failure.

[Unit]
Description=My App
After=network.target

[Service]
Type=simple
User=app
WorkingDirectory=/opt/app
ExecStart=/usr/bin/node /opt/app/dist/index.js
Restart=on-failure
RestartSec=5
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target

About this tool

systemd unit to run a Node/Python app as a service that restarts on failure.

Ready-to-use app.service — view the content, copy it, or download it with the correct filename. Free and 100% in your browser.