Skip to content
Follow
Ubuntu Linux

How to Install Apache Solr on Ubuntu Linux

Richard
Written by
Richard
May 28, 2022 Updated Sep 15, 2026 2 min read
How to Change Default Apps in Ubuntu
How to Change Default Apps in Ubuntu

Apache Solr on Ubuntu Linux is a free search program built on Apache Lucene that helps websites and apps find words and files fast by handling big piles of data. Setting up version 9.x on your Ubuntu computer takes just a few steps with the right terminal commands.

Advertisement

You get a working search system ready to add fast search bars and filters to your own projects.

⚡ Quick Answer

Install Apache Solr on Ubuntu by first installing OpenJDK. Then, download and extract the Solr archive, run the install script, and configure Solr for remote access if needed. Finally, allow traffic on port 8983 through your firewall and restart the service.

Advertisement

How to download and install Apache Solr on Ubuntu Linux

To install Apache Solr Ubuntu, you must first set up the Java Development Kit since the search engine runs on Java. You can install OpenJDK using your terminal, download the official Solr tarball package from the Apache archive website, and then run the included installation script to set up Solr as a system service.

Run these commands to install OpenJDK:

sudo apt update
sudo apt install openjdk-21-jdk

Check the version to make sure it is ready:

Advertisement

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

Advertisement

Run the installation script, which uses the official systemd service integration. This integration ensures Apache Solr keeps running smoothly in version 9.3.1 by managing the service automatically.

⚠️Warningsudo bash ./install_solr_service.sh solr-9.8.0.tgz

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

The `install.sh` script creates a `solr` user and sets up the Apache Solr service. You can manage the Apache Solr service using commands like `sudo systemctl status solr` to check its status.

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

Advertisement

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

Advertisement

Find the line for SOLR_JETTY_HOST and change it to:

SOLR_JETTY_HOST="0.0.0.0"

⚠️WarningSave and close the file.

Now, update your firewall to allow traffic on port 8983:

sudo ufw allow 8983/tcp

Advertisement

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
install solr on ubuntu linux

That is all you need to do to get started!

Advertisement

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]

How to install Apache Solr?

And click on the zip. Click on that and download it after some time. Here your download will be there to make it easier I've already downloaded here. And then after it's com download is completed.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips 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.

Advertisement

📚 Related Tutorials

How to Install Apache on Ubuntu Linux
Ubuntu Linux How to Install Apache on Ubuntu Linux
How to Install RabbitMQ on Ubuntu Linux
Ubuntu Linux How to Install RabbitMQ on Ubuntu Linux
How to Change Default Distro in Windows Subsystem for Linux
Windows How to Change Default Distro in Windows Subsystem for Linux

No comments yet — be the first to share your thoughts!

Leave a Comment

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