How to install redis on windows

Use Redis on Windows for development

Use Redis on Windows for development

Redis is not officially supported on Windows. However, you can install Redis on Windows for development by following the instructions below.

To install Redis on Windows, you’ll first need to enable WSL2 (Windows Subsystem for Linux). WSL2 lets you run Linux binaries natively on Windows. For this method to work, you’ll need to be running Windows 10 version 2004 and higher or Windows 11.

Install or enable WSL2

Microsoft provides detailed instructions for installing WSL. Follow these instructions, and take note of the default Linux distribution it installs. This guide assumes Ubuntu.

Install Redis

Once you’re running Ubuntu on Windows, you can follow the steps detailed at Install on Ubuntu/Debian to install recent stable versions of Redis from the official packages.redis.io APT repository.
Add the repository to the apt index, update it, and then install:

curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg

echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list

sudo apt-get update
sudo apt-get install redis

Lastly, start the Redis server like so:

sudo service redis-server start

Connect to Redis

You can test that your Redis server is running by connecting with the Redis CLI:

redis-cli 
127.0.0.1:6379> ping
PONG

How do I run Redis on Windows? The Redis download page just seems to offer *nix options.

Can I run Redis natively on Windows?

David Fullerton's user avatar

asked Jun 25, 2011 at 9:23

DaveHeller's user avatar

11

Historically, Microsoft had a Windows port of redis, which was released as Redis-64, which offers a full distribution of redis for Windows.

The Microsoft port is now deprecated, but some alternatives have sprung up to fill that void:

  • Memurai is the alternative officially recommended on the Redis-64 deprecation page; it is a commercial offering with free developer tier, maintained by Janea Systems
  • redis-windows is another unofficial port, which also exists

This release includes the redis-server.exe (memurai.exe on Memurai) application that runs a Redis instance as a service on your windows machine, as well as redis-cli.exe (memurai-cli.exe on Memurai) which you can use to interact with any Redis instance.

The RGL repository has historically been listed as an alternative Windows port for Redis, but this repository has not been maintained for some time and implements an older version of Redis than the Microsoft port.

Marc Gravell's user avatar

Marc Gravell

1.0m260 gold badges2529 silver badges2876 bronze badges

answered May 9, 2012 at 22:47

serg's user avatar

sergserg

108k77 gold badges313 silver badges329 bronze badges

5

Update

If you have Windows Subsystem for Linux (WSL), natively on Windows 10 and Windows Server 2019 you can do it per
Ogglas answer

Or follow these instructions to run a Redis database on Microsoft Windows

    1. Turn on Windows Subsystem for Linux

    In Windows 10, Microsoft replaced Command Prompt with PowerShell as the default shell. Open PowerShell as Administrator and run this command to enable Windows Subsystem for Linux (WSL):

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    

    Reboot Windows after making the change — note that you only need to do this once.

    1. Launch Microsoft Windows Store
    start ms-windows-store:
    

    Then search for Ubuntu, or your preferred distribution of Linux, and download the latest version.

    1. Install Redis server

    Installing Redis is simple and straightforward. The following example works with Ubuntu (you’ll need to wait for initialization and create a login upon first use):

    sudo apt-add-repository ppa:redislabs/redis
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install redis-server
    

    Please note that the sudo command might or mightn’t be required based on the user configuration of your system.

    1. Restart the Redis server

    Restart the Redis server as follows:

    sudo service redis-server restart
    
    1. Verify if your Redis server is running

    Use the redis-cli command to test connectivity to the Redis database.

    $ redis-cli
    127.0.0.1:6379> set user:1 "Ben"
    127.0.0.1:6379> get user:1
    "Ben"
    

    Please note: By default, Redis has 0-15 indexes for databases, you can change that number of databases NUMBER in redis.conf.

    1. Stop the Redis Server
    sudo service redis-server stop
    

Source :How to Install Redis on Windows


I found one more simple way to install Redis under Windows

Download the latest Redis .msi file from

https://github.com/MSOpenTech/redis/releases

after installation. The Redis service is installed, and we can operate it from Service manager

enter image description here

answered Aug 28, 2015 at 6:58

zangw's user avatar

zangwzangw

41.2k19 gold badges162 silver badges198 bronze badges

7

If you want to install MSOpenTech’s latest port of Redis, on a Windows server, watched over by a Windows Service, without having to build anything yourself, read on.

