Updated: 29 September 2026 · Applies to: Sphinx 3.9.1 on cPanel & WHM servers and other AlmaLinux, Rocky Linux and RHEL 9 and 10 servers (x86_64 and aarch64)
Sphinx is a full-text search server. Applications send it data to index and then query it, either through its own API or through SphinxQL, a SQL dialect spoken over the MySQL protocol. The old instructions compiled Sphinx 2.2 from source on CentOS. Current Sphinx 3 releases come as ready-built binaries, so there is nothing to compile. We ran Sphinx 3.9.1 on AlmaLinux 9 with the steps below.
1. Download and unpack
Take the current Linux build for your CPU from the Sphinx downloads page (linux-amd64 for most servers, linux-aarch64 for ARM), and compare its SHA1 checksum with the one on the page:
cd /usr/local/src curl -O https://sphinxsearch.com/files/sphinx-3.9.1-141d2ea-linux-amd64.tar.gz sha1sum sphinx-3.9.1-141d2ea-linux-amd64.tar.gz tar xzf sphinx-3.9.1-141d2ea-linux-amd64.tar.gz cp sphinx-3.9.1/bin/* /usr/local/bin/
This installs searchd (the server), indexer, indextool and wordbreaker.
2. Create a configuration
This minimal /etc/sphinx/sphinx.conf defines one real-time index that your application fills over SphinxQL:
common
{
datadir = /var/lib/sphinx
}
index products
{
type = rt
field = title, description
attr_uint = price
}
searchd
{
listen = 127.0.0.1:9306:mysql
log = /var/log/sphinx/searchd.log
pid_file = /var/lib/sphinx/searchd.pid
}
Sphinx can also build indexes directly from a MySQL query (a source section with type = mysql); see etc/sphinx-min.conf.dist in the package for an example.
mkdir -p /etc/sphinx /var/lib/sphinx /var/log/sphinx
3. Start it and test
searchd --config /etc/sphinx/sphinx.conf
mysql -h 127.0.0.1 -P 9306 -e "INSERT INTO products (id, title, description, price) VALUES (1, 'Blue wool jumper', 'Warm jumper for winter', 45)"
mysql -h 127.0.0.1 -P 9306 -e "SELECT id, price FROM products WHERE MATCH('jumper')"
In our test the query returned the row with id 1. Stop the server with searchd --config /etc/sphinx/sphinx.conf --stop.
4. Run it as a service
Create /etc/systemd/system/sphinx.service so it starts at boot:
[Unit] Description=Sphinx search server After=network.target [Service] Type=forking ExecStart=/usr/local/bin/searchd --config /etc/sphinx/sphinx.conf ExecStop=/usr/local/bin/searchd --config /etc/sphinx/sphinx.conf --stop PIDFile=/var/lib/sphinx/searchd.pid [Install] WantedBy=multi-user.target
systemctl daemon-reload systemctl enable --now sphinx
Keep listen on 127.0.0.1 when only websites on the same server use it, and do not open port 9306 in the firewall. On a cPanel server, Sphinx runs beside cPanel's own services; it does not use cPanel's MySQL server, only the MySQL protocol.
Official documentation: Sphinx 3 documentation and Sphinx downloads.