1. Install Redis:

You can update the source first:

sudo apt-get update
Copy the code
sudo apt install redis-server
Copy the code

2. After the installation is complete, run the following command to check the Redis service status (you can view all redis service information!). :

sudo systemctl status redis-server
Copy the code

3. If you want to modify redis, use the following command to edit the default redis configuration file /etc/redis/redis.conf:

nano /etc/redis/redis.conf
Copy the code

Be sure to restart Redis for the configuration to take effect:

sudo systemctl restart redis-server
Copy the code

4. Switch redis command:

Open: sudo systemctlstart redis-serverOff: sudo systemctl stop redis-server
Copy the code