How to enable and use Redis Cache with WordPress in DirectAdmin
Want to make your WordPress site faster than ever? If you’re a developer or manage your own website, improving speed is a must. One of the best ways to do that is by using caching-and Redis Cache with WordPress on DirectAdmin is a great combo for serious performance.
This guide will walk you through the steps to set up Redis object caching on your WordPress site hosted with DirectAdmin. You’ll see a noticeable speed boost, a smoother experience for visitors, and less stress on your server.
What is Redis Cache?
Redis (Remote Dictionary Server) is a super-fast, open-source tool that stores data in your server’s memory instead of on disk. This makes it perfect for caching data that’s accessed often.
In WordPress, Redis is used as an object cache. Normally, WordPress runs many database queries to load a page. With Redis, the results of those queries are saved in memory, so the site loads much faster the next time.
If you want to boost your WordPress speed, Redis is a great way to do it.
Benefits of Redis for WordPress
Bringing Redis into your WordPress setup offers several powerful benefits that can greatly improve your site’s performance and scalability:
- Faster Page Loads: Redis stores data in your server’s memory (RAM), making page load times much quicker-especially for dynamic content and logged-in users.
- Less Database Load: Redis reduces the number of queries sent to your MySQL or MariaDB database, helping your server run more smoothly under heavy traffic.
- Improved User Experience: A faster site means happier visitors, lower bounce rates, and better engagement.
- Better Server Performance: Offloading tasks to Redis can lower CPU and memory usage, leading to a more stable and efficient server.
- SEO Benefits: Google prefers fast-loading websites, so Redis can indirectly help improve your search rankings.
- Scales with Traffic: For growing or high-traffic sites, Redis makes it easier to handle more users without upgrading your server constantly.
Using Redis object cache with WordPress is a smart step if you're looking to boost speed and prepare your site for growth.
For Shared/Reseller Hosting (Recommended Setup for Our Clients)
In shared/reseller environments, Redis acts as an object cache for WordPress. Every page load usually involves multiple database queries-posts, menus, settings, etc. Redis caches those results, so future page loads fetch data directly from memory, not the database. The result? Faster site speeds, reduced load, and smoother user experience. Perfect for busy or dynamic websites.
If you're using our DirectAdmin shared or reseller hosting services, good news - you don't need to worry about server-level setup like SSH or Redis installation. We've already handled the heavy lifting behind the scenes.
Here’s what you need to get started:
-
Access Redis Settings in DirectAdmin
- Log in to your DirectAdmin panel as a user.
- Navigate to Advanced Features -> Redis.

-
Enable Redis (If Not Already Enabled)
- If Redis is disabled by default, simply click the Enable button.

-
Note Down the Redis Socket File Path
- Once enabled, Redis will display a socket file path.
- Copy and save this path - you’ll need it in your WordPress config file.

-
Locate Your WordPress Installation
- Go to the File Manager from DirectAdmin.
- Navigate to the folder containing your WordPress site.

-
Edit the wp-config.php File
- Locate and open the wp-config.php file.

-
Add Redis Configuration Lines
- Insert the following lines near the top or before the line that says /That's all, stop editing!/
define( 'WP_REDIS_SCHEME', 'unix' ); define( 'WP_REDIS_PATH', '/path/to/redis.sock' ); // Replace with actual socket pathReplace /path/to/redis.sock with the socket path you copied earlier.

-
Save the File
- Click Save and exit the editor.
-
Your PHP version needs the Redis extension active to communicate with Redis
- Head over to the "Select PHP Version" menu (Extra Features → Select PHP Version → Extensions)

- Tick the redis extension and wait 15–40 seconds for it to activate. Then refresh to confirm it’s enabled
.png)
Your WordPress site is now ready to use Redis caching! For best results, make sure you have a Redis-compatible caching plugin (like Redis Object Cache) installed and activated in WordPress.
Install Redis Object Cache Plugin in WordPress
To make WordPress use Redis for faster performance, you'll need a plugin.
-
Install the Redis Object Cache Plugin
- Log in to your WordPress admin area (dashboard).
- On the left menu, go to Plugins > Add New.
- In the search bar, type:
Redis Object Cache - Look for the plugin by Till Krüss.
- Click the Install Now button

