aptto install it from the official Ubuntu repositories.
aptpackage cache and install Redis by typing:
superviseddirective. This directive allows you to declare an init system to manage Redis as a service, providing you with more control over its operation. The
superviseddirective is set to
noby default. Since you are running Ubuntu, which uses the systemd init system, change this to
#if it exists):/etc/redis/redis.conf
CTRL + X,
redis-serverprogram is bound to localhost (
127.0.0.1), reflecting the change you just made to the configuration file. If you see another IP address in that column (
0.0.0.0, for example), then you should double check that you uncommented the correct line and restart the Redis service again.
authcommand, which requires clients to authenticate to access the database. The password is configured directly in Redis’s configuration file,
/etc/redis/redis.conf, so open that file again with your preferred editor:
SECURITYsection and look for a commented directive that reads:/etc/redis/redis.conf
#, and change
foobaredto a secure password.
requirepassdirective in the
redis.conffile, there is a commented warning:
opensslcommand to generate a random one, as in the following example. By piping the output of the first command to the second
opensslcommand, as shown here, it will remove any line breaks produced by that the first command:
requirepass, it should read:
bindand make sure it’s uncommented:/etc/redis.conf
authcommand — which requires clients to authenticate before being allowed access to the database. Like the
bindsetting, the password is configured directly in Redis’s configuration file,
/etc/redis.conf. Reopen that file:
SECURITYsection and look for a commented directive that reads:/etc/redis.conf
#, and change
foobaredto a very strong password of your choosing. Rather than make up a password yourself, you may use a tool like
pwgento generate one. If you don’t want to install an application just to generate a password, though, you may use the command below.
requirepass, it should read:/etc/redis.conf