Ubuntu18.04 compile and install redis-server and register to systemd
In the official website to download source packages
https://redis.io/
Or download
wget https://wood-bucket.oss-cn-beijing.aliyuncs.com/Linux/redis-5.0.5.tar.gz
To 5.0.5 version, for example
Compile
tar -xzvf redis-5.0.5.tar.gz
cd redis-5.0.5
apt install gcc make -y
make
sudo vim /etc/systemd/system/redis-server.service
[Unit]
Description=Redis-server
[Service]
User=root
WorkingDirectory=/home/ubuntu/redis-5.0.5/
ExecStart=/home/ubuntu/redis-5.0.5/src/redis-server redis.conf
[Install]
WantedBy=default.target
sudo systemctl daemon-reload
sudo systemctl enable redis-server.service
sudo systemctl start redis-server.service