Install Redis-Server and setup with Magento2

admin/ April 26, 2016/ Linux, Magento2/ 0 comments

Install And setup the Redis-Server on Ubuntu for Magento2 instance.

It is very easy to install and use it with magento2, it will cache your magento2 instance and page cache.

There are few basic steps to install and setup with Ubuntu Server.

Step 1-:

Install Required Packages.

$ sudo apt-get update
$ sudo apt-get install -y redis-server

Step 2-:

Check the redis-server running on port.

$ sudo netstat -ntulp | grep radis

Output-:

tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      6882/redis-server

Step 3-:
Setup with Magento2 (M2) instance.

Open env.php  file

$ sudo nano /var/www/html/magento2/app/etc/env.php

Update env.php file

cache' =>
array(
   'frontend' =>
   array(
      'default' =>
      array(
         'backend' => 'Cm_Cache_Backend_Redis',
         'backend_options' =>
         array(
            'server' => '127.0.0.1',
            'port' => '6379'
            ),
    ),
    'page_cache' =>
    array(
      'backend' => 'Cm_Cache_Backend_Redis',
      'backend_options' =>
       array(
         'server' => '127.0.0.1',
         'port' => '6379',
         'database' => '1',
         'compress_data' => '0'
       )
    )
  )
)
);

inside the bottom ); at the end of the file.

 

Leave a Reply