MSOpenTech’s seems to be the only port that is actively trying to keep up with the latest and greatest Redis. They claim it is production-ready, but they haven’t exactly packaged it up neatly for installation on a server, especially if you want to run their RedisWatcher service to keep an eye on it, which is recommended. (I tried building RedisWatcher myself per their instructions, but the required Wix Toolset managed to mess up my system pretty good. I won’t go into it.) Fortunately they’ve provided all the binaries you need, just not all in one place. From the README:

So far the RedisWatcher is not carried over to 2.6. However this
should not be affected by the Redis version, and the code in the 2.4
branch should work with the Redis 2.6 binaries.

So you’ll need to download binaries from 2 branches in order to get all the necessary bits. Without further ado, here are the steps:

  1. Download and extract the Redis binaries from the 2.6 branch
  2. Copy all extracted binaries to c:redisbin
  3. Create another folder at c:redisinst1
  4. Download and extract the RedisWatcher binaries from the 2.4 branch
  5. Run InstallWatcher.msi. This should create a Windows service called Redis watcher.
  6. Open up the Windows Services console and start the Redis watcher service.
  7. (optional) RedisWatcher should have installed to C:Program Files (x86)RedisWatcher. There you’ll find a config file called watcher.conf, which you can edit to set up additional instances, use different paths than I specified in steps 2 & 3, etc. You will not need to restart the service for changes to take effect.

answered Nov 25, 2013 at 18:00

Todd Menier's user avatar

Todd MenierTodd Menier

36.6k16 gold badges145 silver badges167 bronze badges

5

The most updated (only few minor releases behind) version of Redis can be found here. This repository provides you with 3.2.100 version (current is 3.2) whereas the most upvoted answer gives you only 2.4.6 version and the last update to the repo was 2 years ago.

The installation is straightforward: just copy everything from the archive to any folder and run redis-server.exe to run the server and redis-cli.exe to connect to this server through the shell.

Community's user avatar

answered Oct 25, 2013 at 1:27

Salvador Dali's user avatar

Salvador DaliSalvador Dali

209k145 gold badges690 silver badges749 bronze badges

7

answered Mar 28, 2017 at 10:21

awebartisan's user avatar

awebartisanawebartisan

1,40416 silver badges26 bronze badges

5

If you have Windows Subsystem for Linux (WSL), natively on Windows 10 and Windows Server 2019 you can do it like this:

Set up WSL:

  1. To enable Windows Subsystem for Linux, follow the instructions on
    Microsoft Docs. The short version is: In Windows 10, Microsoft
    replaces Command Prompt with PowerShell as the default shell. Open
    PowerShell as Administrator and run this command to enable Windows
    Subsystem for Linux (WSL):

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    
  2. Reboot Windows after making the change—note that you only need to do this one time.

  3. Download and install one of the supported Linux distros from the Microsoft Store. Ubuntu works fine.
    Note that Ubuntu 20.04 LTS may give you some trouble because of a known issue with the realtime clock (as of August 2020). Choosing Ubuntu 18.04 LTS instead avoids that issue.

Install and Test Redis:

  1. Launch the installed distro from your Windows Store and then install redis-server. The following example works with Ubuntu (you’ll need to wait for initialization and create a login upon first use):

    > sudo apt-get update
    > sudo apt-get upgrade
    > sudo apt-get install redis-server
    > redis-cli -v
    
  2. Restart the Redis server to make sure it is running:

    > sudo service redis-server restart
    
  3. Execute a simple Redis command to verify your Redis server is
    running and available:

    $ redis-cli 
    127.0.0.1:6379> set user:1 "Oscar"
    127.0.0.1:6379> get user:1
    "Oscar"
    
  4. To stop your Redis server:

    > sudo service redis-server stop
    

Source:

https://redislabs.com/blog/redis-on-windows-10/

https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux

Carsten's user avatar

Carsten

2,0271 gold badge20 silver badges44 bronze badges

answered Nov 14, 2019 at 9:58

Ogglas's user avatar

OgglasOgglas

57.2k33 gold badges310 silver badges390 bronze badges

7

Go to the releases and you can get a ZIP file containing the relevant files as well as a Word document called RedisService.docx with the following instructions:

Installing the Service

—service-install

