On RHEL and CentOS.
Last updated on
30 April 2025
Attached is a startup script for RHEL / CentOS that will start your Apache Solr server at startup and cleanly shut it down at shutdown.
Download the script attached to this page, rename it to "solr", and put it at /etc/init.d/solr.
Edit the line starting with SOLR_DIR to make sure it's pointing to the location where your solr installation lives.
Make the script executable:
sudo chmod a+rx /etc/init.d/solr
Now install the script using chkconfig:
sudo chkconfig --add solr
This will add the script to runlevels 3 and 5, so solr will start once the system is up. Check to make sure that things are properly set up by typing
chkconfig --list
You should see solr among the various services. You should also be able to use the service command to stop and start solr:
sudo service solr stop
Stopping Solr
sudo service solr start
Starting Solr
sudo service solr restart
Stopping Solr
Starting Solr
Help improve this page
Page status: Not set
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion