How to set up Redis in cPanel
Knowledgebase Article
}
Knowledgebase Article

Redis (REmote DIctionary Server) is an in-memory data structure store, widely used as a:
It supports advanced data types like strings, hashes, lists, sets, sorted sets, bitmaps, hyperloglogs, and geospatial indexes.
In simple terms, Redis can dramatically improve application speed when paired with traditional databases like MySQL or MariaDB.
While we refer to it as Redis, under the hood we provide KeyDB—a high-performance, fully compatible alternative. KeyDB is faster than Redis in many workloads thanks to its multithreaded architecture and improved memory management.
Your application doesn’t need to change—KeyDB behaves exactly like Redis, just better.
We offer Redis as a cPanel plugin, available with our Performance & Magento Hosting plans, as well as our Agency reseller plan.
You can activate Redis in just a few clicks:



This is required in order for PHP to be able to communicate with Redis.Redis on our platform runs over a UNIX socket, rather than a traditional TCP port. This is faster—around 116% better performance—because it avoids network overhead.
After enabling redis, you will be shown your unique Redis socket, which will be a full path including your account username:

You will need to use this socket address when configuring your application.
How you configure your application to use Redis depends on the app or Redis library, and how this supports socket-based connections.
1. Check for Dedicated Socket Support
Some applications and Redis client libraries allow you to specify a UNIX socket path directly via a setting like:
✅ If your application supports this, simply enter the full socket path shown in the Redis plugin in cPanel.
You usually won’t need to specify a port.
'unix_socket_path' => '/home/your-username/.kgix/redis/redis.sock'
2. If Your App Only Offers Host/Port Fields
Many applications assume Redis is running over TCP at something like 127.0.0.1:6379.
If your app doesn’t have a dedicated socket setting, you still may be able to connect by passing the socket in one of these formats:
Use the socket as the host and 0 as the port:
'host' => '/home/your-username/.kgix/redis/redis.sock',
'port' => 0
Many libraries (like phpredis) will understand this and use the socket.
Pass the socket and port together as a single string:
'/home/your-username/.kgix/redis/redis.sock:0'
This format is required by some tools or libraries that don't cleanly support separate socket + port inputs (e.g. certain command-line utilities or strict parsers).
3. Set a Unique Redis Database ID
Redis allows up to 16 databases per hosting account, numbered 0 to 15. Each use case in each application should use its own unique ID.
For example:
Set up Redis in your application with our step-by-step tutorials:
As Redis approaches your memory limit, it automatically begins removing old data to make room for new entries. This is done using a least-recently-used approach (LRU), meaning data that hasn't been accessed in a while is evicted first.
This eviction mechanism helps ensure:
If your application starts to evict important keys or slows down under load, you may need to increase the memory limit for Redis.
To do this:
⚠️ Important: Stopping Redis will clear all data currently in memory.
Any cached data, sessions, or backend store entries will be lost and must be regenerated by your application.
Plan the change for a quiet period if possible, especially if Redis is used for user sessions or critical caching.
Once Redis is active, click “Show Stats” in the plugin to view real-time metrics:

Clients
Memory
Cache Performance
Eviction
CPU
If you're comfortable with the command line, you can use the Redis CLI to interact directly with your instance over SSH. To do this, once logged into SSH you may run:
redis-cli -S /home/your-username/.kgix/redis/redis.sock
You’ll be able to run most standard Redis commands—except configuration changes, which are disabled for security.
Need Help?
Not sure how to configure your application for Redis? Confused about database IDs or memory limits? Want help interpreting your Redis stats?
We’re here to help.
Powered by WHMCompleteSolution