This must be the first argument on the redis-server command line. Arguments after this are passed in the order they occur to Redis when the service is launched. The service will be configured as Autostart and will be launched as «NT AUTHORITYNetworkService». Upon successful installation a success message will be displayed and Redis will exit.
This command does not start the service.

For instance:

redis-server —service-install redis.windows.conf —loglevel verbose

And then later, in the same document, another example:

The following would install and start three separate instances of Redis as a service:

redis-server —service-install -–service-name redisService1 –port 10001

redis-server —service-start —service-name redisService1

redis-server —service-install —service-name redisService2 –port 10002

redis-server —service-start —service-name redisService2

redis-server —service-install —service-name redisService3 –port 10003

redis-server —service-start —service-name redisService3

From what I can gather, this appears to be the new way forward rather than messing with a separate Windows service to monitor and restart the CLI.

answered Jun 4, 2014 at 20:04

bbrown's user avatar

bbrownbbrown

6,3505 gold badges37 silver badges43 bronze badges

6

Download redis from
Download Redis for windows

  • Then install it
  • open cmd with admin rights
  • run command net start redis

Thats it.

answered Nov 22, 2013 at 19:33

Guru's user avatar

GuruGuru

6446 silver badges18 bronze badges

1

MS Open Tech recently made a version of Redis available for download on Github. They say that it isn’t production ready yet, but keep an eye on it.

Github repo

Download releases as MSIs

jevon's user avatar

jevon

3,1383 gold badges32 silver badges40 bronze badges

answered Apr 27, 2012 at 4:07

JesseBuesking's user avatar

JesseBueskingJesseBuesking

6,4183 gold badges43 silver badges88 bronze badges

5

You can use Memurai for Windows, a Redis-compatible cache and datastore for Windows, currently compatible with Redis 5. Memurai aims to fulfill the need for a supported Redis-compatible datastore on the Windows platform. At its core, it’s based on Redis source code, ported to run natively on Windows, and it’s designed to provide the level of reliability and performance required for production environments. Memurai is free for development and testing. You can learn more and download Memurai at https://www.memurai.com.

Alexis Campailla
CEO, Memurai

answered May 15, 2019 at 1:11

Alexis Campailla's user avatar

4

There are two ways. You can use MSI installation file or do it manually:

First download the msi or the zip file:

You can download both files from here:

https://github.com/MicrosoftArchive/redis/releases

Watch video tutorial (video covers example of both installations)

See this installation video tutorial: https://www.youtube.com/watch?v=ncFhlv-gBXQ

Instruction — for those who can not YT at work:

You can download a moderately out-of-date precompiled version of Redis for 32-bit
and 64-bit Windows thanks to Dusan Majkic from his GitHub page: https://github.com/dmajkic/redis/downloads. Go ahead and do that now.

After you download Redis, you’ll need to extract the executables from the zip file.
As long as you’re using a version of Windows more recent than Windows XP, you
should be able to extract Redis without any additional software. Do that now.

After you’ve extracted either the 32- or 64-bit version of Redis to a location of your
choice (depending on your platform and preferences; remember that 64-bit Windows
can run 32- or 64-bit Redis, but 32-bit Windows can only run 32-bit Redis), you can
start Redis by double-clicking on the redis-server executable. After Redis has
started, you should see a window similar to figure A.1.

src: https://redis.com/ebook/appendix-a/a-3-installing-on-windows/a-3-2-installing-redis-on-window/

answered Nov 27, 2017 at 3:18

DevWL's user avatar

DevWLDevWL

16.4k6 gold badges88 silver badges83 bronze badges

3

Since MSOpenTech’s port of Redis is no longer maintained — anyone interested in native port of Redis for Windows can now get the version 4.0.14 and 5.0.10 from here: https://github.com/tporadowski/redis/releases.
This fork is a merge of latest 3.2.100 version from MSOpenTech and 4.0.14/5.0.10 from antirez/redis with a couple of bugfixes.

answered Apr 12, 2018 at 8:19

Tomasz Poradowski's user avatar

1

I don’t run redis on windows. There’s too much hassle involved in keeping up with the ports, and they lag behind redis-stable by a version or two all the time.

Instead I run redis on a Vagrant virtual machine that runs redis for me. I’ve bundled up the whole thing into a simple github repo so everyone can get in on the fun without too much hassle. The whole thing is an automated build so there’s no mess. I blogged about the details here.

koppor's user avatar

koppor

18.3k15 gold badges117 silver badges155 bronze badges

