Run Go as a Windows Service with AlwaysUp

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:

  1. Download and install Go, if necessary:

    Install Go

  2. 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:

    Install Go

  3. Download and install AlwaysUp, if necessary.

  4. Start AlwaysUp.

  5. Select Application > Add to open the Add Application window:

    Add Application

  6. 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.

    Go Windows Service: General Tab

  7. 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:

    Go Windows Service: Created

  8. To start your Go application from AlwaysUp, choose Application > Start "Go Server".

    The state will transition to "Running":

    Go Windows Service: Running

  9. 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.

  10. 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!

Download & Try it Free!

Download AlwaysUp and Run as a Service Today! Version 15.1

7.9 MB Installer
Our 12,000+ customers include...
Compatible with Windows 11 Compatible with Windows Server 2022 Compatible with Windows 10
Over 94,000 installations, and counting!
AlwaysUp is number 1! Run as a Service with AlwaysUp

Rock-solid for the past 19+ years!