Start your go app when the server starts. In other word daemonize your golang program.
cd /etc/systemd/system/
nano golang.service
[Unit] Description=Go Server [Service] ExecStart=/var/www/web WorkingDirectory=/var/www/ User=root Group=root Restart=always [Install] WantedBy=multi-user.target
systemctl enable golang.service
systemctl start golang.service
systemctl status golang.service
systemctl stop golang.service
dpkg -l systemd
systemctl --version
There was an error while loading. Please reload this page.