answered Jan 29, 2013 at 16:23

Jason Punyon's user avatar

Jason PunyonJason Punyon

38.6k12 gold badges96 silver badges121 bronze badges

3

To install Redis on Windows system follow the below steps:

  1. Visit one of the below link:

https://github.com/MSOpenTech/redis/releases (recommended)
https://github.com/rgl/redis/downloads

  1. Download MSI file.
  2. Follow the installation Wizard and install the program on your system. (do not change the installation path that is «C:Program FilesRedis»)
  3. Search for «Edit system environment variable» on your start menu
  4. Click on «Environment Variable» button
  5. Select «Path» and click on «Edit»
  6. Now click on «New»
  7. Paste C:Program FilesRedis (or the path in case you have changed while installing)
  8. Click on «Okay», «Okay» and «Okay»

Now open your Terminal (command prompt) and run redis-cli

Well I am getting some error to open redis-server (It was working fine till now but not sure what’s wrong so figuring out and will update this answer)

answered Jan 8, 2021 at 11:59

2

I think these is the two most simple ways to run Redis on Windows

1 — Native (and updated) port for Windows

As described here on Option 3) Running Microsoft’s native port of Redis:

  1. Download the redis-latest.zip native 64bit Windows port of redis

wget https://github.com/ServiceStack/redis-windows/raw/master/downloads/redis-latest.zip

  1. Extract redis64-latest.zip in any folder, e.g. in c:redis

  2. Run the redis-server.exe using the local configuration

cd c:redis

redis-server.exe redis.conf

  1. Run redis-cli.exe to connect to your redis instance

cd c:redis

redis-cli.exe

2 — With Vagrant

You can use Redis on Windows with Vagrant, as described here:

  1. Install Vagrant on Windows

  2. Download the vagrant-redis.zip vagrant configuration

    wget https://raw.github.com/ServiceStack/redis-windows/master/downloads/vagrant-redis.zip

  3. Extract vagrant-redis.zip in any folder, e.g. in c:vagrant-redis

  4. Launch the Virtual Box VM with vagrant up:

    cd c:vagrant-redis

    vagrant up

This will launch a new Ubuntu VM instance inside Virtual Box that will
automatically install and start the latest stable version of redis.

answered Jun 22, 2015 at 13:04

Dherik's user avatar

DherikDherik

16.9k11 gold badges116 silver badges158 bronze badges

2

If you’re happy with a bit of Powershell, you can also get very up-to-date Windows binaries using Powershell and chocolatey.

First, add chocolatey to Powershell following the instructions here (one simple command line as admin): https://chocolatey.org/

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%chocolateybin

Then, use Powershell to get the redis package from chocolatey: http://chocolatey.org/packages/redis-64

choco install redis-64

Redis will be installed in something like C:ProgramDatachocolateylibredis-64.2.8.9

Windows PowerShell Copyright (C) 2013 Microsoft Corporation. All
rights reserved.

PS C:windowssystem32> choco install redis-64 Chocolatey (v0.9.8.27)
is installing ‘redis-64’ and dependencies. By installing you accept
the license for ‘redis-64’ an d each dependency you are installing.

redis-64 v2.8.9 Added
C:ProgramDatachocolateybinredis-benchmark.exe shim pointed to
‘..libredis-64.2.8.9redis-benchmark.exe’. Added
C:ProgramDatachocolateybinredis-check-aof.exe shim pointed to
‘..libredis-64.2.8.9redis-check-aof.exe’. Added
C:ProgramDatachocolateybinredis-check-dump.exe shim pointed to
‘..libredis-64.2.8.9redis-check-dump.exe’. Added
C:ProgramDatachocolateybinredis-cli.exe shim pointed to
‘..libredis-64.2.8.9redis-cli.exe’. Added
C:ProgramDatachocolateybinredis-server.exe shim pointed to
‘..libredis-64.2.8.9redis-server.exe’. Finished installing
‘redis-64’ and dependencies — if errors not shown in console, none
detected. Check log for errors if unsure

Then run the server with

redis-server

Or the CLI with

redis-cli

Follow the instructions in C:ProgramDatachocolateylibredis-64.2.8.9RedisService.docx to install the redis service

Chloe's user avatar

Chloe

24.3k38 gold badges175 silver badges345 bronze badges

answered Aug 12, 2014 at 5:37

user783836's user avatar

