Install Apache Solr and Tomcat under Windows

Solr logo

Installing and getting Solr up and running is straight forward, as long as you follow these simple steps. I ran into problems myself trying to get Solr starting up under Tomcat, even after reading several posts explaining how to, which is why I wrote this post, explaining all the necessary steps. Feel free to make a comment, if you have any questions or run into problems.

Pre Requirements:

1. Download Java SDK version 7 or above from:

2. Download Apache Tomcat from Apache Software Foundation;

3. Download the latest version of “Solr”:

Installation and Configuration:

– Open, navigate to \example\solr and extract the directories and files to c:\solr\, so it contains; bin, collection1, README.txt, solr.xml and zoo.cfg

– Again in navigate to \example\lib and extract all the jar-files into c:\Tomcat\lib\. Repeat the same procedure with the jar-files in \examples\lib\ext.

– In navigate to \example\webapps and extract solr.war to c:\Tomcat\webapps\. If the file is called solr-versionNumber.war, rename it to solr.war

3. In c:\Tomcat\conf\Catalina\localhost created a file called “solr.xml” with following content, where you specify solr docBase “c:/Tomcat/webapps/solr.war” and enviroment value “/Tomcat/webapps/”.

<?xml version="1.0" encoding="UTF-8"?>
<context docBase="c:/Tomcat/webapps/solr.war" debug="0" crossContext="true">
    <environment name="solr/home" type="java.lang.String" value="/Tomcat/webapps/" override="true"></environment>

4. Open up c:\Tomcat\webapps\solr\WEB-INF\web.xml and uncomment the following and replace “/put/your/solr/home/here” with your solr location


During these steps you might have to stop and start your Apache Tomcat to be able to write to the files and reload the changes. To stop/start Apache Tomcat, click the Apache icon in the task bar and click “Stop service / Start service”.

Restart Apache Tomcat Windows

You should now be able to navigate to http://localhost:8080/solr/ and get the Solr admin site, presuming you installed Apache Tomcat on port 8080 (as per default)

Solr 4.4.0 admin page

If you run into problems, you can view the Catalina log located in c:\Tomcat\logs\

*** Notation If you got error 404 and 503, please go to

1. C:\Tomcat\webapps and delete directory named [solr], wait until new directory is called [solr] generate, go to C:\tomcat\webapps\solr\WEB-INF and edit file web.xml in section [Solr Home]

2. Go to Apache Tomcat Properties (Taskbar Notification -> right click on Apache Tomcat -> Configure) , in Java Tab; add [-Dsolr.solr.home=C:\solr] in the bottom line

Or in (/usr/share/tomcat/bin/

JAVA_OPTS="-Dsolr.solr.home=/etc/tomcat6/solr -Djava.awt.headless=true -server -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"

Copy from: