How to Install Solr on Ubuntu

Solr installs in more or less the same way with any recent version, on any recent version of Ubuntu.

Once you have provisioned your server, create a ssh terminal session.

ssh [email protected]

Update all the packages to most recent with the package manager.

sudo apt update

Install Java.

sudo apt install openjdk-11-jdk

Download the package from Apache.

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

Extract the install file.

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

Run the install script.

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

Check the server status.

sudo systemctl status solr

Check that you can turn solr on and off with systemctl.

sudo systemctl stop solr

sudo systemctl start solr

Make solr start on reboot.

sudo systemctl enable solr

Create a core.

sudo su - solr -c "/opt/solr/bin/solr create -c testCollection -n data_driven_schema_configs"