user783836user783836

2,9192 gold badges28 silver badges32 bronze badges

One of the most easy way to run Redis on windows host is to use Docker Redis container. Just fire up Hyper-V, Download Docker and run Redis

answered Jan 15, 2018 at 19:54

Dzintars's user avatar

DzintarsDzintars

1,29020 silver badges26 bronze badges

I am using Memurai which is Redis-compatible cache and datastore for Windows. It is also recommended by Microsoft open tech as it written on their former project here.

This project is no longer being actively maintained. If you are
looking for a Windows version of Redis, you may want to check out
Memurai. Please note that Microsoft is not officially endorsing this
product in any way.

answered Jul 31, 2019 at 11:27

Nux's user avatar

NuxNux

4,1409 gold badges42 silver badges67 bronze badges

Using Windows 10?

https://learn.microsoft.com/en-us/windows/wsl/install-win10

/etc/apt/sources.list

(Debian 10 Buster/Bullseye)
Installs latest stable Redis (5.0.6 at time of posting)

deb https://deb.debian.org/debian bullseye main
deb https://deb.debian.org/debian bullseye-updates main
deb http://security.debian.org/debian-security/ buster/updates main
deb http://ftp.debian.org/debian bullseye-backports main
apt install redis-server

answered Aug 22, 2019 at 13:21

buycanna.io's user avatar

buycanna.iobuycanna.io

1,15616 silver badges18 bronze badges

Today I know these 4 options:

The first is an open source fork that is on tporadowski/redis that offers compatibility with version 5 (version 6 in development).

The second is memurai (paid), compatible with version 5, has support and a free version for development.

The third is the zkteco-home/redis-windows recently, which offers compatibility with version 7, but is not open source.

There is also the option to run via WSL. But I don’t recommend it in production environments.

answered May 11, 2021 at 13:55

Robson Piere's user avatar

You can try out baboonstack, which includes redis and also a node.js and mongoDB version manager. And it’s cross platform.

answered Sep 2, 2014 at 19:51

4kochi's user avatar

4kochi4kochi

1182 silver badges5 bronze badges

The redis version on windows was published by microsoft open tech team But recently this project has been archived to https://github.com/MicrosoftArchive/redis read-only and will not update. Has stopped development

answered Sep 25, 2017 at 1:58

Dan Nguyen's user avatar

Dan NguyenDan Nguyen

1,2806 silver badges16 bronze badges

Here are my steps to install Redis 4.0.8 on Windows 10 Pro (1709) via Windows Subsystem for Linux:

in home/user/
   01 wget http://download.redis.io/releases/redis-4.0.8.tar.gz
   02 tar xzf redis-4.0.8.tar.gz
   03 cd redis-4.0.8/
   04 sudo apt-get install make
   05 sudo apt-get update
   06 sudo apt-get install gcc
   07 cd deps
   08 make hiredis jemalloc linenoise lua geohash-int
   09 cd ..
   10 make

You can skip several steps if you have an up-to-date environment.

answered Feb 10, 2018 at 18:00

Kentative's user avatar

5

You can go through the below steps and get setup redis in windows.

  1. Download the Redis zip file. Click here!

  2. Extract the zip file to the prepared directory.

  3. Run redis-server.exe, you can either directly run redis-server.exe by clicking or run via command prompt.

enter image description here

  1. Run redis-cli.exe, after successfully running the redis-server. You can access it and test commands by running redis-cli.exe Test
    PING command is used to test if a connection is still alive.

enter image description here

Tenusha Guruge's user avatar

answered Oct 17, 2020 at 7:14

Duleepa Wickramasinghe's user avatar

1

Reading about some users running Redis in a VM, it brought to my mind the recommendations from Redis team :

Redis runs slower on a VM. Virtualization toll is quite high because for many common operations. (…) Prefer to run Redis on a physical box, especially if you favor deterministic latencies. On a state-of-the-art hypervisor (VMWare), result of redis-benchmark on a VM through the physical network is almost divided by 2 compared to the physical machine, with some significant CPU time spent in system and interruptions.

answered Nov 22, 2013 at 9:30

Pedro's user avatar

PedroPedro

517 bronze badges

Cover image for How to install Redis on Windows?

Aria Azadi Pour

In this article I’m going to teach you how you can use the latest version of Redis on windows using WSL or docker. We will use three different ways to install and use Redis on Windows.