- After it installs, click Activate.

-
Enable Redis Object Cache
Once the plugin is activated, you will redirect to Setting of the plugin for enabling it. If it is not redirect automatically, you can enable it by following steps:
- Go to Settings > Redis from your WordPress menu.

- On the plugin’s page, look for the Enable Object Cache button.
- Click it. If your Redis server is set up correctly, the plugin will connect and start using Redis. It will also place a file called object-cache.php into your WordPress wp-content folder - that’s a good sign!

For VPS/Dedicated Server with DirectAdmin
If you're running a VPS or Dedicated Server with DirectAdmin, you can unlock much more power from Redis.
Redis isn’t just for object caching - it can:
- Speed up your WordPress with object caching
- Boost performance using full-page caching
- Store things like user sessions or custom app data
- Even act as a NoSQL database
Since you have full server access, you can fine-tune Redis to your exact needs.
Full Redis Setup Guide (VPS or Dedicated Server)
Unlock faster performance for your WordPress site-especially if it's hosted on a VPS or Dedicated Server-by enabling Redis object caching.
You’ll need root access to your server and DirectAdmin installed.
-
Install Redis on server (DirectAdmin via CustomBuild)
If Redis isn't already kicking around on your server, the simplest way to get it installed on a DirectAdmin system is by using CustomBuild. CustomBuild is a fantastic script that helps manage and compile all sorts of server components.
- Connect to your server via SSH:
ssh root@your_server_ipReplace
your_server_ipaddress with actul IP address of your server.- Head over to the CustomBuild directory:
cd /usr/local/directadmin/custombuild- Tell CustomBuild to get Redis ready for installation:
./build set redis yes- Now, let CustomBuild install Redis:
./build redisThis command will download, compile, and install the Redis server for you. (This might take a few minutes)
- Start Redis up and make sure it automatically starts whenever your server reboots:
systemctl start redis systemctl enable redis- Just to be sure, check Redis's status:**
systemctl status redisYou should see a nice little message telling you that Redis is
active (running). Perfect! If it showsinactiveorfailed, don’t worry too much.
Redis may be running under your user account (not as a system service), so it might appear as failed or inactive when checked at the root level -
Enable PHP Redis extension
For your WordPress site to connect with the Redis server, you need to enable the PHP Redis extension for the PHP version your site uses.
- Go to the CustomBuild directory** (if you’re not already there):
cd /usr/local/directadmin/custombuild- Enable Redis extension in CustomBuild:
./build set php_redis yes- Install the Redis extension for PHP:
./build php_redisThis will install the
php-redisextension for all active PHP versions on your server. -
Access Redis in DirectAdmin and Install Redis Object Cache plugin in WordPress
Once Redis and the PHP Redis extension are installed on your server, the next step is to connect Redis with WordPress.
The steps to enable Redis inside WordPress (using the plugin and settings) are the same for:
- Shared hosting
- Reseller accounts
- VPS or Dedicated servers with DirectAdmin
You can refer to the same section we already covered above:
This section includes:
- Installing the Redis Object Cache plugin
- Activating it
- Enabling the Object Cache
- Optional
wp-config.phpsettings if needed
Once you've followed that, your WordPress site will be using Redis for faster performance
Performance Tips
A few quick tips to get the most out of Redis + WordPress:
- Use page cache + Redis - Redis for object cache; use a page-cache plugin (LiteSpeed Cache, WP Rocket, etc.) for full-page caching.
- Enable PHP Redis extension and correct Redis settings in
wp-config.phpif needed (WP_REDIS_HOST,WP_REDIS_PORT, timeouts). - Monitor hits/misses with
redis-cli info stats- a high hit rate = good caching. - Give Redis enough RAM - Redis keeps data in memory, so memory is important.
- Clear stale transients occasionally from the plugin to avoid wasted cache.
- Keep WP and plugins updated - updates often include performance/security fixes.
That’s it - these small steps will keep Redis running fast and effective.
Conclusion
Enabling Redis Cache for WordPress on DirectAdmin is a game-changer - it boosts speed, lowers server load, and makes your site feel snappy for visitors.
Redis works by serving data straight from memory, delivering lightning-fast responses. With the right setup and occasional tuning, you’ll maintain a stable, high-performance caching environment.
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS