Solr uses a REST-like API that allows storing documents (indexing) via JSON, XML, CSV, or binary over HTTP. You query data via HTTP GET and receive JSON, XML, CSV, or binary results. Solr also provides advanced full-text search capabilities, and a scalable, and responsive admin interface. When looking for an enterprise search platform that enables phrases, wildcards, joins, and grouping at a large scale, you might want to take a look at Solr. Below we’ll show you how to download and install the latest version on Ubuntu and run your enterprise search platform on your own Linux server.

How to download and install Apache Solr on Ubuntu Linux

As mentioned above, Apache Solr is a fast, open-source search platform built on Apache Lucene and Java. To install Solr, you must first install Java. The open-source Java should work great with Solr. Run the commands below to install OpenJDK on Ubuntu Linux. This will install the current stable version of OpenJDK for Ubuntu Linux. To check the version of Java installed, run the commands below: That should output similar lines as shown below: Once Java is installed, continue below to download Solr and install it. Now to Java is installed, run the commands below to download Solr version 9.0. Visit the Solr download page and see if there are other versions available to install. Next, extract the downloaded file using the tar command. When version 9.0 is downloaded and extracted, run the commands below to install it. The installation process will create a user with the name solr on your system. A default port 8983 will be used for Solr as well. Once Solr is installed, you can run the commands below to stop, start and check Solr service status. The status commands will output similar lines as shown below. Apache Solr stores data in a collection, which is a single logical index that uses a separate solrconfig.xml file with a single index schema. You can create a new collection using Solr built-in utility or APIs. Below is how to create a new collection named testcol1. After successful creation, you should see a message similar to the one below: Restart Solr services after creating new collections. By default, you can access Solr on the localhost machine only. If you want to provide external access, you will have to edit the Solr config file and allow access from remote systems. Run the commands below to open the Solr config file. Then change the highlighted line to all zeros to allow external clients. Save the file and exit. Restart Solr after editing the file. If you have a firewall enabled on your Ubuntu server, you may have to run the commands below to allow traffic from remote systems. Finally, open your browser and browse to the server name followed by port number 8983. You should see the Solr admin console. That should do it! Conclusion: This post showed you how to install Apache Solr on Ubuntu Linux. If you find any error above or have something to add, please use the comment form below.