UnderHost
Knowledgebase Docs

systemd services: manage, start, stop, enable

Use systemctl to manage systemd services on Linux VPS servers. Start, stop, enable, disable, and troubleshoot services.

On this page

systemd is the init system on most modern Linux distributions. Services are managed with systemctl — the main tool for starting, stopping, enabling, and diagnosing services.

Basic systemctl commands

systemctl start nginx       # Start service now
systemctl stop nginx        # Stop service now
systemctl restart nginx     # Stop then start
systemctl reload nginx      # Reload config without restart
systemctl enable nginx      # Auto-start on boot
systemctl disable nginx     # Remove auto-start

Check service status

systemctl status nginx
# Shows: active (running), PID, memory, recent log lines

systemctl is-active nginx   # Returns "active" or "inactive"
systemctl is-enabled nginx  # Returns "enabled" or "disabled"

systemctl list-units --type=service --state=running  # All running services

View service logs

journalctl -u nginx          # All logs for nginx
journalctl -u nginx -f       # Follow (live tail)
journalctl -u nginx --since "1 hour ago"  # Recent logs
journalctl -p err -u nginx   # Errors only

Create a custom service

Create /etc/systemd/system/myapp.service:

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

[Service]
Type=simple
User=www-data
WorkingDirectory=/var/www/myapp
ExecStart=/usr/bin/node server.js
Restart=on-failure

[Install]
WantedBy=multi-user.target
systemctl daemon-reload     # Load the new service file
systemctl enable myapp      # Enable auto-start
systemctl start myapp       # Start it now

Related: Command line basics | Manage VPS

Was this article helpful?

Need a developer-friendly server?

Use an UnderHost Cloud VPS for SSH, Git, Node.js, Python, Laravel, Docker, cron, and custom development workflows.

Related articles

Back to Developer Tools