DebianDebian Based

How To Install Apache Solr on Debian 12

Install Apache Solr on Debian 12

In this tutorial, we will show you how to install Apache Solr on Debian 12. Apache Solr is a powerful open-source search platform built on Apache Lucene. It offers advanced full-text search capabilities, real-time indexing, and a wide range of features that make it an ideal choice for applications requiring fast and efficient search functionality.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Apache Solr on Debian 12 (Bookworm).


Before proceeding with the installation of Apache Solr on Debian 12, ensure you meet the following requirements:

  • A server running one of the following operating systems: Debian 12 (Bookworm).
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies.
  • A user account with sudo privileges to execute administrative commands.

Install Apache Solr on Debian 12 Bookworm

Step 1. Before installing any packages, it’s crucial to update your system’s package list to ensure you have access to the latest versions. Open a terminal and run the following command:

sudo apt update
sudo apt upgrade

Step 2. Installing Java.

Apache Solr is written in Java, so the first step is to install a Java Development Kit (JDK) on your Debian 12 server. We recommend using OpenJDK 11, which is an open-source implementation of the Java platform. Now install OpenJDK 11 using the apt package manager:

sudo apt install openjdk-11-jdk

Verify the Java installation by checking the version:

java -version

Step 3. Installing Apache Solr on Debian 12.

Visit the official Apache Solr downloads page and copy the link to the latest stable release. At the time of writing, the latest version is 9.5.0:


Extract the downloaded tar.gz file:

tar xzf solr-9.5.0.tgz

Move into the extracted Solr directory:

cd solr-9.5.0

The Solr directory structure consists of the following key components:

  • bin: Contains executable scripts for starting and managing Solr.
  • contrib: Contains additional plugins and extensions for Solr.
  • dist: Contains the main Solr JAR files and dependencies.
  • docs: Contains Solr documentation.
  • example: Contains example configurations and sample data.
  • server: Contains the Solr server files and configurations.

To run Solr as a system service, we will use the script provided in the Solr installation directory. Now navigate to the Solr installation script directory:

cd bin

Run the script with the path to the Solr tar.gz file:

sudo ./ ../solr-9.5.0.tgz

This script performs the following actions:

  • Creates a dedicated solr user and group for running Solr.
  • Copies the Solr files to /opt/solr-9.5.0.
  • Creates a symbolic link /opt/solr pointing to the Solr installation directory.
  • Sets up an init script to manage the Solr service.

Once the installation script completes, start the Solr service:

sudo systemctl start solr

Verify that the Solr service is running:

sudo systemctl status solr

Step 4. Configure Firewall.

By default, Solr runs on port 8983. To access the Solr web interface from a remote machine, you need to allow incoming traffic on this port.

If you are using UFW (Uncomplicated Firewall) on your Debian 12 server, follow these steps to open port 8983:

sudo ufw allow 8983/tcp
sudo ufw reload

Step 5. Accessing the Apache Solr Web Interface

Now that Solr is installed and running, you can access its web interface to create and manage your search collections. Open a web browser and navigate to http://your_server_ip:8983/solr.

Install Apache Solr on Debian 12 Bookworm

Congratulations! You have successfully installed Apache Solr. Thanks for using this tutorial to install the latest version of the Apache Solr on Debian 12 Bookworm. For additional help or useful information, we recommend you check the official Apache website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!


r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button