Docker install redis
1. Pull the latest version of redis
docker pull redis:latest
Two, start redis
docker run -id --name=redis -p 6379:6379 redis:latest
3. Enter the redis container
docker exec -it redis /bin/bash
4. Open the redis client
redis-cli
5. Set a password
Be sure to set a password because the redis server without a password is vulnerable to attack.
config set requirepass 123456
6. Test connection
If it is a purchased cloud server, be sure to open the port in the firewall.