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 9.0 on Fedora 36/35/34/33/32 Linux systems.
Step 1 – Prerequsities
Apache Solr 9.0 required the Java Runtime Environment (JRE) version 11 or higher. If the system doesn’t have JRE installed, use the following command to install OpenJDK 17 on the Fedora system.
sudo dnf install java-17-openjdk
You can check the installed Java version at the command line using:
java -version
openjdk 17.0.3 2022-04-19
OpenJDK Runtime Environment 21.9 (build 17.0.3+7)
OpenJDK 64-Bit Server VM 21.9 (build 17.0.3+7, mixed mode, sharing)
Step 2 – Install Apache Solr on Fedora
Now download the required Solr version from its official site or mirrors. You may also use the below command to download Apache Solr 9.0 from its official website. After that extract the installer script.
wget https://dlcdn.apache.org/solr/solr/9.0.0/solr-9.0.0.tgz
tar xzf solr-9.0.0.tgz solr-9.0.0/bin/install_solr_service.sh --strip-components=2
Then execute the installer script with bash shell followed with downloaded Archive file. The command will be like below:
sudo bash ./install_solr_service.sh solr-9.0.0.tgz
This will create a user with the name solr in your system and finish the installation process. After that start the service default Solr port 8983.
Step 3 – Managing Apache Solr Service
Use the following commands to Start, Stop and check the status of the Solr service.
- Start Solr service:
sudo service solr start
- Stop Solr service:
sudo service solr stop
- Restart Solr service:
sudo service solr restart
- Check the Solr service status:
sudo service solr status
OutputFound 1 Solr nodes: Solr process 30891 running on port 8983 { "solr_home":"/var/solr/data", "version":"9.0.0 a4eb7aa123dc53f8dac74d80b66a490f2d6b4a26 - janhoy - 2022-05-05 01:00:08", "startTime":"2022-05-26T07:52:42.644Z", "uptime":"0 days, 0 hours, 0 minutes, 14 seconds", "memory":"61.4 MB (%12) of 512 MB"}
Step 4 – Create a New Solr Collection
Apache Solr stores values under a collection. A collection is a single logical index that uses a separate solrconfig.xml configuration file with a single index schema.
You can create a new collection using the Apache Solr command-line utility or using Solr APIs. The below command will create a new collection in Solr named mycol1.
sudo su - solr -c "/opt/solr/bin/solr create -c mycol1 -n data_driven_schema_configs"
Output:Created new core 'mycol1'
Step 5 – Allow Solr Access on Public Network
The default Apache Solr runs on localhost only. To allow the Solr server publically accessible over networks, edit the /etc/default/solr.in.sh configuration file.
sudo vim /etc/default/solr.in.sh
Search for the SOLR_JETTY_HOST variable. Uncomment it by removing the starting hash (#) symbol. Set the value to “0.0.0.0”.
Save the configuration file and restart Solr service:
sudo service solr restart
You also need to open the port in the system firewall. The below-mentioned command will open port 8983 in firewalld.
sudo firewall-cmd --permanent --add-port=8983/tcp
sudo firewall-cmd --reload
Step 6 – Access Solr Web Admin Panel
The default Apache Solr runs on port 8983. You can access the Solr port in your web browser and you will get the Solr dashboard.
I already have mapped the domain solr.tecadmin.net with the Fedora server IP address.
http://solr.tecadmin.net:8983/

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.

Conclusion
This tutorial helped you to install Apache Solr on the Fedora Linux system.
11 Comments
We recommend installing the ‘lsof’ command for more stable start/stop of Solr
id: solr: no such user
Creating new user: solr
Extracting solr-8.4.1.tgz to /opt
Installing symlink /opt/solr -> /opt/solr-8.4.1 …
Installing /etc/init.d/solr script …
Installing /etc/default/solr.in.sh …
Service solr installed.
Customize Solr startup configuration in /etc/default/solr.in.sh
su: Permission denied
su: Permission denied
Where do I need to download it before install ? opt or local? Do I have to command with root account ?
Thanks
Download it under /tmp directory.
Here small update for Centos 7.5 + Solr 7.4
Install Java
sudo yum install java-1.8.0-openjdk
Install Solr
cd /usr/local
wget http://apache.lauf-forum.at/lucene/solr/7.4.0/solr-7.4.0.tgz
tar xzf solr-7.4.0.tgz solr-7.4.0/bin/install_solr_service.sh –strip-components=2
sudo bash ./install_solr_service.sh solr-7.4.0.tgz
Core creation
sudo su – solr -c “/opt/solr/bin/solr create -c NAMEOFCORE -n data_driven_schema_configs”
Thanks Rahul, In my installation I got stuck in step 4 of this manual.
after running: sudo su – solr -c “/usrlocal/solr/bin/solr create -c mycol1 -n data_driven_schema_configs”.
i get error : /usrlocal/solr/bin/solr: No such file or directory
which is true – this path does not exist.
I tried /usr/local/… thinking that you had a typo but didnt work…
I also tried creating those directories that didnt help.
By now you probably understand that i don’t have much experience with linux 🙂
can you please explain what am i doing wrong?
Thanks Atias, I have fixed typo in command. What error are you getting with the correct path command?
Hi,
# sudo su – solr -c “/opt/solr/bin/solr create -c gettingstarted -n data_driven_schema_configs”
ERROR: Failed to create new core instance directory: /opt/solr/server/solr/gettingstarted
I get the above error while create a core. How do I fix this?
sol[r]= S%#t Outta luck [redo]
Same Error i have
WARNING: Using _default configset with data driven schema functionality. NOT RECOMMENDED for production use.
To turn off: bin/solr config -c bck43 -p 8983 -action set-user-property -property update.autoCreateFields -value false
ERROR: Failed to create new core instance directory: /opt/solr-8.4.1/server/solr/bck43
Thank you so much Rahul. You saved me buddy.
Thanks TecAdmin, I have successfully installed Solr … How do I insert data to collection?