Redis 安装教程

系统版本

root@l1:~# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04 LTS"

安装手册

安装

安装 apt install redis

配置密码

编辑配置文件 vim /etc/redis/redis.conf

# requirepass foobared
requirepass passwd

重启 redis systemctl restart redis

安装最新版的 redis

当前是 7

curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg

echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list

sudo apt-get update
sudo apt-get install redis

评论栏