Install Solr Search on Ubuntu
October 19, 2013

Hello to everyone,

I’d like to share with you the procedure I use to install Apache Solr search server on my Ubuntu machine.

Apache Solr is, as indicated on the official website “Solr is the popular, blazing fast open source enterprise search platform from the Apache Lucene project. ”  It is written in Java so that you will need  an application server like Tomcat or JBoss for example ( by the way Solr is shipped with Jetty) so:

First step open your terminal and type:

sudo apt-get install tomcat

This will install Tomcat as a service. After installing it type

sudo service tomcat7 stop

You don’t need Tomcat running while installing solr; so next step download Apache Solr from here, uncompress the package in a folder.

Now go to /var/www and create a folder (e.g. solr_test), opent the folder where you previously extracted Solr and copy these folders/files to your new folder in /var/www/

  1. Bin
  2. Dist
  3. solr.xml
  4. zoo.cfg
  5. from /dist/ copy solr-4.4.xx.war,
  6. from /example/solr copy collection1 folder
  7. from /dist copy to /usr/share/tomcat7/lib  the following files (since Apache Solr doesn’t use log4j for logging)
    • slf4j-log4j12-1.6.6.jar
    • slf4j-api-1.6.6.jar
    • log4j-1.2.16.jar
    • jul-to-slf4j-1.6.6.jar
    • jcl-over-slf4j-1.6.6.jar

now, we must say to Tomcat where is the Solr application; to accomplish this, open the terminal and go to /etc/tomcat7/Catalina/localhost. This is the folder were some of the files needed fot the Tomcat configuration are stored, so now type

sudo touch solr_test.xml

Open the file with your favourite text editor and add the following lines:

<?xml version="1.0" encoding="utf-8"?>
<Context docBase="/var/www/solr/solr-4.4.0.war" crossContext="true">
    <Environment name="solr/home" type="java.lang.String" value="/var/www/solr" override="true"/>

Change the paths according to your system, change the permissions of your /var/www/solr_test folder and restart Tomcat in this way

sudo chown tomcat7.root /var/www/your_folder -R
sudo service tomcat7 start

Now, open your favourite browser and go to:


If everything is correct, your Solr search server should be ready .



Leave a Reply

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.