Auto-Restart RavenDB when it fails

How to Automatically Restart the RavenDB Windows Service When it Stops

Monitor RavenDB and keep it running 24/7, even if it crashes or stops for any reason. Achieve 100% uptime today


Last Updated on November 18, 2026

RavenDB is an advanced, transactional document database. It can be installed as a Windows Service to start promptly at boot:


To monitor the RavenDB Windows Service with Service Protector:

  1. Download and install Service Protector, if necessary.

  2. Start Service Protector.

  3. Select Protector > Add to open the Add Protector window:

    Add Protector

  4. On the General tab, choose RavenDB from the list of services in the Service to protect field. The green circle indicates that RavenDB is already running:

    Choose the RavenDB Windows Service

  5. Next, let's set up a web server health check. With that in place, Service Protector will restart RavenDB if it ever stops serving pages.

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

      RavenDB Windows Service: Add a 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:

      Add a web server sanity check

    3. Enter the URL that Service Protector should monitor. This could be a dedicated health check address or anything else you think is appropriate. Both HTTP and HTTPS are supported.

      http://127.0.0.1:8080 worked for our installation:

      Enter the health check URL

      Click Next to continue.

    4. Specify how often Service Protector should fetch the URL. The default of every 5 minutes should be fine but you can check more often if you like.

      After you're done, click Next to move on:

      How often to check the URL

    5. And finally, confirm your settings:

      Confirm your sanity check settings

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

  6. We're now done configuring the essentials for RavenDB so click the Save button to record your settings. A new entry called RavenDB will show up in the main window.

    The green shield icon indicates that Service Protector is actively monitoring RavenDB:

    RavenDB Windows Service: Protected

  7. That's it! Next time your computer boots, RavenDB will start as normal and Service Protector will begin monitoring the service to quickly restart it if it fails or stops for any reason.

    We encourage you to edit RavenDB in Service Protector and check out the many other settings that may be appropriate for your situation.

    For example, send an email when the service fails, restart RavenDB during the early morning to diminish the effects of memory leaks, etc.


Trouble protecting the RavenDB Windows Service?

  • From Service Protector, select Protector > Report Activity > Today to bring up an HTML report detailing the interaction between Service Protector and RavenDB.

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

  • Contact us and we will be happy to help!