Install Apache Solr on Ubuntu 20.04

Updated on November 21, 2023
Install Apache Solr on Ubuntu 20.04 header image

Introduction

Apache Solr is an open-source, highly scalable, reliable, and fault-tolerant search tool based on Java. It supports NoSQL and database queries through REST APIs such as Elasticsearch. In addition, it stores data and provides distributed indexing, replication, automated fail-over and recovery, and load-balanced querying to achieve data querying in near real-time. In this article, you will learn how to install Apache Solr on Ubuntu 20.04 Server.

Prerequisites

1. Install Java

Install Java.

$ sudo apt install default-jdk -y

Verify the Java installation.

$ java -version

2. Install Apache Solr

To download the latest version of Apache Solr, go to the Apache official download website.

Download Apache Solr.

$ sudo wget https://archive.apache.org/dist/lucene/solr/8.9.0/solr-8.9.0.tgz

Extract the downloaded archives.

$ sudo tar xzf solr-8.9.0.tgz

Install Apache Solr.

$ sudo bash solr-8.9.0/bin/install_solr_service.sh solr-8.9.0.tgz

Check the status of the Apache Solr service.

$ sudo systemctl status solr

Enable the Apache Solr service to start on system boot.

$ sudo systemctl enable solr

Allow port 8983 through the UFW firewall.

$ sudo ufw allow 8983

To access the Apache Solr web interface, go to your browser and enter http://serverIP:8983. For example:

http://192.0.2.11:8983

Conclusion

You have successfully installed Apache Solr. You can now begin creating new Solr collections via the web dashboard.

  • Collection is a logical index spread across multiple servers.
  • Core is that part of the server which runs one collection.

More Information

For more information on Apache Solr, please see the official documentation.