Quick answer: Install Redis (sudo apt install redis-server), cap its memory (maxmemory 256mb, policy allkeys-lru), install the Redis Object Cache plugin and run wp redis enable. WordPress then keeps query results and computed data in RAM instead of re-asking MariaDB on every request.

Overview

WordPress asks its database the same questions constantly — options, menus, term lookups. A persistent object cache answers them from memory. The effect is biggest exactly where page caching can’t help: wp-admin, logged-in browsing, WooCommerce carts and REST/AJAX endpoints. Redis is the de-facto standard backend for it.

Before you start

  • Roughly 256–512 MB of free RAM for Redis (check free -h).
  • The PHP Redis extension: sudo apt install php8.3-redis.
  • WP-CLI (convenient) and a backup.

Step-by-step guide

  1. Install and start Redis:
    sudo apt install redis-server php8.3-redis
    sudo systemctl enable --now redis-server
  2. Limit its appetite in /etc/redis/redis.conf:
    maxmemory 256mb
    maxmemory-policy allkeys-lru
    then sudo systemctl restart redis-server php8.3-fpm.
  3. Confirm it answers: redis-cli pingPONG (Redis listens only on 127.0.0.1 by default — keep it that way).
  4. Install and enable the drop-in:
    sudo -u www-data wp plugin install redis-cache --activate
    sudo -u www-data wp redis enable
    sudo -u www-data wp redis status
  5. Watch the hit ratio after a day: redis-cli info stats | grep keyspace — hits should dwarf misses.

Common issues

  • “Status: Not connected”: PHP extension missing or FPM not restarted after installing it.
  • Multiple sites sharing one Redis: collisions — set a unique WP_REDIS_PREFIX per site in wp-config.php.
  • Stale data after direct DB edits: flush once with wp cache flush — changes made behind WordPress’s back bypass cache invalidation.

When to contact support

Redis setup is application-level work on an unmanaged VPS; tickets are the right channel when the server itself lacks RAM for the workload and you want to size an upgrade.

Frequently asked questions

What is the difference between page cache and object cache?

A page cache stores whole HTML pages for anonymous visitors; an object cache stores database query results in RAM and accelerates every request that must run PHP — admin, carts, logged-in users.

How much RAM should I give Redis for WordPress?

For a single typical site 256 MB is plenty (most use far less); busy WooCommerce stores may want 512 MB. Set maxmemory with the allkeys-lru policy so Redis evicts old keys gracefully.

Does Redis need to be secured?

Keep it bound to 127.0.0.1 (the default), never exposed to the internet; add requirepass in redis.conf if multiple untrusted apps share the server.

Related articles

Ready to get started? Order a WordPress VPS at Cloud2Y →

Was this answer helpful? 0 Users Found This Useful (0 Votes)