What is Redis?

Redis is an open-source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Redis provides data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes, and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions, and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

redis logo

How to use Redis on Windows?

I will teach you three ways to install and use Redis on Windows.

  1. Using WSL(Debian based(eg. Ubuntu)) only
  2. Using WSL and Docker together
  3. Using Docker only

My preferred method is using docker only it will work perfectly and the only thing you need is to install Docker.

What is WSL?

The Windows Subsystem for Linux lets developers run a GNU/Linux environment — including most command-line tools, utilities, and applications — directly on Windows, unmodified, without the overhead of a traditional virtual machine or dualboot setup.

You can:

  • Choose your favorite GNU/Linux distributions from the Microsoft Store.
  • Run common command-line tools such as grep, sed, awk, or other ELF-64 binaries.
  • Run Bash shell scripts and GNU/Linux command-line applications including:
    • Tools: vim, emacs, tmux
    • Languages: NodeJS, Javascript, Python, Ruby, C/C++, C# & F#, Rust, Go, etc.
    • Services: SSHD, MySQL, Apache, lighttpd, MongoDB, PostgreSQL.
  • Install additional software using your own GNU/Linux distribution package manager.
  • Invoke Windows applications using a Unix-like command-line shell.
  • Invoke GNU/Linux applications on Windows.

wsl(windows + linux)

What is Docker?

In 2013, Docker introduced what would become the industry standard for containers. Containers are a standardized unit of software that allows developers to isolate their app from its environment, solving the “it works on my machine” headache. For millions of developers today, Docker is the de facto standard to build and share containerized apps — from desktop, to the cloud. We are building on our unique connected experience from code to cloud for developers and developer teams.

docker logo

Using WSL only

In this method, you need to install WSL and a Debian-based OS like Ubuntu on WSL and then open the terminal to start our work. After installing the OS you can follow the process below to start your own redis-server on Windows and use it with redis-cli.

1.As always before installing a new tool we need to update and upgrade our system you can do it with the commands below:

  $ sudo apt update && apt upgrade

Enter fullscreen mode

Exit fullscreen mode

2.Then you need to install redis-server package on your subsystem:

  $ sudo apt install redis-server

Enter fullscreen mode

Exit fullscreen mode

3.Now you need to start redis-server in order to work with Redis:

  $ sudo service redis-server start

Enter fullscreen mode

Exit fullscreen mode

4.Finally you can run redis-cli in order to test and use Redis:

  $ redis-cli

Enter fullscreen mode

Exit fullscreen mode

Note that you need to press (CTRL/OPT)+C or use the exit command in order to close the redis-cli.

Redis by default uses port 6379 if the port is not empty the service will not get started.

Redis configuration file is located at /etc/redis/redis.conf if you need to edit any configuration. (you need sudo access in order to read or write the file)

Using WSL and Docker together

In this method like the previous method first, you need to install WSL but you can install your OS of choice, for example, I will use Manjaro in this tutorial. After that, you need to install Docker and enable WSL integration for your OS of choice.

you can enable WSL integration for your OS of choice by opening Docker Desktop and going to Settings>Resources>WSL Integration and from there you can switch on your OS of choice.

1.First you need to create the Redis container and expose port 6379:

  $ docker container run --name container-name -p 6379:6379 -d redis

Enter fullscreen mode

Exit fullscreen mode

docker container run will make docker create and run a new container.

--name flag will specify the name of the container so you can change container-name to your name of choice.

-p flag will tell docker to expose a port from container to computer, in this case, is the Redis default port.

-d flag will start the container in the detach mode so the container won’t stop when we close our terminal.

2.Then you need to update and upgrade your packages before installing the redis-cli.

  $ sudo apt update && apt upgrade

Enter fullscreen mode

Exit fullscreen mode

3.After that you need to install redis-cli using your OS package manager, in my case pacman:

  $ sudo pacman -S redis

Enter fullscreen mode

Exit fullscreen mode

note that redis-cli will usually come with another package like redis or redis-server.

note that redis package names can be different in different package managers so if you are using some other OS you can do a google search and find out the name of the package for your OS.

Using Docker only

In this method unlike the other two, you don’t have to install WSL and the only thing you have to do is install Docker.

1.First you need to create the Redis container and expose port 6379:

  $ docker container run --name container-name -p 6379:6379 -d redis

Enter fullscreen mode

Exit fullscreen mode

