Updated: 29 September 2026 · Applies to: Apache Solr 10.0 with Java 21 on cPanel & WHM servers and other AlmaLinux, Rocky Linux and RHEL 9 and 10 servers

Apache Solr is an open-source search server built on Lucene. Shops, content management systems and site-search plugins use it for fast full-text search. cPanel does not manage Solr, but you can run it on the same server as a separate service. The old instructions for Solr 6 and Java 8 are long out of date. We installed Solr 10.0.0 with Java 21 on AlmaLinux 9 using the steps below.

Before you start

  • Check which Solr version your application supports. Some need an older major version (for example Solr 9), and the steps are the same apart from the version number and Java version (Solr 9 needs Java 11 or later, Solr 10 needs Java 21).
  • Solr needs memory of its own. Plan at least 1 GB for a small index, on top of what your websites use.

1. Install Java 21

dnf install java-21-openjdk-headless lsof
java -version

2. Download and verify Solr

Get the current version from the Solr downloads page. The "slim" package leaves out optional modules and is enough for most sites:

cd /usr/local/src
curl -O https://dlcdn.apache.org/solr/solr/10.0.0/solr-10.0.0-slim.tgz
curl -O https://downloads.apache.org/solr/solr/10.0.0/solr-10.0.0-slim.tgz.sha512
sha512sum -c solr-10.0.0-slim.tgz.sha512

The last command must print OK.

3. Install Solr as a service

tar xzf solr-10.0.0-slim.tgz solr-10.0.0-slim/bin/install_solr_service.sh --strip-components=2
bash install_solr_service.sh solr-10.0.0-slim.tgz

The script creates a solr user, installs Solr in /opt/solr (a link to the versioned folder), keeps data and logs in /var/solr, writes the settings file /etc/default/solr.in.sh, and creates and starts the solr systemd service. If it stops with "Unable to auto-detect your *NIX distribution", install Solr manually as described in the Solr guide's "Taking Solr to Production" chapter.

4. Check that it runs, and only locally

systemctl status solr
ss -ltn | grep 8983
curl -s http://127.0.0.1:8983/api/node/system | head

Solr listens only on 127.0.0.1 by default (SOLR_HOST_BIND in /etc/default/solr.in.sh), which is right when your websites on the same server use it. Do not open port 8983 in the firewall: Solr's admin interface has no login by default.

5. Create an index for your application

sudo -u solr /opt/solr/bin/solr create -c mysite

Solr 10 starts in SolrCloud mode by default, so this creates a "collection". Point your application to http://127.0.0.1:8983/solr/mysite. Many applications ship their own Solr configuration; follow their instructions to use it instead of the default.

Memory

Set the Java heap in /etc/default/solr.in.sh, for example SOLR_HEAP="1g", then systemctl restart solr. Keep it well below the server's free memory.

Official documentation: Solr: taking Solr to production and Solr downloads.

Related services

Managed cPanel VPS

cPanel included; we handle updates, security and monitoring.

cPanel server management

hardening, migrations and 24/7 monitoring, with no long-term contract.

cPanel, Plesk and LiteSpeed licences

for VPS and dedicated servers, with installation help on demand.

Was this answer helpful?

Still stuck? Open a ticket