<\/span><\/h2>\n\n\n\nFirst, log in to your Ubuntu 20.04 server via SSH as the root user:<\/p>\n\n\n\n
ssh root@IP_ADDRESS -p PORT_NUMBER<\/pre>\n\n\n\nDon\u2019t forget to replace IP_Address<\/strong> and Port_Number<\/strong> with your server\u2019s actual IP address and the SSH port number. Also, you should replace \u2018root\u2019 with the username of the admin account if needed.<\/p>\n\n\n\nOnce you are in, run the following commands to update the package index and upgrade all installed packages to the latest available version<\/p>\n\n\n\n
sudo apt-get update \nsudo apt-get upgrade<\/pre>\n\n\n\nOnce the upgrades are completed, we can move on to the next step.<\/p>\n\n\n\n
<\/span>2. Install Redis on Ubuntu 20.04<\/span><\/h2>\n\n\n\nWhen an update is completed, you will download and install it from the official Ubuntu repositories. Redis version 5.0.x is included by default on Ubuntu 20.04 repositories.<\/p>\n\n\n\n
Run the following command to install Redis on your server:<\/p>\n\n\n\n
sudo apt-get install redis-server<\/pre>\n\n\n\nWith this command, you will also download and install all the required dependencies.<\/p>\n\n\n\n
Once the installation is completed, the Redis service will start automatically. To check and verify the status of your Redis service, run the following command:<\/p>\n\n\n\n
sudo systemctl status redis-server<\/pre>\n\n\n\nYou should receive the following output:<\/p>\n\n\n\n
\u25cf redis-server.service - Advanced key-value store\nLoaded: loaded (\/lib\/systemd\/system\/redis-server.service; enabled; vendor preset: enabled)\nActive: active (running) since Sat 2021-09-25 11:01:30 UTC; 12min ago\nDocs: http:\/\/redis.io\/documentation,\nman:redis-server(1)\nMain PID: 199086 (redis-server)\nTasks: 4 (limit: 2279)\nMemory: 2.0M\nCGroup: \/system.slice\/redis-server.service\n\u2514\u2500199086 \/usr\/bin\/redis-server 127.0.0.1:6379<\/pre>\n\n\n\nThe default port of Redis is 6379<\/code> and IP 127.0.0.1<\/code> is localhost.<\/p>\n\n\n\n<\/span>3. Check Redis Version<\/span><\/h2>\n\n\n\nYou can check the Redis version using the following command:<\/p>\n\n\n\n
$ redis-cli -v<\/pre>\n\n\n\nYou should get the following output:<\/p>\n\n\n\n
redis-cli 5.0.7<\/pre>\n\n\n\n