docker container run will make docker create and run a new container.

--name flag will specify the name of the container so you can change container-name to your name of choice.

-p flag will tell docker to expose a port from container to computer, in this case, is the Redis default port.

-d flag will start the container in the detach mode so the container won’t stop when we close our terminal.

And finally the Redis means use the Redis image.

2.Finally you can run redis-cli using docker:

  $ docker container run -it --link container-name:redis --rm redis redis-cli -h redis -p 6379

Enter fullscreen mode

Exit fullscreen mode

-it flag will make docker open an interactive instance of the container.

--link flag will link the container we previously created as Redis in this container.

Note that you should change container-name with the name you chose in the first command.

--rm flag will make docker remove the container after we close it. (This is useful cause we will no longer need this container after we ran redis-cli command)

Same as before Redis means use the Redis image.

redis-cli -h redis -p 6379 is the command docker will run for us.

In the redis-cli command -h specifies the host which we set it to redis using --link flag.

And finally in the redis-cli command -p specifies the port which is by default 6379.

Resources

  • Redis
  • What is the Windows Subsystem for Linux? | Microsoft Docs
  • Why Docker? | Docker
  • Redis — Official Image | Docker Hub

Find Me

  • @AriaAzadiPour on Twitter

Learn Step By Step to install and set up Redis on Windows..

This tutorial shows multiple ways to install the Redis server on Windows.

  • Using Docker
  • Using Windows Subsystem for Linux
  • Window Installer or Zip

Following are the steps required to install Redis as a window Service

  • First, Download Redis for windows.
  • It downloads to the Redis-x64-5.0.14.1.msi file
  • Click on to install on windows.
  • Click next to proceed next steps.
  • In The Destination Folder, Give the path A:JavaRedis.
  • Next Screen, It asks for the Port to run Redis on box to 6379.
  • Give all default values and click the Next button
  • It installs as a window Services
  • Start the Redis server by Window + Run and type “Services.msc”.
  • It opens Services Window, selects Redis Services, and Right-click to start, restart and stop the server.

Install Redis using docker in Windows?

Check whether Redis is installed or not in windows

First, Open Command Line

change directory to the path A:JavaRedis in terminal

Run the below command to check the Redis version
It gives an installed redis server version

A:JavaRedis>redis-server -v
Redis server v=5.0.14.1 sha=ec77f72d:0 malloc=jemalloc-5.2.1-redis bits=64 build=5627b8177c9289c

next, type redis-cli on the command prompt to check cli is working or not

A:JavaRedis>redis-cli
127.0.0.1:6379>

try running the ping command to print the hello world message

127.0.0.1:6379> ping "Hello World"
"Hello World"



14 Dec, 21



by Antoniy Yushkevych



2 min Read

How to Install Redis on Windows

List of content you will read in this article:

  • 1. What is Redis?
  • 2. How to Install Redis on Windows
  • 3. Final Words

Redis is a great in-memory data structure store that can be used as a database, cache, and message broker. It is free to use and open-source, however, there is no official support for Windows. In today’s article, we will discuss how to install Redis on Windows.

What is Redis?

{what-is-redis(image)}

It is a very multifunctional software. Redis is an open-source in-memory data structure store, used as a database, cache, and message broker. It provides data structures such as strings, hashes, lists, sets, stored sets with range queries, bitmaps, hyperlog logs, geospatial indexes, and streams. Redis also has built-in replication, Lua scripting, LRU eviction, transactions, and different levels of on-disk persistence.

It has the possibility to run atomic operations on the following types: appending a string, incrementing a value in hash, pushing an element to a list, computing set intersection, union and difference, getting the member with the highest ranking in a sorted set. For maximum performance, Redis works with an in-memory dataset.

How to Install Redis on Windows

The Redis project does not officially support Windows, however, Microsoft Open Tech Group develops and maintains a Windows port, targeting Win64. You can find it on https://github.com/microsoftarchive/redis/releases.

  1. Download either the .msi file or the .zip from the link above

  1. Create a folder and extract the .zip file into it.

  1. Run the redis-server.exe.

  1. Run the redis-cli.exe

Now you can access the server with the client file and start using Redis.

Final Words

In this article, we shortly discussed what is Redis and followed up with a tutorial on how to install it on Windows OS. If you have any questions or suggestions, leave them in a comment down below.

Tutorial Setup and run Redis on Windows 10

