Sample systemd service file and how to setup systemd [Unit] Description=The NGINX HTTP and reverse proxy server After=syslog.target network.target remote-fs.target nss-lookup.target [Service] PIDFile=/run/nginx.pid ExecStart=/usr/sbin/nginx ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID User=$USER PrivateTmp=true Type=notify Restart=always [Install] WantedBy=multi-user.target RequiredBy=network.target Copy the sample.service file to /etc/systemd/system/ Run sudo systemctl daemon-reload Run sudo systemctl enable sample.service Run sudo systemctl is-enabled sample.service to check if the service file is enabled or not Reference