Apache Solr Installation on Ubuntu 3

In this post we will discuss about the basic introduction of Apache Solr and we will also describe the procedure for Apache Solr Installation on Ubuntu Machine.

Apache Solr Overview:

What is Apache Solr?

Apache Solr is another top level project from Apache Software Foundation, it is an open source enterprise search platform built on Apache Lucene. As Apache Solr is based on open source search engine Apache Lucene, some times these two words are used interchangeably Lucene/Solr.

Solr Features:

  • Solr provides a blazing-fast search platform
  • Supports Full-text search, hit highlighting, faceted search, dynamic clustering
  • Solr provides easy integration with databases and rich set of document handling. We can easily export XML, Word, PDF, etc…documents to Solr.
  • Solr is highly scalable  by its distributed search and index replication feature.
  • Solr is written in Java and runs inside a Java servlet container such as Tomcat, Jetty, or Resin.
  • Solr is highly reliable and fault tolerant, providing distributed indexing, replication and load-balanced querying, automated failover and recovery, centralized configuration.
  • Supports Near Real-Time Indexing on data collected via MorphlineSink in Flume setup.
  • Optimized for high volume traffic and Standards are based on Open Interfaces – XML, JSON and HTTP. We can see the search results in any of the formats – JSON, XML, Text, etc…

Apache Solr Installation on Ubuntu:

In this section we will install Apache Solr 4.10.2 (The latest stable release of solr at the time of writing this post) on Ubuntu 14.04 machine.


  • As Solr is written in Java, Apache Solr requires at least Jdk 1.7 to be available on the machine. Check the java version with $ java -version command on terminal.
  • As Solr runs inside a Java servlet container, we need any Java servlet container (Tomcat, Jetty or Resin) to be available for Solr to run. By default Apache Solr distribution contains working Jetty Java Servlet container, with optimized settings for Solr, inside the example directory. For example tutorials we can use the Jetty servlet container but in this post we are using the famous Tomcat as servlet container.

Installation Procedure:

Java Installation:

  • First check whether java version is JDK1.7 or later if not re-install the JDK by purging the older version first.

Tomcat Installation:

  • Tomcat is an open source implementation of the Java Servlet and JavaServer Pages technologies, released by the Apache Software Foundation. Install latest stable version of Tomcat if it is not available already on Ubuntu machine. Below are the installation instructions for Tomcat7 on ubuntu 14.04.

Verify the status of Tomcat7 service with the below command:

or we can also verify the Tomcat Installation at http://hostname or IP address:8080. If we receive message similar to below then Tomcat installation is successful.

We can start/stop/restart or check tomcat7 service status with below commands:

There are three important directories for Tomcat in Ubuntu installation:

  • /etc/tomcat7/Catalina : for configuration of new apps
  • /usr/share/tomcat7/lib : Library containing required jar files or properties files
  • /usr/share/tomcat7-root : for webapps

The alternative path to Tomcat, called CATALINA_BASE, is /var/lib/tomcat7

Configure Tomcat Web Interface

By default, no user is included in the “manager-gui” role, which is required to operate the “/manager/html” web application. As we open solr in web UI, we must define a user. In order to use the manager webapp we must add a login to our Tomcat server. We will do this by editing the tomcat-users.xml file:

Add the below lines in between <tomcat-users> </tomcat-users> tags to add a new user.

Save and quit the tomcat-users.xml file.

Solr Installation:

  • Download the latest stable binary tarball version of Apache Solr from Apache download mirrors. In this post we are using solr-4.10.2.tgz.
  • Copy the gzipped tarball into our preferred location of installation directory (usually into /usr/lib/solr) and extract its contents.

From here on wards lets call /usr/lib/solr/solr-4.10.2/example as SOLR_HOME.

  • As we are installing Solr with Multicore, we will copy the solr.war file from $SOLR_HOME/webapps/solr.war into $SOLR_HOME/multicore/

Integrate Solr into Tomcat:

  • At very first we need to copy the required jar files and log4j.properties files for solr from Solr distribution into Tomcat lib directory.

  •  To add Solr into Tomcat Catalina config, we need to create solr.xml file in /etc/tomcat7/Catalina/localhost/ with below properties.

Restart Tomcat:

To take effect of the above configuration changes, restart the tomcat server with the below command.

Verify Solr Installation:

Verify the above installation procedure by accessing Apache Solr at address http://localhost:8080/solr. We should be able to see the Solr Admin screen as shown in below screen.

Solr Admin

So, we have successfully installed Tomcat, Apache Solr and integrated them correctly. Now we can export the data documents into Solr and perform indexing, querying on the files, we will discuss this topic in the upcoming posts under this category.

Profile photo of Siva

About Siva

Senior Hadoop developer with 4 years of experience in designing and architecture solutions for the Big Data domain and has been involved with several complex engagements. Technical strengths include Hadoop, YARN, Mapreduce, Hive, Sqoop, Flume, Pig, HBase, Phoenix, Oozie, Falcon, Kafka, Storm, Spark, MySQL and Java.

Leave a Reply to Nabile Abeltan Cancel reply

Your email address will not be published. Required fields are marked *

3 thoughts on “Apache Solr Installation on Ubuntu