<\/span><\/h2>\nIn order to get the latest stable version of Redis, we will download and install it from the official Ubuntu repositories.<\/p>\n
Run the command below to install Redis on your machine:<\/p>\n
sudo apt-get install redis-server<\/pre>\nWith this command, we will also download and install all the required dependencies.\u00a0 Now we need to make one important configuration change in Redis.<\/p>\n
We will open the Redis configuration file in nano with the following command. You are free to use any other text editor if you prefer:<\/p>\n
sudo nano \/etc\/redis\/redis.conf<\/span><\/pre>\nWe need to find\u00a0supervised<\/em><\/span>\u00a0directive. The supervised\u00a0directive allows us to declare an init system to manage Redis as a service, and we will change it to\u00a0systemd<\/em>.<\/p>\n# If you run Redis from upstart or systemd, Redis can interact with your\r\n# supervision tree. Options:\r\n# supervised no - no supervision interaction\r\n# supervised upstart - signal upstart by putting Redis into SIGSTOP mode\r\n# supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET\r\n# supervised auto - detect upstart or systemd method based on\r\n# UPSTART_JOB or NOTIFY_SOCKET environment variables\r\n# Note: these supervision methods only signal \"process is ready.\"\r\n# They do not enable continuous liveness pings back to your supervisor.\r\nsupervised systemd<\/pre>\nTo make Redis aware of this, we need to restart it with the following command:<\/p>\n
sudo systemctl restart redis-server<\/pre>\n