Redis can significantly reduce database load on busy WordPress sites.
Prerequisites
- Ubuntu LTS
- Root or sudo access
- A WordPress site already running
Install
sudo apt install -y redis-server
Enable
sudo systemctl enable redis-server
sudo systemctl start redis-server
WordPress (drop-in plugin approach)
Common practice is to use a plugin such as Redis Object Cache and enable it in WordPress.
Configure WordPress
In /var/www/<site-root>/wp-config.php:
define('WP_REDIS_HOST', '127.0.0.1');
Use a unique prefix:
define('WP_REDIS_PREFIX', '{site_slug}_');
Quick check
- Confirm Redis is running:
sudo systemctl status redis-server --no-pager - Validate object cache status in WP admin (plugin UI)
Related
- Memcached vs Redis for WordPress object caching — when to choose Redis vs Memcached
- Performance tuning for WordPress on Ubuntu + Apache + PHP-FPM — broader performance tuning