[Image of Redis caching architecture]

Installing a "Speed Plugin" on a slow server is like putting a spoiler on a tractor. It looks cool, but you are still going 10 MPH.

Every time a visitor loads your site, WordPress has to query your database dozens of times. "Get site title," "get latest posts," "get user ID." This is slow.

Redis solves this by storing those answers in your server's RAM. The next time a user asks, Redis delivers the answer instantly, skipping the database entirely.

Prerequisites: A Joy Services VPS with Ubuntu 24.04 and a working WordPress installation.

Step 1: Install Redis Server

First, we need to install the Redis software on your backend.

Bash
root@joy:~# sudo apt update sudo apt install redis-server php-redis -y

Verify Redis is running:

Bash
root@joy:~# sudo systemctl status redis
Expected Output
● redis-server.service - Advanced key-value store Loaded: loaded (/lib/systemd/system/redis-server.service; enabled) Active: active (running)

Step 2: Configure Redis Memory

By default, Redis doesn't know how much RAM to use. We need to set a limit so it doesn't crash your server.

Bash
root@joy:~# sudo nano /etc/redis/redis.conf

Scroll to the bottom of the file and add these two lines:

Redis Config
maxmemory 256mb maxmemory-policy allkeys-lru
What does this do?
maxmemory 256mb: Limits cache to 256MB of RAM.
allkeys-lru: If the cache gets full, it automatically deletes the "Least Recently Used" (LRU) data to make room for new data.

Restart Redis to apply changes:

Bash
root@joy:~# sudo systemctl restart redis-server

Step 3: Connect WordPress to Redis

Now that the server is ready, we need to tell WordPress to use it. We will use the official plugin.

1. Log in to your WordPress Dashboard.
2. Go to Plugins > Add New.
3. Search for "Redis Object Cache" (By Till Krüss).
4. Click Install and then Activate.

Once activated, go to Settings > Redis and click the button "Enable Object Cache".

Expected Result (In Dashboard)
Status: Connected Redis Version: 6.0.16 Client: PhpRedis (v5.3.7)
Status: Not Connected? If the status says "Not Connected," ensure you installed the php-redis package in Step 1. WordPress cannot talk to the Redis server without this PHP extension.

Step 4: Verify It Is Actually Working

Don't trust the green checkmark. Let's verify via the command line that keys are actually being stored.

Bash
root@joy:~# redis-cli monitor

Now, refresh your website in a browser. Watch your terminal. You should see a flood of "GET" and "SET" commands flying by.

Terminal Output
1638219.1233 [0 127.0.0.1:4567] "GET" "wp_:options:alloptions" 1638219.1455 [0 127.0.0.1:4567] "GET" "wp_:users:1"

Success! Your database is now resting while RAM handles the heavy lifting. Your site is significantly faster.