Run OpenClaw as a Windows Service with AlwaysUp

How to Run OpenClaw 24/7 as a Windows Service with AlwaysUp

Automatically start the OpenClaw Gateway whenever your computer boots and keep it running in the background, for 100% uptime. No need to log in first

OpenClaw is an open-source, self-hosted AI agent that taps into your computer (and your services) to perform helpful tasks on your behalf.

OpenClaw installs a scheduled task that launches the Gateway — a back-end component that powers the agent. However, that task only starts when someone logs on:

OpenClaw Gateway scheduled task

In that configuration, OpenClaw Gateway won't start if your computer is suddenly rebooted (for example, after a power failure). You'll have to log back in to restart the agent.

But we can fix that. Follow the steps below to set up the Gateway as a bulletproof Windows Service. And once we're done, the OpenClaw back-end will:

  1. Start automatically whenever your computer boots (before anyone logs on)
  2. Automatically restart if it crashes or encounters a problem and stops listening to your requests
  3. Automatically restart if anyone stops the gateway — accidentally or on purpose
  4. Run continuously in the background

To install OpenClaw Gateway with AlwaysUp:

  1. Install OpenClaw, if necessary. Make sure that you can connect to OpenClaw from your browser and chat with the agent.

    Everything looked good on our server after we connected OpenClaw to our OpenAI account (with GPT-5.4):

    OpenClaw installed

  2. Next, download and install AlwaysUp, if necessary.

  3. Start AlwaysUp.

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

    Add Application

  5. On the General tab:

    1. In the Application field, enter the full path to your OpenClaw Gateway batch file, gateway.cmd.

      If you installed OpenClaw in the default location, this will be:

      C:\Users\<USER-NAME>\.openclaw\gateway.cmd

      where <USER-NAME> is the name of the Windows account where you installed OpenClaw. That account is "Mike Jones" in this tutorial.

    2. In the Start the application field, choose Automatically, but shortly after the computer boots. With this setting, OpenClaw will start a couple of minutes after boot — after all the machine's critical networking services are up and running.

    3. And in the Name field, enter the name that you want to give your application in AlwaysUp. We went with "OpenClaw Gateway":

    OpenClaw Windows Service: General Tab

  6. Click over to the Logon tab and enter the user name and password of the Windows account where you installed OpenClaw. The Gateway should run in this account so that it can find Node.js (which powers the software) and all its settings.

    OpenClaw Windows Service: Logon Tab

    Helpdesk
    Important Security Considerations


    • Choose the Windows account carefully. If the user is an administrator, that may allow OpenClaw to run commands on your computer with full admin rights.

    • You see, when you run an application as a Windows Service, UAC/dynamic elevation protections are not in play. As a result, the application is always run with the maximum rights available to the user.

    • We tried running OpenClaw without admin rights (by checking the Launch the application without admin rights box on the Logon tab) but it didn't work. In that case, OpenClaw failed to run its exec command because of esoteric Windows security constraints in place for non-admin console applications.

      It's our hope that a future version of OpenClaw (or Windows) will fix the problem and allow AlwaysUp to sandbox the Gateway more securely with reduced rights. Until then, consider installing OpenClaw in non-admin account and providing that account on the Logon tab.

    • In any case, be sure to configure OpenClaw's exec command with the security restrictions you need.

  7. OpenClaw Gateway runs a web server that should always be attentive to your commands. To ensure that's the case, let's set up a sanity check to restart OpenClaw if it ever stops responding.

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

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

      OpenClaw: Choose the web server sanity check

    3. Enter the web address where you chat with OpenClaw. Since the default network port for the Gateway is 18789, that URL is likely:

      http://127.0.0.1:18789/chat

      OpenClaw: Set the URL for the sanity check

      Click Next to continue.

    4. On this page, specify how often AlwaysUp should check OpenClaw'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.

      OpenClaw: Specify how often to ping the web server

    5. And finally, confirm your settings:

      OpenClaw: 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. Switch to the Startup tab. Since OpenClaw relies on the TCP/IP stack to do its work, check the Ensure that the Windows networking components have started option:

    OpenClaw Windows Service: Startup Tab

  9. Finally, move to the Extras tab. This is where we'll tell AlwaysUp how to gracefully shut down OpenClaw Gateway with the "openclaw gateway stop" command.

    1. Near the bottom of the window, check the Use this special command to stop the application box.

    2. In the text area, enter the full path to the "openclaw.cmd" file on your system. If you stuck with the default values when you installed OpenClaw (and NPM), this will probably be:

      C:\Users\<USER-NAME>\AppData\Roaming\npm\openclaw.cmd

      where <USER-NAME> is the name of the Windows account where you installed OpenClaw.

      Important: Enclose the path in quotes if it contains a space.

    3. After the path, add gateway stop.

      For example, on our system with user "Mike Jones", the full stop command is:

      "C:\Users\Mike Jones\AppData\Roaming\npm\openclaw.cmd" gateway stop
    4. OpenClaw Windows Service: Extras Tab

  10. We're done configuring OpenClaw as a Windows Service so click the Save button to record your settings.

    In a couple of seconds, an application called OpenClaw Gateway (or whatever you called it) will show up in the AlwaysUp window. It's not yet running though and the state will be "Stopped":

    OpenClaw Windows Service: Installed

  11. If OpenClaw Gateway is currently running, stop it now. If you leave it running, that existing process may prevent AlwaysUp from running its own copy of the Gateway (because the network port will already be taken).

    Run openclaw gateway stop from a command prompt.

  12. To start OpenClaw from AlwaysUp, choose Application > Start "OpenClaw Gateway". In a few seconds, the status column will change to "Running" and OpenClaw will be chugging away in the background:

    OpenClaw Windows Service: Running

    Now is an excellent time to fire up your web browser and confirm that OpenClaw is working as expected. Things looked great on our server, as we chatted with the agent:

    OpenClaw chat is working

  13. And that's it! Next time your computer boots, OpenClaw Gateway will start up immediately, in the background, without anyone needing to log on. Please restart your PC now and test that everything works as expected after your operating system comes back to life.

    Finally, please feel free to edit OpenClaw Gateway in AlwaysUp and explore the many other settings that may be appropriate for your environment. For example, schedule a weekly restart to keep things fresh, send an email if OpenClaw crashes or stops, and much more.



OpenClaw not working properly as a Windows Service?

  • First, you should determine if the problem is with OpenClaw itself.

    Stop OpenClaw Gateway in AlwaysUp and troubleshoot it from a normal command prompt. Try running openclaw doctor — the health check tool for OpenClaw — to see if it helps.

    For example, if an update broke OpenClaw (as happened on our server), you must fix that outside of AlwaysUp.

    Only return to AlwaysUp once you have OpenClaw working well on your desktop.

  • Have OpenClaw log its internal workings to a text file. You can do that from the Settings > Config section:

    Configure OpenClaw Gateway logging

    Afterwards, check the file for errors and warnings. Hopefully it will reveal what's going wrong.

  • 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 OpenClaw. The AlwaysUp Event Log Messages page explains the messages that may appear.

  • Browse the AlwaysUp FAQ for answers to commonly asked questions and troubleshooting tips.

  • Contact us and we'll be happy to help!

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

Rock-solid for the past 20+ years!