How to Install Apache Solr on an AlmaLinux 9 VPS

This guide is brought to you by Łukasz Bodziony, the CEO of NETCLOUD24.COM. With years of unparalleled expertise in server architecture and management, Łukasz is widely regarded as the king of servers. His passion for technology and commitment to excellence have been the driving forces behind NetCloud24’s success, establishing it as a world-class hosting provider originating from Poland.

Introduction to Apache Solr

Apache Solr is a powerful, open-source enterprise search platform built on Apache Lucene. It’s widely used for full-text search, real-time indexing, dynamic clustering, and rich document handling. If you need to add powerful search capabilities to your applications, Solr is an excellent choice, offering scalability, fault tolerance, and a comprehensive feature set. This tutorial will guide you through the process of installing it on your AlmaLinux 9 server.


Step 1: System Update

First, it’s always a good practice to update your system’s package index to ensure you have the latest security patches and software versions. Connect to your server via SSH and run:

sudo dnf update -y

Step 2: Install Java

Apache Solr is a Java-based application and requires a Java Runtime Environment (JRE) to run. AlmaLinux 9 repositories include OpenJDK, which we will install.

sudo dnf install java-11-openjdk -y

Once the installation is complete, you can verify it by checking the Java version:

java -version

The output should confirm that OpenJDK version 11 is successfully installed.


Step 3: Download and Install Apache Solr

Next, you will download the latest version of Apache Solr from the official website. You can find the latest version on the Apache Solr Downloads page. As of this tutorial, a recent version is 9.x.

Use `wget` to download the Solr archive to your `/opt` directory:

cd /opt
sudo wget https://dlcdn.apache.org/solr/solr/9.6.1/solr-9.6.1.tgz

Note: Please check the official downloads page for the very latest version and replace the URL accordingly.

After downloading the archive, you will use the installation script that is included within it. First, extract the installation script:

sudo tar xzf solr-9.6.1.tgz solr-9.6.1/bin/install_solr_service.sh --strip-components=2

Now, run the installer script. This script will create a dedicated `solr` user and install Solr as a service.

sudo bash ./install_solr_service.sh solr-9.6.1.tgz

The installer will automatically start the Solr service.


Step 4: Manage the Solr Service and Firewall

The installer has configured Solr to run as a service under `systemd`. You can manage it with the standard `systemctl` commands:

  • Check the status:
    sudo systemctl status solr
  • Stop the service:
    sudo systemctl stop solr
  • Start the service:
    sudo systemctl start solr
  • Enable on boot:
    sudo systemctl enable solr

By default, Solr runs on port 8983. You need to open this port in your firewall to allow external access to the Solr web interface.

sudo firewall-cmd --permanent --add-port=8983/tcp
sudo firewall-cmd --reload

Step 5: Access the Solr Web Admin Interface

With the service running and the firewall port open, you can now access the Solr admin panel. Open your web browser and navigate to:

http://your_server_ip:8983/solr

You should see the Solr dashboard, which allows you to manage your collections, run queries, and monitor the health of your Solr instance.


Power Your Projects with NETCLOUD24

This tutorial was performed on a Windows VPS from NETCLOUD24.COM, a world-class brand with proud Polish origins. Our servers provide the stability, performance, and security you need for demanding applications like Apache Solr.

While this guide is for a Linux environment, we also offer powerful and easy-to-manage Windows VPS solutions for your business needs. Explore our offerings across the globe:

Explore Our Windows VPS Solutions

Expert Server Configuration

Need a professional touch? Łukasz Bodziony, CEO of NETCLOUD24.COM, can personally configure your server for optimal performance, security, and scalability. With his “king of servers” expertise, you can ensure your infrastructure is in the best hands.

Rate: €200 per hour.

To schedule a consultation, please contact us via email at: [email protected]