How do I run Redis on Windows?

747,705

Solution 1

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.

Solution 2

Update

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


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, we can operate it from Service manager

enter image description here

Solution 3

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:\redis\bin
  3. Create another folder at c:\redis\inst1
  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.

Solution 4

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.

Solution 5

To install Redis for Windows

You can choose either from these sources

  1. https://github.com/MSOpenTech/redis/releases or
  2. https://github.com/rgl/redis/downloads

Personally I preferred the first option

  • Download Redis-x64-2.8.2104.zip
  • Extract the zip to prepared directory

  • run redis-server.exe or redis-server.exe --maxheap 2gb

enter image description here

  • then run redis-cli.exe

enter image description here

enter image description here

You can start using Redis now, please refer for commands

Share:
747,705
DaveHeller
Author by

DaveHeller

Updated on February 21, 2022

Comments

  • DaveHeller
    DaveHeller about 2 years

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

    Can I run Redis natively on Windows?

    • Salvador Dali
      Salvador Dali over 10 years
      Keep in mind that the most upvoted answer links to outdated repo with very old version of redis. If you need much newer version check my answer link
    • Todd Menier
      Todd Menier about 10 years
      MSOpenTech just announced a production-ready build of Redis 2.8.4. It looks like my instructions for gathering up all the bits are still relevant though.
    • SSED
      SSED over 8 years
      for local development setup - geekindulgence.com/…
    • Cihan B.
      Cihan B. about 7 years
      I recommend using Docker on Windows with redis. few repos: - the official redis repo: hub.docker.com/_/redis - the redis-enterprise repo (clustered redis running Redis Cloud by Redis Labs): hub.docker.com/r/redislabs/redis
    • Todd Menier
      Todd Menier about 6 years
      Pay attention to the DATES of the answers (and comments), which is more important than upvotes for this particular question. MOST answers (including mine) are now outdated. Microsoft's native port appears to be discontinued. If you have the latest Windows 10, running Redis on Ubuntu on Windows appears to be quite possibly the best option. See here.
    • jinglesthula
      jinglesthula almost 6 years
      It looks like the MSFT port hasn't been updated since 2016.
    • Alexis Campailla
      Alexis Campailla almost 5 years
      Most answers are outdated and point to projects that are now abandoned. The MSOpenTech port was discontinued in 2016. See my answer for a solution that is up-to-date with the latest Redis (Redis 5, at the time of this writing).
    • Karthik P
      Karthik P over 4 years
      I suggest using WSL for windows, redislabs.com/blog/redis-on-windows-10
    • Somnath Singh
      Somnath Singh over 3 years
      all these versions are outdated where can found 6.0 version for windows. And why is they so difficult to find even when the Redis is used in almost all big projects?
    • Md. Alim Ul Karim
      Md. Alim Ul Karim over 3 years
      # Redis Installation Link for Windows github.com/tporadowski/redis/releases
    • user63898
      user63898 about 2 years
      you can use it compiled in cygwin see this instructions: github.com/meiry/redis5_compiled_for_windows10
  • desperateCoder
    desperateCoder almost 11 years
    Wasn't one click for me. I've run the executable and still not sure how to get it to run
  • solublefish
    solublefish almost 11 years
    After running the installer, I had to manually put a redis.conf file in c:\Program Files\Redis, as described in the readme. I just copied c:\program files\Redis\conf\redis-dist.conf. Then I could start the service from the services control panel (or 'net start redis' from a command line)
  • Ingo Kegel
    Ingo Kegel almost 11 years
    I had to edit the service and change the account to "local system", otherwise the service would not start. I did not have to copy any config files.
  • Todd Menier
    Todd Menier over 10 years
    Straightforward if just want to run the exe, which I'd never do in a production environment without the watcher service, and they haven't provided binaries for that in the 2.6 branch for whatever reason. Fortunately the 2.4 version of the service is compatible with the 2.6 version of the exe - see my answer to get it all up an running.
  • Salvador Dali
    Salvador Dali over 10 years
    @ToddMenier most probably no one would run exe in production environment, because people would use some linux system for this. This is how to set up redis to be able to play with it and to learn (and I do not see why would I need to run multiple instances of redis here)
  • Todd Menier
    Todd Menier over 10 years
    I'm running it in production and it works great. That said, all else being equal you are right, Linux is the way to go. But we're a small Windows shop without much *nix expertise to speak of.
  • MartyIX
    MartyIX about 10 years
  • Royi Namir
    Royi Namir about 10 years
    +1 ( for the img trick) . ps - how can I make my windows run the redis server without user login ? is there any service version for redis server executable ? for example - there server was reset , and now the logon window appear. but I want redis server - at that point - to be running.
  • Christiaan Westerbeek
    Christiaan Westerbeek almost 10 years
    You'll be happy to try this one. It works (on my Windows 2008 R2 64bit server at least). Takes you 5 minutes.
  • ducu
    ducu almost 10 years
    Current release (redis-2.8.12.zip) only works for x64 Windows. Try 2.6 branch for the x86 release, but this one doesn't run as a service: github.com/MSOpenTech/redis/tree/2.6/bin/release
  • Stephen Patten
    Stephen Patten over 9 years
    How to you access Redis once the vm boots? by IP?
  • Stephen Patten
    Stephen Patten over 9 years
    Once vagrant has got the box up and running, how do you access redis? I think the latest build did not compile redis correctly. This would be vagrant on windows 64bit
  • Stephen Patten
    Stephen Patten over 9 years
    Humm, I see in the commands that are executed that the redis port was forwarded :) So I assume it means localhost:6379 is where I use redis from
  • Stephen Patten
    Stephen Patten over 9 years
    I think the port gets forwarded if I'm not mistaken
  • maurits
    maurits over 9 years
    @StephenPatten: Yeah, you should be able to access it at localhost:6379.
  • Stephen Patten
    Stephen Patten over 9 years
    Yeah, the redis build failed :(
  • tfont
    tfont over 9 years
    I receive a nice error when running InstallWatcher.msi: There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor.
  • Ryan Shripat
    Ryan Shripat about 9 years
    At the end, if you want to know that it's installed and working fine, you can download the Redis Desktop Manager (github.com/uglide/RedisDesktopManager or via Chocolatey). By default, the Host is localhost running on port 6379.
  • godimedia
    godimedia about 9 years
    Is this method valid for 2.8?
  • godimedia
    godimedia about 9 years
    Do we need to install Visual Studio, just for installing Redis on Windows? How stupid. :|
  • JesseBuesking
    JesseBuesking almost 9 years
    @arun I just checked and it works. Maybe there was a hiccup or github is blocked for you?
  • arun
    arun almost 9 years
    Hmm, I even logged in. Still doesn't work for me. But I am using Salvador Dali's solution now.
  • Igor Kudrin
    Igor Kudrin almost 9 years
    Binaries were moved to Releases page github.com/MSOpenTech/redis/releases
  • bbrown
    bbrown almost 9 years
    Thanks, Igor! I've updated the introductory paragraph above to reflect that change.
  • rtfminc
    rtfminc almost 9 years
    Also at this site is a way to run Redis w/o vagrant. In windows 8 I had it running in 2 minutes.
  • PreguntonCojoneroCabrón
    PreguntonCojoneroCabrón over 8 years
    Chocolatey for install it : geekindulgence.com/… Useful for development machine IMHO. For server, I'm confused it.
  • khaosdoctor
    khaosdoctor over 8 years
    Did this but the port command did not work, só I just tried: redis-server --service-install --service-name Redis And it worked
  • user64141
    user64141 over 8 years
    Thanks, Salvador. This was just what I was looking for. To show my gratitude, I just gave you double credit. One upvote for the correct answer, and one upvote for pointing me away from the outdated, yet most upvoted answer.
  • Lu Roman
    Lu Roman over 8 years
    This worked for me (zip), i tried with the msi that is listed on the same link but didn't work.
  • Bhargav Rao
    Bhargav Rao about 8 years
    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
  • Dhrumil Bhankhar
    Dhrumil Bhankhar almost 8 years
    Please note that you might get behavior that you click on "redis-server.exe" and nothing happens. Actually, you need to run that exe from command prompt and supply "--maxheap" param. Something like... "redis-server --maxheap 1024M"
  • Tom
    Tom over 7 years
    Yep, best solution even though I upvoted a solution above. This one does not require to start redis-server.exe to use it.
  • BaltoStar
    BaltoStar over 6 years
    looks like work stopped at 3.2 pre-release but redis is now on 4.0
  • sherdim
    sherdim over 6 years
    redis 2.6.12 is the last version that works on Windows Server 2003.
  • sherdim
    sherdim over 6 years
    To get most recent variant of this nice solution that still works on Windows Server 2003 you should: 1. Install as is + tune permissions if you set another user to run service with 2. Change exe files to ones w version 2.6.12 from Todd's solution (see next) 3. Remove strings in \conf\redis.conf from ###### VIRTUAL MEMORY #### to the end
  • r3wt
    r3wt about 6 years
    how do you create a service with it? some of us are not experienced in these areas
  • Kentative
    Kentative about 6 years
    Running as a service/server: $ src/redis-server --from the site: redis.io/download
  • Pyrejkee
    Pyrejkee about 6 years
    The most simple way to get an instance of redise under the windows.
  • MAZux
    MAZux almost 6 years
    I got The operation could not be completed
  • jinglesthula
    jinglesthula almost 6 years
    As a note, I installed Ubuntu 18 from the Windows store and had to sudo apt install gcc make before I could get Redis installed and built. Ran into this one as well ;) stackoverflow.com/questions/37103054/…
  • War
    War over 5 years
    Eh? "here are my instructions to install redis on windows" ... bunch of linux commands run in linux using "Windows Subsystem" ... :facepalm:
  • Kentative
    Kentative over 5 years
    War - this is using Window but via Windows Subsystem for Linux --I find this to be the best solution.
  • neslekkiM
    neslekkiM over 5 years
    How do you access this install from windows?
  • awebartisan
    awebartisan over 5 years
    you access it from Bash. and if you are running an application like Laravel you just need to setup the variables in environment file and redis will be available in your project. Because of its port 6379
  • J. Allen
    J. Allen over 5 years
    Man it would be nice if someone just wrote down what was in the video. Not everyone can youtube at work.
  • MortenB
    MortenB about 5 years
    This answer is outdated havent been built new releases since 2016. latest recommendation is on windows10 to install under WSL
  • MortenB
    MortenB about 5 years
    Persistant services under WSL is not supported. Its a downer to run sudo service redis-server start everytime the win10 box is restarted. better to use a docker container
  • Maxim Mandrik
    Maxim Mandrik about 5 years
    In the downloaded zip archive, there is an instruction file in docx. Its copy in txt is also here: raw.githubusercontent.com/MSOpenTech/redis/3.0/… on github.com/MicrosoftArchive/redis under the heading "How to configure and deploy Redis on Windows ".
  • Urasquirrel
    Urasquirrel almost 5 years
    This was helpful! Thanks!
  • raddevus
    raddevus almost 5 years
    This is the definitive answer. Easiest most reliable way to get "official" redis on windows. thx
  • Cristiana Chavez
    Cristiana Chavez almost 5 years
    Please note: just get the latest release. Happy coding!
  • Ahmed Aboud
    Ahmed Aboud almost 5 years
    github.com/microsoftarchive/redis/releases/tag/win-3.2.100 download the msi installer and install and cd to the installed directory and typ 'ping' to test and thats it
  • Ramesh
    Ramesh over 4 years
    if you have not connected with redis For windows from Command Prompt, cd C:\Program Files\Redis and then redis-server
  • airstrike
    airstrike about 4 years
    As much as I appreciate your efforts, that EULA is a no-no. Pass.
  • airstrike
    airstrike about 4 years
    github.com/tporadowski/redis has carried on with updating MS Open Tech to the ~latest versions of redis
  • TamusJRoyce
    TamusJRoyce about 4 years
    cygwin handles registry changes poorly. msys2 is a better method of compiling redis.
  • JLi
    JLi almost 4 years
    I had tried the instruction in link 2, it did not work for me but this did: redislabs.com/blog/redis-on-windows-10, with ubuntu 18.04
  • JLi
    JLi almost 4 years
    A note- the newest version for ubuntu in the store did not work for me. Had to uninstall and install the 18.04 version instead for redis to work.
  • np8
    np8 almost 4 years
    This is the most up-to-date way to use Redis on Windows 10.
  • np8
    np8 almost 4 years
    The versions in github.com/MSOpenTech/redis/releases are outdated. Current recommendation is to use WSL.
  • np8
    np8 almost 4 years
    These versions are out of date years ago. The current recommendation is to use WSL.
  • np8
    np8 almost 4 years
    This is the way to go (WSL), but the details are missing (are behind links). @Ogglas 's answer is the same but with the installation instructions.
  • jbernardo
    jbernardo almost 4 years
    I think using this is the more up to date way to natively run Redis on Windows.
  • 1UC1F3R616
    1UC1F3R616 almost 4 years
    Yep, for windows :)
  • borjab
    borjab almost 4 years
    Here is the official blog with this solution: redislabs.com/blog/redis-on-windows-10
  • Tiago B
    Tiago B almost 4 years
    If you try it today, you get the error Unable to find package 'redis-64'.
  • Carsten
    Carsten over 3 years
    As per @JLI's comment above, there is a known issue with Ubuntu 20.04 in combination with WLS. Using 18.04 is easier than any of the fixes offered on the corresponding issue: github.com/microsoft/WSL/issues/4898
  • Tushar
    Tushar over 3 years
    Is there an open source edition or a limited feature production edition available ?
  • Alexis Campailla
    Alexis Campailla over 3 years
    @Tushar there is no open source or free production edition. However we have pricing plans that accommodate different (eg small startup) needs, so I recommend you reach out at memurai.com/contact
  • Rickless
    Rickless over 3 years
    I'm using Debian via WLS and it's working just fine
  • Md. Alim Ul Karim
    Md. Alim Ul Karim over 3 years
    Loved your solution
  • Marcus Vinicius Campos
    Marcus Vinicius Campos over 3 years
    I'm using Win 10.0.18363.1198 + WSL 1 (confirmed using PS 'wsl -l -v') and Ubuntu 20.04 here without issues. Redis is running fine and receiving commands. This is not a production environment, but for dev+test all seems in order.
  • Smart Manoj
    Smart Manoj over 3 years
    exe not in v6.0.9
  • Shashikant Pandit
    Shashikant Pandit about 3 years
    I followed the same steps and it worked. Before renning the redis-cli make sure to run redis-server.
  • johnny 5
    johnny 5 about 3 years
    I have it running and working with a program, but how do I access the webpage, I tried navigating to localhost:6379 but nothings there
  • pepe450
    pepe450 about 3 years
    Both of those options are now very old and out of date versions of Redis. Getting the latest Docker version or using WSL are better options.
  • Irfandy Jip
    Irfandy Jip almost 3 years
    Should be accepted as the right answer. Just wanted to confirm what @TomDibble has said, I tried using Ubuntu 20.04. There's a bit moment of stuck when I ran sudo apt-get upgrade, but I pressed CTRL + C which I thought would abort the operation, but then it sets up the downloaded package. I thought I have to install Ubuntu 18.04, but I continue with the redis installation first. And well, the rest of the command just works. Will update if I finally have to change back to 18.04.
  • Sobhan
    Sobhan over 2 years
    the most helpful post for this issue, thank you @Ogglas
  • nrion
    nrion over 2 years
    @TamusJRoyce hi! how would one compile redis on msys2?
  • TamusJRoyce
    TamusJRoyce over 2 years
    github.com/redis/redis - follow the steps in the readme. Make sure when you install msys2 and mingw, you include the dependencies in the msys2 installer. Recently, also I highly recommend wsl (I like wsl 1 over 2, as 1 uses windows kernel without cpu virtualization & this app is in-memory - disk is slower in wsl1, but either works). Using Ubuntu on Windows. Works great for me in wsl1 ubuntu using apt-get and .bash-rc startup!
  • M_Farahmand
    M_Farahmand over 2 years
    @DevWL Microsoft archive doesn't support newer version of redis, but in this address (github.com/tporadowski/redis/releases ) exists up to version 5 .
  • Benedetto
    Benedetto about 2 years
    Redis from MicrosoftArchive is old, unsopported and full of bugs. I would not recommend it for any use. Running Redis with WSL is not recommended for production use last time I checked.
  • Jason
    Jason about 2 years
    I prefer this method myself. +1
  • Awshaf Ishtiaque
    Awshaf Ishtiaque almost 2 years
    I was wondering how this will translate to when we, for example, decide to host our application on a cloud? How will we instruct the cloud server to do these task, like starting redis-server.exe?
  • Cristiana Chavez
    Cristiana Chavez almost 2 years
    @AwshafIshtiaque this is just for local setup, there are a lot of options you can use redis in cloud, you can use fully manage in memory service like uptash redis vercel, elasticcache AWS,or host it to your nginx server for cloud. digitalocean.com/community/tutorial_collections/…