How to Install Apache Solr on Arch Linux

In this tutorial, we'll show you how to install Apache Solr on Arch Linux. Solr is an open-source search platform that allows you to add search capabilities to your applications.

Prerequisites

Before installing Solr, make sure you have the following prerequisites installed on your system:

  • Java (version 8 or later)
  • Arch Linux package manager: pacman

Step 1: Download Apache Solr

First, you need to download the latest version of Apache Solr from the official website https://lucene.apache.org/solr/.

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

Step 2: Extract the Solr Archive

Next, extract the downloaded archive using tar command. We’ll extract the archive in /opt directory:

$ sudo tar -xvf solr-8.8.2.tgz -C /opt/

Step 3: Create a Solr User

It is recommended to run Solr using a dedicated user account. Let's create a new system user and assign ownership of the Solr directory:

$ sudo useradd --no-create-home --shell /bin/false solr
$ sudo chown -R solr:solr /opt/solr-8.8.2

Step 4: Start Solr

Now, switch to the solr user and start Solr using the following command:

$ sudo -u solr /opt/solr-8.8.2/bin/solr start

This will start Solr on port 8983. You can check the status of Solr by accessing http://localhost:8983 in your web browser.

Step 5: Create a Solr Core

To create a Solr core, we’ll use the solr create command:

$ sudo -u solr /opt/solr-8.8.2/bin/solr create -c my_core

Step 6: Verify Solr Core

Finally, verify the creation of the Solr core by accessing http://localhost:8983/solr/#/my_core/ in your web browser.

Conclusion

Congratulations! You have successfully installed Apache Solr on Arch Linux. You can now use Solr to add search capabilities to your applications.