Redis is a database system for storing and retrieving data, which supports many types of data such as strings, hashes, sets, sorted sets, and more. Basically, Redis is a repository of key values. Any value inside Redis is storing against a key that is binary secure. This value can be anything from an empty string to a long hash string. Each program must support a pre-designed map to name the Redis keys, to prevent any naming congestion. In this article, we are going to teach you about Tutorial Setup and run Redis on Windows 10. If you want to Get a Windows VPS server, you can see the packages available in Eldernode.

Redis stands for Remote Dictionary Server. This tool is a type of data structure that is storing in RAM and where information is temporarily stored. In the next section, we will fully introduce you to Redis. Then we will teach you how to Setup and run Redis on Windows 10. Join us, please.

Introduction to Redis

Redis stores data with a key-value system and thanks to this feature, access to and retrieval of this information will be much easier since there is no complex relationship between the data.

Key-Value is a type of server or storage location where information is stored in pairs of keys and values. For example, if I say Name=Michael, my key becomes Name and its value becomes Michael. In Redis, information is storing in the same way. Redis is a key-value database that stores information in RAM. So the speed of access to information will usually be multiplied.

Redis is quite different from databases like MySQL and Oracle; Because it does not contain columns, rows, tables, functions, etc. It should note that Redis does not use the Select, Insert, Update and Delete commands either. Instead, Redis uses data structures such as String, Lists, Sets, Hashes, and so on to sort information.

Redis is easy to use, and this feature has led many developers to use it. But the benefits of Redis do not end there. Here are some examples of the important benefits of Redis:

1. High speed: The strength of Redis is the high speed of this technology. Since it is written in C, we see a significant increase in speed in Redis.

2. Structure similar to the NoSQL database: The Redis structure is known as a NoSQL database, and this feature has made it popular among developers. Redis also has a data structure in memory. This means that it stores data in RAM using random memory.

3. Reduce costs: With Redis, you save fewer resources on the server and reduce the need to provide costly infrastructure.

4. Support for various programming languages: Redis supports most of the world’s leading programming languages. Languages ​​such as JavaScript, Java, Go, C, C++, C#, Python, Objective C, and PHP are well compatible with Redis, and Redis can be said to meet the needs of a wide range of developers.

Install and Setup Redis on Windows 10

After getting acquainted with Redis, in this section, we are going to teach you step by step How to Setup Redis on Windows 10. To do this, just follow the steps below.

The first step is to download the .zip or .msi file. The difference between a zip file and an MSI file is that in the ZIP file you have to add the environment variables manually while the MSI file is an installer and it does this for you automatically.

how to download redis on windows 10

Note: In this tutorial, we will do the installation using the zip file.

Then in the next step, you need to extract the ZIP File. We recommend that you create a new folder called “Redis” and extract the ZIP file in it. There are two important files in this folder that you should look for. One is the Redis-server.exe file, which runs the Redis server, and the other is Redis-cli.exe, which enables you to interact with the server.

extracted redis file

At this point, you should start the Redis server by double-clicking on Redis-server.exe.

runnig redis on windows 10

How to Run Redis on Windows 10

Note that Redis Server runs on port 6379 by default. Now it’s time to open Redis-cli and connect to the server. Double-click Redis-cli.exe to start the client interface.

start the client interface of redis

As you can see in the image above, Redis works in Windows 10. You do not have to refer to this list every time you run Redis. So you have to add the Redis-server and Redis-CLI path to the windows environment variable. By doing this, you will communicate via the command line. To add Redis Path to Windows 10 Environment Variable you must follow the steps below.

You must first right-click on the This PC icon. Then go to Properties. You can also do this by going to Control PanelAll Control Panel ItemsSystem.

Now in the System Variables section, double-click on the PATH variable and add the Redis folder path.

Finally, to test, you can open the Command Prompt and run the following command:

redis-server
redis-cli

Conclusion

In this article, we tried to introduce you to the concept of Redis in the first part. Then in the next section, we tried to teach you to step by step how to Setup and run Redis on Windows 10. You can refer to the article How to install and Secure Redis on Debian 10 and Ubuntu 20.04 if you wish.

Понравилась статья? Поделить с друзьями:
  • How to install windows xp 64 bit
  • How to install windows vista on usb
  • How to install qt designer on windows
  • How to install windows usb drive
  • How to install pyqt5 on windows