How to Set Up Free Redis Object Cache on a WordPress VPS in 2026 (Ubuntu Guide)
Disclosure: Some links in this article are affiliate links. If you click and make a purchase, we may earn a commission at no extra cost to you. This does not influence our editorial recommendations - we only recommend products and services we genuinely believe in. Read our full affiliate disclosure.

If you run WooCommerce or a dynamic membership site on WordPress, standard static page caching only solves half the puzzle.
Log in to your dashboard, add an item to the shopping cart, or filter products, and page caching is bypassed - forcing your server to execute 80 to 200 SQL queries per page load.
Installing Redis Object Cache directly on your Linux VPS (Ubuntu 22.04 or 24.04 LTS) offloads these database queries into ultra-fast RAM, cutting dynamic page generation times by up to 70%.
Here is the exact step-by-step terminal guide for 2026.
Step 1: Install Redis Server and PHP Redis Extension
Connect to your VPS via SSH and install the official Redis server daemon and the PHP Redis extension for your active PHP version (PHP 8.2 or 8.3):
Verify that the Redis service is active and running:
Step 2: Configure Redis Memory & Eviction Policy
Open the main Redis configuration file:
Scroll down to the memory management section and add or modify the following directives:
maxmemory 256mb: Caps Redis memory usage so it never starves MySQL or Nginx of system RAM.maxmemory-policy allkeys-lru: Ensures Redis automatically evicts the oldest, least-frequently accessed database query keys when the 256MB cap is reached.
Save the file (Ctrl+O, then Enter) and restart Redis:
Step 3: Install the WordPress Redis Object Cache Plugin
- Log in to your WordPress admin dashboard (
/wp-admin). - Go to Plugins > Add New and search for Redis Object Cache (by Till KrΓΌss).
- Click Install Now and Activate.
- Navigate to Settings > Redis and click "Enable Object Cache".
- You should see a green "Status: Connected" indicator confirming WordPress is communicating with Redis via
127.0.0.1:6379.
Step 4: Configure Salt Keys for Security in wp-config.php
If you host multiple WordPress sites on the same VPS, they will share the same Redis instance. To prevent cross-site cache pollution, define a unique cache key salt in each site's wp-config.php:
Verifying Redis Cache Hit Rates
To inspect live cache queries, SSH into your server and run the Redis real-time monitor:
Refresh your WordPress front page or browse WooCommerce product categories. You will see an immediate stream of GET and SET commands executing in sub-millisecond speeds.
Your MySQL CPU utilization will drop immediately, and your WordPress admin dashboard will feel lightning-fast.
Frequently Asked Questions
Redis stores recurring MySQL database query results directly in high-speed RAM. When visitors load pages, WordPress fetches data from memory in 0.2ms instead of executing disk-based SQL queries.
For most high-traffic blogs and WooCommerce stores, allocating 256 MB to 512 MB of RAM to Redis using the maxmemory 256mb setting is more than sufficient.
allkeys-lru (Least Recently Used) is the industry standard eviction policy for WordPress, automatically dropping the least-accessed keys when memory fills up.
No. Page caching caches complete static HTML documents, while Redis caches dynamic database objects. They work together synergistically to eliminate server bottlenecks.

Alex Morgan is the founder and lead editor of RemoGrid. With over six years of hands-on experience in remote operations, cross-border freelance workflows, and AI tool benchmarking, Alex independently tests and audits software platforms to help modern digital workers build sustainable online income streams. He regularly reviews international payment systems (Wise, Stripe, Payoneer, local mobile wallets) and conducts real-world usability benchmarks across AI productivity tools.


