• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How To Install Apache Solr 8.5 on Ubuntu 18.04 & 16.04 LTS

Written by Rahul, Updated on June 28, 2020

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.

  • Install Apache Solr on CentOS, RedHat

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"

Sample output:

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.

  http://demo.tecadmin.net:8983/

Install Solr on Ubuntu

Now, select “MyCol1” under core selector drop down in left sidebar

Install Apache Solr on Ubuntu

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.

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

15 Comments

  1. Avatar Ryan Reply
    September 14, 2020 at 7:21 am

    I run this code to create core:

    sudo su – solr -c “/opt/solr-8.6.2/bin/solr create -c businesses -n data_driven_schema_configs”

  2. Avatar Kirit Reply
    January 22, 2020 at 4:26 am

    It’s working fine but it stopped automatically after sometime, status for solr service is below please advice.

    solr.service – LSB: Controls Apache Solr as a Service
    Loaded: loaded (/etc/init.d/solr; bad; vendor preset: enabled)
    Active: active (exited) since Tue 2020-01-21 16:38:58 UTC; 11h ago
    Docs: man:systemd-sysv-generator(8)
    Process: 22872 ExecStop=/etc/init.d/solr stop (code=exited, status=1/FAILURE)
    Process: 22930 ExecStart=/etc/init.d/solr start (code=exited, status=0/SUCCESS)
    Tasks: 0
    Memory: 0B
    CPU: 0

    Jan 21 16:38:49 colab systemd[1]: solr.service: Unit entered failed state.
    Jan 21 16:38:49 colab su[22935]: Successful su for solr by root
    Jan 21 16:38:49 colab systemd[1]: solr.service: Failed with result ‘exit-code’.
    Jan 21 16:38:49 colab su[22935]: + ??? root:solr
    Jan 21 16:38:49 colab systemd[1]: Starting LSB: Controls Apache Solr as a Service…
    Jan 21 16:38:49 colab su[22935]: pam_unix(su:session): session opened for user solr by (uid=0)
    Jan 21 16:38:58 colab solr[22930]: [230B blob data]
    Jan 21 16:38:58 colab solr[22930]: Started Solr server on port 8983 (pid=23000). Happy searching!
    Jan 21 16:38:58 colab solr[22930]: [14B blob data]
    Jan 21 16:38:58 colab systemd[1]: Started LSB: Controls Apache Solr as a Service.

  3. Avatar Mykola Reply
    December 12, 2019 at 10:35 am

    In step 2 you have invalid url, I think you can use this url.
    wget https://archive.apache.org/dist/lucene/solr/8.3.1/solr-8.3.1.tgz

    • Rahul Rahul Reply
      December 13, 2019 at 5:38 am

      Thanks Mykola, Tutorial has been updated

  4. Avatar pankaj jha Reply
    November 13, 2019 at 2:59 pm

    Thanks. I follow your steps and its Working fine

  5. Avatar chr Reply
    July 1, 2019 at 9:27 pm

    well, I could install it, until that point when I want to use SSL or login for admin as usually for a remote warehouse.. Could you explain that, too on newer Ubuntu and SolR.. 🙂

  6. Avatar OSHI Reply
    June 18, 2019 at 6:43 pm

    Great article, used to install solr 8.1.1 on ubuntu 16.04. But I cant open the examples provided.What should I follow?

  7. Avatar Roger Reply
    April 16, 2019 at 1:42 pm

    Nice and clear. Thanks. Works fine with Solr 8.0.0 too.

  8. Avatar Leon Talbot Reply
    April 1, 2019 at 5:26 pm

    Thank you for your article 🙂

  9. Avatar G Reply
    March 18, 2019 at 4:18 am

    Simple article but sweeTech at its best.
    Thanks and Be blessed by the Divine.

    Ganesh

  10. Avatar Carlos Reply
    July 19, 2018 at 4:13 pm

    Excellent guide! Thank you

  11. Avatar Hashmi Reply
    January 24, 2018 at 5:57 am

    Nice Article .. I have followed it working fine for me. now one doubt is after the creation of core will I have to create a schema.xml file .?? if yes then which location it will place.?? and how schema.xml will configure with solr .

    I am very new in Solr if possible please let me know.

  12. Avatar savi Reply
    November 9, 2017 at 12:51 pm

    great 🙂

  13. Avatar Arshad Reply
    March 17, 2017 at 8:00 am

    Nice article, Thank for the one.

  14. Avatar Bjørn Stenfeldt Reply
    October 23, 2016 at 8:54 pm

    I followed this guide and it worked. However, it didn’t say so directly in the text, but this will install Solr as a service that auto-starts when you (re)boot Ubuntu. I’m just saying, because I had a doubt and actually went and rebooted my Ubuntu server just to test if it would.

Leave a Reply Cancel reply

Popular Posts

  • How To Install Python 3.9 on Ubuntu 20.04 5
  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
  • How To Install NVM on macOS with Homebrew 0
  • How to Install .NET Core on Debian 10 0
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy