[Unit] Description=node.js testapp Requires=network.target After=network.target [Service] WorkingDirectory=/var/www/testapp Type=forking ExecStart=/bin/bash -c 'sleep 3;echo "I am starting";echo "$(whoami)";' # For a node.js app this could be something like: #ExecStart=/bin/bash -c 'npm start' StandardOutput=syslog StandardError=syslog SyslogIdentifier=testapp User=www-data Group=www-data Environment="NODE_ENV=production" "DEBUG=testapp:*" [Install] WantedBy=multi-user.target