Install Redis on Ubuntu 16.04 – How to Install Redis on Ubuntu 16.04

aptredissoftware installation

I am working with Laravel but i have installed all on my own (php, mysql, composer, nginx) and now i need to install Redis and configure it so i could use it for queue driver in Laravel.

How to install it, because it cannot be installed through apt-get install redis

i get this error:

ubuntu@ubuntu:~$ sudo apt-get install redis
[sudo] password for ubuntu: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package redis

Best Answer

I think always is better (and simpler) to install from main repos as first option if you don't have any special requirements.

The package you are searching for is named redis-server. You can check its package info with apt show redis-server.

Also you can search all packages mentioning redis with apt search redis, or even do some simple filtering using grep, use apt search redis | grep php to search for php-redis or related package(s) for example.

So, you can simply run:

sudo apt install redis-server

on your terminal, to install a fully working redis(server) environment.

If you have any special requirements, you always can build from source and install as @George posted in his answer.

Hope it helps.

Related Question