How to run golang web server forever on Linux

To run nodejs webserver forever, you can use forever like:

forever start index.js

How to do this with golang ?

There are many methods, i can show one of them:

Step 1:

vi /etc/systemd/system/my-go-daemon.service


Description=My Go App

ExecStart=/usr/local/go/bin/go run src/test1/main.go


Step 2:

systemctl enable my-go-daemon
systemctl start my-go-daemon

Related Post


No comments yet.

Leave a Reply