Install Caddy as a Windows Service with AlwaysUp

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:

  1. 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"

  2. Download and install AlwaysUp.

  3. Start AlwaysUp.

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

    Add Application

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

    Caddy Windows Service: General Settings

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

    Caddy Windows Service: Logon Settings

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

    1. On the Monitor tab, check the Whenever it fails a periodic sanity check box and click the Set button on the right:

      Caddy Windows Service: Enable sanity check

    2. In the Add Sanity Check window, select the Check that a web server is responding properly option and click Next to proceed:

      Caddy: Choose the web server sanity check

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

      Caddy: Set the URL to check

      Click Next to continue.

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

      Caddy: Specify how often to ping the web server

    5. And finally, confirm your settings:

      Caddy: Confirm your web server sanity check settings

      If everything looks good, click Add to record your new sanity check and return to the Monitor tab.

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

    Caddy Windows Service: Startup Settings

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

    Caddy Windows Service: Installed

  10. 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 Windows Service: Running

    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:

    Confirm that Caddy is accessible from your browser

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

Our 14,000+ customers include...
AlwaysUp is fully compatible with Windows 11 AlwaysUp is fully compatible with Windows Server 2025
Over 97,000 installations, and counting!
 
AlwaysUp is number 1! Run as a Service with AlwaysUp

Rock-solid for the past 20+ years!