|
How to Setup the Caddy HTTP Server as a Windows Service |
Automatically start Caddy whenever your machine boots and keep it running 24/7 in the background. No need to log on first
Last Updated on May 22, 2026
Caddy is an extensible, open-source web server written entirely in
Go.
To install Caddy as a Windows Service with AlwaysUp:
-
Download and setup Caddy, if necessary.
Note the command line
you run to launch Caddy — we'll be plugging that into AlwaysUp soon.
For this tutorial, we placed caddy.exe in "C:\Caddy" and set it up as a simple static file server.
This command launched the server on our machine:
C:\Caddy\caddy.exe file-server --root "C:\WWW\htdocs"
-
Download and install AlwaysUp.
-
Start AlwaysUp.
-
Select Application > Add to open the Add Application window:
-
On the General tab:
-
In the Application field, enter the full path to the Caddy executable, caddy.exe.
Since we installed Caddy in "C:\Caddy", we'll specify:
C:\Caddy\caddy.exe
-
In the Arguments field, enter all the parameters you're using with the Caddy executable.
For our installation, we'll specify:
file-server --root "C:\WWW\htdocs"
Be sure to quote each file or folder name that contains a space.
-
And in the Name field, enter the name that you will call this application in AlwaysUp.
We've stuck with the default, Caddy.
-
By default, AlwaysUp runs applications in the built-in
LocalSystem account
— where Windows Services run.
That should be fine for Caddy under most circumstances, but you'll run into trouble if LocalSystem cannot access important resources available to your account.
With that in mind, we recommend specifying your account because we know Caddy works there.
Move to the Logon tab and enter the user name and password of your Windows account:
-
If you're interested in monitoring Caddy and automatically restarting it if it stops serving web pages,
click over to the Monitor tab. We'll set up a
web server sanity check
that shouts if the Caddy HTTP server fails.
-
On the Monitor tab, check the Whenever it fails a periodic sanity check box and click the Set button on the right:
-
In the Add Sanity Check window, select the Check that a web server is responding properly
option and click Next to proceed:
-
Enter the web address where you access the Caddy application in your browser. On our machine, where Caddy is running at port 80, that's:
http://localhost
Click Next to continue.
-
On this page, specify how often AlwaysUp should check Caddy's HTTP connection.
The default of every 5 minutes should be fine but you can have AlwaysUp check more often (or less often) if you like.
After you're done, click Next to move on.
-
And finally, confirm your settings:
If everything looks good, click Add
to record your new sanity check and return to the Monitor tab.
-
Finally, move to the Startup tab and check the Ensure that the Windows Networking components have started box.
This informs AlwaysUp that Caddy needs the regular TCP/IP networking stack to operate:
-
We're done configuring AlwaysUp, so click the Save button.
In a couple of seconds, an application called Caddy (or whatever you called it) will show up in the AlwaysUp window.
It is not yet running though and the state will be "Stopped".
-
To start Caddy, choose Application > Start "Caddy". The state should transition to "Running" after a few seconds and Caddy will be active in the background:
Caddy should be available on its configured port (2015 by default). Check that all is well from your browser, as it was on our server:
-
That's it! Next time your computer boots, your Caddy service will be launched immediately, before anyone logs on.
Feel free to edit the entry in AlwaysUp and add more advanced options.
For example,
boost the priority of the Caddy process,
save Caddy's console output to a file,
and much more.
Caddy 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 an HTML report detailing the interaction between AlwaysUp and Caddy. The AlwaysUp Event Log Messages page explains the more obscure messages.
Browse the AlwaysUp FAQ for answers to commonly asked questions and troubleshooting tips.
Contact us and we will be happy to help!
|
Over 97,000 installations, and counting!
|
 |
|
Rock-solid for the past 20+ years!
|
Fully Compatible with 160+ Applications...
|