Apache Solr is an open source search platform written on Java. Solr provides full-text search, spell suggestions, custom document ordering and ranking, Snippet generation and highlighting. This tutorial will help you to install Apache Solr 8.5 on Ubuntu 19.10, 18.04, 17.10, 16.04, 14.04 systems.
Step 1 – Install Java
Apache Solr 7 required Java 8 or greater to run. Make sure your system fulfill Java requirements of Apache Solr. If you don’t have java installed on your system visit below articles.
sudo apt install openjdk-11-jdk
Verify active Java version:
java -version openjdk version "11.0.4" 2019-07-16 OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3) OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed mode, sharing)
You can also follow this tutorial to install Java on Ubuntu Linux.
Step 2 – Install Apache Solr on Ubuntu
Now download the required Solr version from its official site or mirrors. Or simply use the following command to download Apache Solr 8.5.2.
cd /opt wget https://archive.apache.org/dist/lucene/solr/8.5.2/solr-8.5.2.tgz
Now extract Apache Solr service installer shell script from the downloaded Solr archive file and run the installer using the following commands.
tar xzf solr-8.5.2.tgz solr-8.5.2/bin/install_solr_service.sh --strip-components=2 sudo bash ./install_solr_service.sh solr-8.5.2.tgz
Step 3 – Start / Stop Solr Service
Solr is configured as a service on your system. You can simply use the following commands to Start, Stop and check the status of Solr service.
sudo service solr stop sudo service solr start sudo service solr status
Step 4 – Create First Solr Collection
After the successful installation of Solr on your system. Create the first collection in Apache Solr using the following command.
sudo su - solr -c "/opt/solr/bin/solr create -c mycol1-n data_driven_schema_configs"
Created new core 'mycol1'
Step 5 – Access Solr Admin Panel
Default Solr runs on port 8983. You can access Solr port in your web browser using server IP or domain name pointed to that server and you will get Solr dashboard.
Now, select “MyCol1” under core selector drop down in left sidebar
Here you can view statics of created collection in previous steps named “mycol1”. Click on “Core Selector” on the left sidebar and select created collection.