How to Run Redis on Windows 10

While the audience of our application is increasing rapidly, it requires more requests to the database. But each request to the database needs a sufficient amount of time. Sometimes we also need to pay more for the requests to the database. So we need to decrease the request to the database in possible situations. Redis is the solution for this.

What is Redis?

Redis is an open-source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports various data structures such as Strings, Hashes, Lists, Sets, etc.

In simple words, we can store the data from our database in our backend storage as a cache. Afterward, this data is served to our front-end for the same API request through a specific amount of time period.

Redis is made using ANSI C programing language and it uses NoSQL structure to store data which makes it more popular nowadays.

Currently, tech giants like GitHub, Weibo, Pinterest, Snapchat, Craigslist, Digg, StackOverflow, Flickr, etc. are using Redis. So we can trust Redis in using within our application.

Is Redis Compatible with Windows 10?

Redis is made for work with servers. POSIX systems like Linux, *BSD, OS X without external dependencies and is not compatible with Windows systems because Windows servers are not using widely.

But if we are developing an application using Redis on a Windows system, Running Redis in our system is necessary.

So here in this tutorial, we are going to explain the steps in running Redis on a Windows 10 system.

STEPS

Install Ubuntu on Windows 10

We have already told that Redis is not developed to work within Windows systems because Windows servers not using widely. So it requires a Unix based operating system like Ubuntu, or macOS to run Redis server. macOS can only be installed on Windows 10 using Virtualbox and it’s most complicated. But Ubuntu can be easily installed within our Windows 10 operating system easily because it’s available in Microsoft store. We can simply install the LTS version of Ubuntu from Microsoft store using the link below.

Ubuntu 18.04 LTS for Windows 10

Ubuntu is not mandatory to set up the Redis server. It supports other Linux versions such as Debian and Kali Linux. Use the below link to download it.

Debian for Windows 10

Kali Linux for Windows 10

In this tutorial, we are going to set up a Redis server in Ubuntu operating system. Without using any URL’s above, we are manually downloading it from the Microsoft store.

1. Open Microsoft Store

First, open the Microsoft Store by searching “store” in the left-bottom Windows 10 search box.

2. Install Ubuntu

The Microsoft Store will be opened and now search for Ubuntu. In the top-right search box, search for Ubuntu and click on the latest version(18.04 LTS) from the suggestions and Get the app.

3. Launch Ubuntu

So the Ubuntu is installed on our Windows system and now we need to launch it. So search for “ubuntu” in the Windows search box.

An Ubuntu terminal will be opened and this terminal is used to set up Redis.

Install Redis on Ubuntu

So we have successfully set up an Ubuntu server inside our Windows operating system.

Now we can install Redis on this Ubuntu system by following the below steps.

1. Download Redis

To install Redis-server, we need to download the stable version of Redis from the official website. This can be done with the below command.

wget http://download.redis.io/redis-stable.tar.gz

2. Extract and Make

Now extract the file we have downloaded using the below command.

tar xvzf redis-stable.tar.gz

Now, enter the directory we have created.

cd redis-stable 

Now, execute the make command. The purpose of the make utility is to determine automatically which pieces of a large program need to be recompiled, and issue the commands to recompile them.

make

3. Start Redis server

After the successful installation Redis server, we can start the Redis server using the redis-server command.

redis-server

The above commands start the Redis server on our system as shown in the below screenshot.

Now we can close the Ubuntu terminal window. This will not stop the Redis server we have started earlier.

But we have to note that, it needs to start Redis server after each system reboot by running redis-server command.

Have a nice code !

7 thoughts on “How to Run Redis on Windows 10

  1. # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

    # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.

    i got those warnig when try to running redis-server. and got this
    Redis ping status: dial tcp 3.214.5.107:32419: i/o timeout

    when run my go project . can you help me to fix this issue .
    thanks

    1. Like the warning suggests, just add the line vm.overcommit_memory=1 to the bottom of /etc/sysctl.conf, with something like sudo vi /etc/sysctl.conf.

      But permissions don’t allow you to edit THP as the warning suggests, so instead do

      sudo apt install hugepages

      and add the command sudo hugeadm –thp-never to the bottom of your .bashrc, with something like sudo vi ~/.bashrc.

      Then just sudo reboot and next time you SSH in run redis-server and the warnings are gone!

      Refer the Stackoverflow answerfor more.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.