Run Solr as a Windows Service

How to Run Apache Solr as a Windows Service with AlwaysUp

Automatically start Solr when your server boots and keep it running 24/7 in the background. Survive accidental shutdowns and other failures!

Apache Solr is a Java based enterprise search platform from the Apache Lucene project.

Note: This tutorial focuses on Solr version 5 and later. For earlier versions, which are bundled with the Jetty servlet container, please follow our instructions to setup Solr V4 as a windows service.

To configure Solr to start as a windows service with AlwaysUp 9.6 and later:

  1. Download and install Solr, if necessary. We have expanded the zip file and moved its contents to C:\Solr so we will use that folder in the steps below.

  2. Download and install AlwaysUp, if necessary.

  3. Start AlwaysUp.

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

    Add Application

  5. As mentioned in the Running Solr documentation, Solr can be started using the SOLR.CMD file in the bin folder. To set that up on the General tab:

    • In the Application field, enter the full path to your SOLR.CMD file. Since we installed Solr in C:\Solr, this is:

      C:\Solr\bin\solr.cmd

      Be sure to use your own installation folder instead!

    • In the Arguments field, enter start.

    • In the Name field, enter the name that you will call the application in AlwaysUp. We have specified Solr but you can specify another name if you like.

    Apache Solr Windows Service: General Tab

  6. Click over to the Logon tab and enter the user name and password of the Windows account in which you installed and run Solr. Solr must run in this account so that it can find its settings and environment variables (JAVA_HOME, etc.).

    And while you're here, we suggest checking the When a user logs on, don't show the application's windows and tray icons box at the bottom. Doing so will prevent annoying popups from the Interactive Services Detection Service as the SOLR.CMD script shows its transient windows.

    Apache Solr Windows Service: Logon Tab

  7. Click over to the Startup tab and check the Ensure that the Windows Networking components have started box. This informs AlwaysUp that Solr needs TCP/IP networking support to do its work.

    Apache Solr Windows Service: Startup Tab

  8. The Solr documentation recommends running the SOLR.CMD script to safely stop the server, so let's set that up on the Extras tab:

    • In the Use this special command to stop the application field, enter the full command line to stop all instances of Solr. For our installation, this is:

      C:\Solr\bin\solr.cmd stop -all

    • And in the Wait for up to controls below, enter 30 seconds to give Solr extra time to stop smoothly.

    Apache Solr Windows Service: Extras Tab

  9. We're done configuring Solr so click the Save >> button to record your settings. In a couple of seconds, an application called Solr will show up in the AlwaysUp window. It is not yet running though, and the State column will say Stopped.

    Apache Solr Windows Service: Created

  10. To start Solr from AlwaysUp, choose Application > Start "Solr". In a couple of seconds, the Status column will change to Running. You should be able to access Solr from your web browser now (port 8983 by default):

    Apache Solr Windows Service: Running

  11. That's it! Next time your computer boots, Solr will start up immediately, in the background in Session 0, without anyone needing to log on. Please restart your server now and test that Solr works as expected after Windows boots up.

    And please feel free to edit Solr in AlwaysUp to check out the many other settings that may be appropriate for your environment. For example, boost Solr's priority to give it more resources on the server, send email alerts if it stops, etc.



Apache Solr not working properly as a Windows Service?

  • Visit 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 your application. The AlwaysUp Event Log Messages page explains the more obscure messages.
  • Review 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 9.7 New!

4.6 MB Installer
  • Unrestricted 30-day trial for new users; upgrade for existing users
  • Windows 10/8.1/8/7/XP & Windows Server 2012 R2/2008/2003
  • How to Install | EULA
Our customers include...


Compatible with Windows 10 (32 & 64-bit)

Windows Server 2012 Certified (32 & 64-bit)

Windows 8 Compatible (32 & 64-bit)

Compatible with Windows 7 (32 & 64-bit)

Works with Windows Server 2008 R2 (32 & 64-bit)



Over 68,000 installations, and counting!
 
AlwaysUp is number 1! Run as a Service with AlwaysUp

Rock-solid for the past 10+ years!