How To Install Redis on Debian 10
How To Install Redis on Debian 10
Hi,
Here's how to install Redis on Debian 10:
You must have shell access with sudo privileged account access to Debian 10 system. First of all, log in to your system and upgrade the current packages.
1st run:
2nd run
After installation, enable Redis service to start on system boot.
Now navigate to your /etc/redis/redis.conf file and add this 2 lines on the end of the file:
The above configuration tells Redis to remove any key using the LRU algorithm when the max memory of 256mb is reached. Save the configuration file and restart the Redis service:
Install Redis PHP Extension (This is an optional step. If you need to connect Redis from PHP application, You need to install Redis PHP extension on your Debian system. To install Redis PHP extension, simply type:)
The installer will automatically enable redis extension for all the pre installed PHP versions. If you installer new PHP version after this, you can use below command to enable redis module. For example to enable extension for PHP 7.4, type:
Now Connect to Redis Server
Use redis-cli tool to verify the connection between the Redis server
Few more examples of redis-cli command line tool:
This tutorial helps you with the installation of Redis server on Debian 10 system.
Here's how to install Redis on Debian 10:
You must have shell access with sudo privileged account access to Debian 10 system. First of all, log in to your system and upgrade the current packages.
1st run:
Code: Select all
sudo apt update
Code: Select all
sudo apt upgrade
Code: Select all
sudo apt install redis-server
Code: Select all
sudo systemctl enable redis-server
Code: Select all
maxmemory 256mb
maxmemory-policy allkeys-lru
Code: Select all
sudo systemctl restart redis-server
Code: Select all
sudo apt install php-redis
Code: Select all
sudo phpenmod -v 7.4 -s ALL redis
Use redis-cli tool to verify the connection between the Redis server
Code: Select all
redis-cli
127.0.0.1:6379> ping
PONG
Code: Select all
$ redis-cli info
$ redis-cli info stats
$ redis-cli info server
Last edited by webxtek on Wed Dec 30, 2020 4:21 am, edited 1 time in total.
Re: How To Install Redis on Debian 10
Thanks a lot <3