How to install and activate Redis for WordPress

Post Reply
User avatar
Posts: 91
Joined: Mon Jul 19, 2021 1:41 am
Has thanked: 7 times
Been thanked: 3 times

Quick tutorial on how to install and setup Redis for your WordPress website:

1. First part is done in terminal under root account:

Code: Select all

apt update
apt install -y redis-server
apt install -y php-redis php5.6-redis php7.0-redis php7.1-redis php7.2-redis php7.3-redis php7.4-redis php8.0-redis php8.1-redis # depending of the version you have/need

mcedit /etc/redis/redis.conf
    find: supervised
    set: supervised systemd

    find: save 900 1
    comment all 'save' directives
    uncomment: save ""

    find: maxmemory
    set: maxmemory [bytes] (or '2g')
    add: maxmemory-policy allkeys-lru

systemctl restart redis
    info memory
2. Second part is done in your WordPress dashboard
  • Install and activate this plugin: Redis Object Cache (by Till Krüss)
  • Go to Settings/Redis
  • Click Enable Object Cache
  • If you see this, that means that you successfully installed Redis on your WordPress website:

    redis.png (68.75 KiB)

Post Reply