How to create a systemd service for your app
Updated 10/16/2026
A systemd service keeps your app running, restarts it if it stops and launches it automatically at boot. It is the correct way to run production processes on Linux.
1. Create the service file
Create /etc/systemd/system/my-app.service:
[Unit]
Description=My app
After=network.target
[Service]
User=www-data
WorkingDirectory=/var/www/app
ExecStart=/usr/bin/node server.js
Restart=always
Environment="NODE_ENV=production"
[Install]
WantedBy=multi-user.target
2. Start and enable
systemctl daemon-reload
systemctl enable --now my-app
3. Check the status
systemctl status my-app
journalctl -u my-app -f
See the service logs, useful for debugging, see managing logs.
Advantages over running manually
- Starts automatically after a server reboot.
- Restarts itself if the app crashes (
Restart=always). - Centralized logs through journalctl.
It works for Node, Python, Go apps or any process that must run continuously.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
How to send WhatsApp messages from your apps with OpenWA
OpenWA gives you a REST API over WhatsApp, on your own server. Here is how to install it, connect it and send your first message, safely.
Updated 10/16/2026Dev environmentsHow to deploy an app from Git with Openship
From a Git repo to a live app, with a database, domain and SSL, on your own server, with no config files.
Updated 10/16/2026Dev environmentsHow to install PHP (multiple versions) and Composer
Install the PHP version your project needs, along with Composer for package management.
Updated 10/16/2026