Ubuntu Linux

How to Install Apache Solr on Ubuntu Linux

Richard
Written by
Richard
May 28, 2022 Updated Apr 18, 2026 2 min read
How to Install Apache Solr on Ubuntu Linux

This post helps you install Apache Solr on Ubuntu Linux. Apache Solr is a fast, open-source search tool. It helps you search through large amounts of data quickly.

Why use Solr? It is great for building search features in apps. It handles complex searches like wildcards and grouping at a large scale.

What happens when done? You will have a working search engine running on your server, ready to index your data and provide results via a web interface.

How to download and install Apache Solr on Ubuntu Linux

Solr runs on Java. You need a modern version for the best performance and security. We recommend using OpenJDK 17 or 21.

Run these commands to install OpenJDK:

sudo apt update
sudo apt install openjdk-21-jdk

Check the version to make sure it is ready:

java --version

Next, visit the %%LNK0%% official Apache Solr download mirror to get the latest stable version (e.g., 9.8.x). Download the file using wget and the link you found.

Extract the installation script from the downloaded file:

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

Now, run the installation script. This uses the official systemd service integration to keep Solr running smoothly:

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

This creates a user named solr and sets up the service. You can manage the service with these commands:

sudo systemctl stop solr
sudo systemctl start solr
sudo systemctl status solr

To create a new search collection, run this command:

sudo su - solr -c "/opt/solr/bin/solr create -c mycollection"

By default, Solr only talks to the local machine. To allow remote access, edit the configuration file:

sudo nano /etc/default/solr.in.sh

Find the line for SOLR_JETTY_HOST and change it to:

SOLR_JETTY_HOST="0.0.0.0"

Save and close the file. Now, update your firewall to allow traffic on port 8983:

sudo ufw allow 8983/tcp

Restart the service to apply your changes:

sudo systemctl restart solr

Finally, open your web browser and go to http://your-server-ip:8983/ to see the admin console.

Terminal window showing commands to install Apache Solr on Ubuntu Linux

That is all you need to do to get started!

Conclusion

Apache Solr is a powerful tool for searching data. By installing it on Ubuntu with a modern Java runtime and proper firewall settings, you have a secure and fast search engine ready for your projects.

[1] [4949] [4949] [1]

Was this guide helpful?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, the owner and lead writer at Geek Rewind, is a tech enthusiast passionate about simplifying complex IT topics. His years of hands-on experience in system administration and enterprise IT operations have honed his ability to provide practical insights and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

2458 articles → Twitter

📚 Related Tutorials

How to Enable Root User on Ubuntu 24.04
Ubuntu Linux How to Enable Root User on Ubuntu 24.04
How to Install Live Helper Chat with Apache on Ubuntu Linux
CMS How to Install Live Helper Chat with Apache on Ubuntu Linux
How to Install Jitsi Meet on Ubuntu Linux
Ubuntu Linux How to Install Jitsi Meet on Ubuntu Linux
How to Create a Headless VM on Ubuntu Using VirtualBox
Ubuntu Linux How to Create a Headless VM on Ubuntu Using VirtualBox

Leave a Reply

Your email address will not be published. Required fields are marked *