Every time a dynamic WordPress page loads or someone hits your wp-admin dashboard, MySQL chugs through dozens of repetitive SQL queries. Sticking Redis in front of your database caches those query results straight in RAM, knocking database response times from 150ms+ down to single digits.
Hostinger includes Redis on its higher-tier plans, but turning it on isn’t quite a one-click affair. Between CLI version mismatches, socket connection quirks, and staging site collisions, a few things can trip you up. Here is how I get Redis wired up, configured properly in wp-config.php, and running cleanly on Hostinger.

Prerequisites and Plan Requirements
Hostinger gates Redis behind specific tiers. If you’re on Single or Premium shared hosting, you won’t have access to the daemon. You’ll need at least Business Web Hosting or any Cloud plan (Startup, Professional, Enterprise).
Before touching anything, double-check your environment:
- A Hostinger Business or Cloud tier plan
- PHP 8.1, 8.2, or 8.3 active on the site
- SSH access toggled on in hPanel
- Admin access to your WordPress dashboard
If you’re running WooCommerce or a membership site where users are constantly logged in and bypassing full-page cache, pairing Redis with your stack is easily the best way to reduce WordPress TTFB on Hostinger.
Enable Redis Inside Hostinger hPanel
Hostinger handles the Redis daemon at the container level. You don’t have to build binaries or install packages via apt, but you do need to turn on both the PHP extension and the cache service.
First, enable the PHP extension:
- Head to Websites in hPanel and hit Manage next to your site.
- In the sidebar, jump to Advanced > PHP Configuration.
- Click the PHP Extensions tab.
- Find
redisin the list, check the box, and hit Save.
Next, flip on the service itself. In the sidebar under WordPress, go to Overview. Look for the Object Cache (Redis) toggle and switch it on. Hostinger will spin up your account’s Redis instance and give you the connection details—take note of whether it hands you a TCP port or a Unix socket path.
Verify the PHP Redis Extension via SSH
Don’t assume hPanel’s changes carried over everywhere. A common trap on Hostinger is that the web worker gets the new PHP extension, but your SSH CLI environment still points to an older PHP binary that lacks it.
Drop into your server over SSH:
ssh -p 65002 u123456789@your-server-ip.hostinger.comCheck if the CLI sees the compiled extension:
php -m | grep -i redisIf it outputs redis, you’re good. If it returns nothing, your CLI is likely running a different PHP version than your web server. Check what the terminal is using:
php -vIf there’s a mismatch, map your CLI to the versioned binary in your ~/.bashrc (Hostinger usually keeps them under paths like /opt/alt/php82/usr/bin/php).
Configure wp-config.php for Redis
You can let WordPress plugins try to auto-discover Redis, but I prefer hardcoding the connection constants. It ensures updates won’t wipe your settings and prevents weird fallback issues on shared infrastructure.
Open your wp-config.php file:
nano ~/public_html/wp-config.phpDrop this block right above the /* That's all, stop editing! Happy publishing. */ line:
// Redis Object Cache Configuration
define('WP_REDIS_SCHEME', 'tcp');
define('WP_REDIS_HOST', '127.0.0.1');
define('WP_REDIS_PORT', 6379);
define('WP_REDIS_TIMEOUT', 1.5);
define('WP_REDIS_READ_TIMEOUT', 1.5); // Isolate cache if you run staging sites or multiple installs
define('WP_CACHE_KEY_SALT', 'mysite_prod_');
define('WP_REDIS_MAXTTL', 86400);Whatever you do, don’t skip the WP_CACHE_KEY_SALT definition. If you ever set up a WordPress staging site on Hostinger on the same hosting package, both sites will share that same Redis daemon. Without distinct salts, staging will pull production cached options, user sessions, and transients—and that turns into a mess fast.
Also, if you’re processing bulk imports or running heavy plugins, make sure you increase the PHP memory limit in WordPress on Hostinger so cache serialization doesn’t choke your script runs.
Install and Activate Redis Object Cache
With PHP and your config ready, drop in the cache provider. You can install it via the dashboard, but WP-CLI avoids any PHP execution timeouts:
wp plugin install redis-cache --activate --path=/home/u123456789/public_html
wp redis enable --path=/home/u123456789/public_htmlRunning wp redis enable copies the drop-in file to wp-content/object-cache.php. WordPress loads this before anything else, initializing the persistent cache before your active plugins run.
Hop into your WordPress dashboard and check Settings > Redis. You want to see a green Status: Connected banner displaying the client, host, and Redis version.
Fixing the Hostinger Redis Socket Error
Depending on which Hostinger server cluster you’re provisioned on, trying to reach Redis over TCP loopback (127.0.0.1:6379) might fail completely:
RedisException: Connection refused in /home/u123456789/public_html/wp-content/object-cache.php:248Hostinger locks down Redis on many setups to run strictly over a local Unix Domain Socket (UDS) instead of an open loopback network port. The good news? Unix sockets bypass network overhead and run faster anyway.
Check your hPanel dashboard or user root for the actual socket path. Once you have it, update your wp-config.php block to use the socket instead of TCP:
// Replace TCP settings with Unix Socket parameters
define('WP_REDIS_SCHEME', 'unix');
define('WP_REDIS_PATH', '/home/u123456789/.redis/redis.sock'); // Keep your key salt intact
define('WP_CACHE_KEY_SALT', 'mysite_prod_');Save it, refresh Settings > Redis, and that connection refused error should vanish.
Benchmarking Cache Hit Ratio and Memory
Having Redis running doesn’t mean it’s actually doing work. You want to verify that queries are hitting the cache rather than missing and falling back to MySQL.
If you’re using TCP, inspect live Redis stats over SSH:
redis-cli info statsIf your account uses a Unix socket, target the socket path directly:
redis-cli -s /home/u123456789/.redis/redis.sock info statsCheck the keyspace metrics:
keyspace_hits:48210
keyspace_misses:3104Use the standard formula to find your hit ratio: hits / (hits + misses). Here, 48210 / (48210 + 3104) = 0.939, or a 93.9% hit rate. Anything consistently over 85% means your dynamic queries and transients are serving almost purely out of RAM.
For deeper background on how Redis structures memory, read through the official Redis documentation or check out the WordPress Optimization Handbook.
Cache Invalidation and Debugging
When you’re pushing updates or tweaking code, stale object caches can cause bizarre rendering bugs. If you alter a database row manually or see stale plugin output after updating, flush Redis.
Clear it cleanly with WP-CLI:
wp cache flushOr wipe the cache instance directly via the socket:
redis-cli -s /home/u123456789/.redis/redis.sock flushdbOne critical heads-up: if you use LiteSpeed Cache, turn off its built-in Object Cache toggle if you’re using the standalone Redis Object Cache plugin. Having both plugins fight over wp-content/object-cache.php will break your drop-in during core or plugin updates.
If you’re setting up new environments or migrating things around, check our guide on how to point Namecheap domains to Hostinger nameservers without messing up your records.
Frequently Asked Questions
Does Redis replace LiteSpeed Cache on Hostinger?
No. LiteSpeed Cache handles full-page HTML caching, CSS/JS optimization, and static file delivery. Redis handles persistent database query caching. LiteSpeed serves static snapshots to guests, while Redis speeds up database queries for logged-in users, checkout flows, and wp-admin tasks.
What happens if the Redis server runs out of memory?
Hostinger limits your Redis memory allocation (typically 64MB to 256MB based on the tier). When it fills up, Redis evicts older data using an LRU (least recently used) policy. Your site won’t break; you’ll just see a slight dip in cache hit ratio as keys get evicted early.
Why does the Redis plugin show “Drop-in is not valid”?
Another plugin likely left an old object-cache.php behind in wp-content/. Delete that file manually via SSH or the hPanel File Manager, return to Settings > Redis, and click Enable Object Cache to write a fresh drop-in.
Can I use Redis with WooCommerce?
Yes, and you definitely should. WooCommerce generates constant, expensive database lookups for cart fragments, customer sessions, and inventory. Keeping those transients in Redis takes massive strain off MySQL during traffic spikes.

