If your site shows “error establishing a Redis connection,” WordPress can’t connect to the Redis server, which is part of your caching setup. Redis sits behind a plugin such as Redis Object Cache and is faster than regular WordPress database requests because it stores cached data in memory instead of making the same MySQL request every time. When the connection can’t be made, WordPress falls back to slower database requests and, in some cases, displays a message on the front or back end of your site.
Many things can cause this problem. For example, the server might not be running. A typo in the host/port details, a firewall, or incorrect password details are other common reasons. In this guide, you will go through the list one by one to diagnose the actual reason.
Table of Contents
What Does “Error Establishing a Redis Connection” Mean?
– Redis: An in-memory data store. In WordPress, it’s generally used as an object cache (a specialized cache used by PHP, as a layer of cache that keeps commonly requested data (such as post data, query results, options) in RAM, so PHP can avoid querying the database repeatedly). The Redis Object Cache plugin, or a similar drop-in, interfaces with the Redis server and passes cache requests to it.
When WordPress cannot make that connection, it produces that error. Functionally, that means the connection attempt expired (timed out), was refused, was authenticated incorrectly, or was never established because PHP/WordPress couldn’t open a working socket to talk to Redis. Notice this is different from “the data stored in Redis is corrupted” or “the cache data is gone”. The Redis instance itself and the data inside are perfectly fine in almost every case; it’s that something is getting between PHP and Redis: either the service is off, a setting is wrong, or a network rule is in place.
A few terms worth knowing before you start troubleshooting:
- Redis host: the address WordPress connects to for Redis (usually 127.0.0.1 or localhost in local environments, or a private IP/hostname if on managed hosting)
- Redis port: The port on which Redis is listening; the default is 6379
- Unix socket – instead of a connection through TCP host/port. Usually used on shared/containerized environments.
- Authentication: a password (and optionally a username, in the case of Redis ACLs) that must be used to establish a connection.
- Redis Object Cache – A WordPress plugin/drop-in that connects WordPress and the Redis server.
You don’t need to learn these in great detail; they keep coming up throughout the steps.
Why Is WordPress Unable to Connect to Redis?
There is no single main cause; part of the frustration is that what fixed someone else’s issue might not fix yours. The main categories for this can be placed into:
Issues with service levels – Redis isn’t running, has crashed, or has been restarted and failed to come up properly.
Mismatched configurations – the host/port/socket path in wp-config.php does not correspond to what Redis is listening to.
Authentication problems – incorrect password, or an expired/outdated password (perhaps because WordPress is out of sync with a credentials rotation).
Network-level blocks a firewall, security group, or hosting provider network rule blocking the connection despite the Redis server running healthily.
Resource limits – Redis being at its limit for connections, the server being low on memory, or the OS reaching the limit on file descriptors
Issues on the plugin side – The Redis Object Cache plugin may be poorly configured, out of date, or conflict with other caching layers.
It would help to differentiate at the start between a “Redis service problem” (Redis isn’t running or isn’t accessible at all) and a “WordPress configuration problem” (Redis is fine, but WordPress doesn’t know where to look for it). I list the following steps in the order you should work through them:
How to Fix “Error Establishing a Redis Connection”
Go through these sequentially to eliminate the issue.
Step 1: Check if Redis Is Running
Before touching any WordPress settings, double-check that the Redis service is actually running. It usually is, as on a Linux VPS:
systemctl status redis
or, if Redis is running in a container:
docker ps
You want it to be “active (running)” or in a “healthy” state in a healthy container. If it’s showing as “stopped,” “crashing,” or keeps restarting, that’s your problem; start there instead of touching any WordPress settings. The commands and service names vary by operating system and installation method, so if you’re not running “redis” as the service name, check your hosting company’s support documents and ask them what to run.
Step 2: Test Redis with Redis CLI
If Redis is running, the next step is to confirm it responds to a connection. From a terminal with access to the server (or a container which can reach the server), run:
redis-cli ping
A healthy, reachable Redis instance replies with:
PONG
If you receive a connection refused, timeout, or no response, the problem is upstream of WordPress: either Redis isn’t running at the specified location, or a firewall is blocking the connection. Remember, this command isn’t always available, depending on your managed hosting service and whether you have shell access to the server running Redis.
Step 3: Verify Redis Host and Port
While Redis typically listens on 6379, the hostname WordPress should use depends on where Redis runs. It can be 127.0.0.1 or localhost when the Redis server runs on the same server as WordPress, a private IP address when Redis runs on a different machine within your private network, or even a Unix socket when WordPress and Redis run within a contained environment (e.g., some hosting solutions).
Don’t just enter a new host from somewhere you saw it; the host value should match your environment. Your host may be a managed WordPress host; in that case, they should have their connection details readily available in their documentation, which may differ.
Step 4: Check wp-config.php
Redis settings are generally included as constants in wp-config.php. Based on your configuration, it will look something like:
define('WP_REDIS_HOST', '127.0.0.1');define('WP_REDIS_PORT', 6379);define('WP_REDIS_PASSWORD', 'your-password');The specific constants your plugin requires can differ, so check your file against your Redis provider/package developer’s documentation rather than assuming other examples match your setup. Before making any edits, save a copy of wp-config.php – it’s a tiny file, but a typo here can crash your entire site.
Step 5: Check Firewall Settings
Even if Redis is active and configured properly, the firewall might still be blocking the connection without your knowledge. This can be for local connections (a local firewall blocks it even though Redis is running on the same server and is accessible) or remote connections (a remote firewall, cloud security group, or web host’s network policy blocks that port).
If you administer thell oonyouron yourS,ify that port 6379 (or the port your Redis instance is listelistensopen only to your app server;; there’syouy n needdon’to expose it directly to the wider internet. Opening Redis broadly is generally something you should not do, so restrict access to only the machines that need it and add extra layers like network segregation and authentication.
Step 6: Verify Redis Authentication
If your Redis server needs a password (and it’s good practice to use one on production Redis instances), entering the wrong password or a stale one will cause the connection to fail, even if the network path works perfectly. This comes up most often during a credential rotation: you change the password on the Redis server, but the wp-config.php value still uses the old password.
Verify the password matches exactly; special characters are case-sensitive, and many connection types require specific encoding for special characters (such as @ or 🙂 in a connection string. Authentication setup can vary by Redis version and hosting provider, so if you’re not sure whether a password is needed, confirm with your host rather than assuming it.
Step 7: Check the Redis Object Cache Plugin
Now that we know that the server-side stuff works, let’s examine the plugin. Usually, WordPress Redis Object Cache plugins show the connection status either in the WordPress admin (in a “Settings” or “Tools” section) or nearby, indicating whether it currently shows a connection to Redis. If it shows Redis is not connected, WordPress can already see a problem with Redis not being connected, not just a network connectivity issue.
Don’t forget to check the plugin version and compatibility with your WordPress version, as an outdated plugin can sometimes cause a connection problem that looks identical to a real server issue. Not all WordPress installations use the same object cache plugin, so if you followed a guide for a different plugin than the one you are using, some setting names might differ.
Step 8: Disable Redis Object Cache Temporarily
If you’ve taken these steps but still aren’t sure where the issue is, you can temporarily turn off the Redis object cache to identify the problem. If you turn the cache off and the error goes away, then it is definitely related to the Redis path.
This is purely diagnostic (and should be used with caution); once you understand the problem and have fixed it, you can turn it back on. Turning off object caching will restore old-fashioned database queries.
Step 9: Check Redis Logs
The closest to the direct answer is usually in the logs. This includes failures to start, denied authentication, failed permission checks, or running out of resources. Logs can vary greatly depending on the OS you use, who you host with, and how Redis was installed (no one path fits all), but if you’re on a VPS, ask your host.
Step 10: Restart Redis and Clear the Object Cache
After you change a configuration, password, host, or firewall rule,o restart the Redis service. Hence, it pulls the server side configuration, and clear the WordPress object cache so that it doesn‘t try to retry the connection over old data, instead connecting fresh, make sure you‘re not afraid of any server downtime caused by restarting the redis service as that will interrupt anything else using it if you are on a production site, you should do it appropriately time. When you’ve completed all of that, you can test the redis-cli ping again and test the connection status of the plugin.
How to Fix Redis Connection Errors on VPS Hosting
On a self-managed VPS, you’ll need to check everything in detail yourself: that Redis is running (service status and that it’s listening on the port you want), the firewall, the Redis configuration file, authentication, and PHP’s Redis extension. Command-line syntax and file locations may vary by Linux flavor (Ubuntu, Debian, or CentOS/RHEL), so if a command from here doesn’t work, look for an equivalent for your OS.
If you don’t have root access (such as with a managed VPS plan where the provider handles the server layer), your troubleshooting will be limited to what you can do at the WordPress level (i.e., steps 3, 4, 6, 7, and 8 above). You’ll need to investigate all server-level issues through your provider’s Fix Redis Connection Errors on Managed WordPress Hosting.
Managed WordPress hosts may use Redis in different ways than a self-managed VPS. The host may manage Redis only, provide their own connection details, require a specific plugin, or require a restart on their side.
On these hosting services, verify they’re actually enabled for your plan/account; several hosts only make Redis available at certain service levels. Make sure you’re using the plugin and connection details your host recommends; a misconfigured self-setup that doesn’t follow their documentation is one of the top reasons for connection errors on managed services. If you’ve tried the WordPress-side steps and the connection still isn’t working, that’s when you should seek admin support. Server-level access to Redis isn’t generally available on managed plans.
Common Redis Connection Errors and What They Mean
| Error establishing a Redis connection | Redis unavailable or misconfigured | Redis service, host, port, plugin |
| Connection refused | Redis isn’t listening, or the connection is blocked | Service status, port, firewall |
| Connection timed out | Network or firewall problem | Firewall and network configuration |
| Authentication failure / NOAUTH | Incorrect or missing credentials | Redis password/authentication settings |
| Redis server unavailable | Service stopped or inaccessible | Redis service status and hosting environment |
| PONG not returned from redis-cli | Client can’t communicate with Redis | Host, port, service status, network path |
Consider the “likely cause” column as a hypothesis, rather than a determination of the problem you are experiencing; only the steps listed above will conclusively identify what the problem is.
How to Check Whether Redis Is Working
Once you think you’ve fixed the issue, verify it at each level rather than assuming it’s resolved:
- Not running ( systemctl status redis or equivalent shows as running).
- Redis will identify and directly reply to a connection test.
- When you have access to run the following command, redis-cli ping, PONG should be returned.
- WooCommerce, Table Rate Shipping, and the Redis Object Cache plugin show that a connection was made in WordPress.
- The initial mistake is no longer present on the site.
- Object cache is actually working (not merely connected, but actually lowering DB load)
Don’t forget that “listening on Redis” and “working with WordPress ” are two distinct states. You could have a properly working Redis server that you can’t see because a configuration or network setting is wrong.
How to Prevent Redis Connection Problems
A few habits reduce how often this error shows up in the first place:
- Maintain your Redis and object cache plugin installations up to date, particularly before and after major WordPress core releases.
- If you manage your VPS yourself, keep an eye on PHP, Apache, MySQL, and other services. Monitor Redis availability.
- Monitor server resources. Memory strain and connection caps are common, subtle causes of random failures.
- Before editing, back up your working wp-config.php Redis configuration.
- Apply authentication to all Redis instances not contained within a completely isolated local environment.
- Do not make Redis accessible to the public internet without a good, secure reason.
- Reconfirm that your Redis connection still works after server migrations, credential rotations, or hosting changes; these are the most common points where a previously working connection breaks.
FAQ
What does “Error establishing a Redis connection” in WordPress mean?
WordPress failed to connect to the Redis server. This can happen if Redis is down, the host/port is wrong, a firewall is blocking the connection, or you enabled authentication.
How can I tell if Redis is running?
If you are running Redis on a VPS, you can check its status with systemctl status redis, or docker ps if you’re using a container.
Which port does Redis run on?
Redis usually binds to port 6379, although this can be altered in configuration or by a hosting provider.
Test a Redis connection: How do I check a connection with Redis?
Connect to your system and run: redis-cli ping (This only works if the system you‘re running on is network-reachable to your Redis server; it will return PONG if you‘re connected).
Is Redis causing my WordPress errors?
One missing or dead Redis connection, for example, shouldn’t break your site. WordPress generally falls back to default MySQL queries, but it can still introduce lag and show the connection error.
How to connect WordPress to Redis?
Resolve the underlying issue (config, auth, firewall, or service health), then clear the object cache and restart Redis if needed so the connection can re-establish.
Should I disable Redis Object Cache?
Only briefly, as a troubleshooting measure so you can identify the error origin. Re-enable it when you’ve repaired the connection, as leaving it off negates the speed advantage.
Is it possible to block Redis with a firewall?
Yes, a functioning, properly configured Redis server could be unavailable if a firewall or security group rule filters the port.
How come it works from server and not from wordpress?
This typically indicates a misconfiguration in wp-config.php (e.g., wrong host, port, or password) rather than an issue with Redis itself, since the server-side test working means Redis must be working.
Do I need Redis for WordPress?
No – WordPress does not require Redis; it’s an additional performance add-on. The website will still function even if Redis isn’t working.
Read:
FB Thumbnail Downloader – Download Facebook Video Thumbnails
How Can I Find Out If My Office Is Bugged?
Passionate content writer with 4 years of experience specializing in entertainment, gadgets, gaming, and technology. I thrive on crafting engaging narratives that captivate audiences and drive results. With a keen eye for trends and a knack for storytelling, I bring fresh perspectives to every project. From reviews and features to SEO-optimized articles, I deliver high-quality content that resonates with diverse audiences.



