Hey visitors! If you’re a beginner in WordPress and WP-CLI development, then you should check out my dear friend Bhargav’s Youtube channel! @BuntyWP

Setting up Redis for Object Caching in LocalWP using Docker

LocalWP does not come with Redis, nor does it have an add-on. This makes it impossible to use the Redis Object Cache plugin out of the box.

However, there is an easy way to set this up using Docker.

Once you have Docker installed on your system, run the following command:

docker run --name redis-local -p 6380:6379 -d redisCode language: Shell Session (shell)

This command runs a Redis container named redis-local, mapping its default port (6379) to the host machine’s port (6380), and runs it in detached mode so that it continues running in the background.

The next step is to configure WordPress to connect to Redis. To do so, add the following lines to the wp-config.php file of your WordPress installation:

define( 'WP_REDIS_HOST', '127.0.0.1' );
define( 'WP_REDIS_PORT', 6379 );Code language: PHP (php)

Follow the next steps to begin using Redis:

  1. Restart your website.
  2. Activate the Redis Object Cache plugin.
  3. Enable Object Cache from the Redis Settings page.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

Powered by WordPress