|
How to Start Any Go Application as a Windows Service with AlwaysUp |
Start your Go application automatically whenever computer reboots and keep it running 24/7 in the background. No need to log on first!
Go is powerful, modern programming language developed by Google.
To setup your Go application as a Windows Service:
-
Download and install Go, if necessary:
-
Using the go build
command, compile your Go application to an executable file. Ensure that the executable work properly when you run it from a command prompt.
We'll work with a small Go web server application called simple-server in this tutorial.
As you can see, we were able to compile and launch our package/program successfully:
-
Download and install AlwaysUp, if necessary.
-
Start AlwaysUp.
-
Select Application > Add to open the Add Application window:
-
On the General tab:
-
In the Application field, enter the full path to your complied Go executable.
-
In the Start the application field, select Automatically, but shortly after the computer boots.
With this setting, your Go application will start 1-2 minutes after a reboot — after critical windows services
(such as networking and domain authentication) have fully initialized and are ready to go.
-
In the Name field, enter the name that you will call the application in AlwaysUp.
We have stuck with the default of Go Server but you can specify another name if you like.
-
We are now done configuring your Go application to run as a service so click the Save button to record your settings.
After a couple of seconds, a new entry called Go Server (or whatever you called it) will appear in the AlwaysUp window.
The state will be "Stopped" because your application hasn't started yet:
-
To start your Go application from AlwaysUp, choose Application > Start "Go Server".
In a few seconds, the state will transition to "Running":
-
And finally, confirm that your Go application is functioning as expected.
For example, is it available at the expect URL in your browser?
Is it writing log files, or communicating with the database?
Everything should be humming along when you're running as a Windows Service.
-
That's it! Next time your computer boots, your Go application will start automatically, before anyone logs on.
We encourage you to edit your entry in AlwaysUp and check out the many other settings that may be appropriate for your environment.
For example, send email when Go crashes or stops for any reason, run in a specific user account (for proper permissions),
automatically restart the program nightly to cure memory leaks, and much more.
Go application not working properly as a Windows Service?
Consult the AlwaysUp Troubleshooter — our online tool that can help you resolve the most common problems encountered when
running an application as a windows service.
From AlwaysUp, select Application > Report Activity > Today... to bring up a HTML report detailing the interaction between AlwaysUp and Go.
The AlwaysUp Event Log Messages page
explains the messages that may be reported.
Browse the AlwaysUp FAQ
for answers to commonly asked questions and troubleshooting tips.
Contact us and we will be happy to help!
|
Over 94,000 installations, and counting!
|
|
|
Rock-solid for the past 19+ years!
|
Fully Compatible with 160+ Applications...
|