How to Install Apache Solr on macOS

Apache Solr is a popular search engine based on the Lucene library. It is used by many websites and applications to provide search functionality. In this tutorial, we will show you how to install Apache Solr on macOS.

Prerequisites

Note: If you don't have Java installed on your machine, you can download it from java.com.

Installation Steps

  1. Download Solr

    Download the latest version of Apache Solr from the official website. Choose the appropriate version depending on your operating system. For macOS, select the "macOS" link under the "Binary distributions" section.

  2. Extract the Archive

    Extract the downloaded archive file to a preferred location on your computer, like ~/Documents/solr-8.7.0.

    $ tar xzf solr-8.7.0.tgz solr-8.7.0/bin/install_solr_service.sh --strip-components=2
    
  3. Install Solr as a Service

    Run the install script to install Solr as a service.

    $ sudo ./install_solr_service.sh solr-8.7.0.tgz
    
  4. Start Solr

    Start Solr service using launchctl command.

    $ sudo launchctl load /Library/LaunchDaemons/com.apache.solr.plist
    

    To confirm Solr is running, verify the service status.

    $ sudo launchctl list | grep solr
    

    Output:

    7199    0    com.apache.solr
    
  5. Access Solr

    To access Solr, open a web browser and go to the following URL:

    http://localhost:8983/solr/
    

    Here, you can check the Solr admin GUI and it should be up and running.

Congratulations! You have successfully installed and set up Apache Solr on macOS.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!