How do I run Redis on Windows?

2019-01-02 19:21发布

问题:

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

Can I run Redis natively on Windows?

回答1:

One click Redis install as a Windows service:

https://github.com/rgl/redis/downloads

Download and run the top .exe (ignore the "download as zip" button)

Edit: For the latest versions of Redis for Windows look at MSOpenTech/redis. See Todd Menier's answer for more information.



回答2:

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



回答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.


回答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.



回答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 prepared the first option

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

  • run redis-server.exe

  • then run redis-cli.exe

You can start using Redis now please refer for commands



回答6:

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 AUTHORITY\NetworkService". 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.



回答7:

Maybe its a little Late but, I was able to run Redis on Windows 10 Aniversary Update.
Windows 10 Aniversary Update Comes with Bash on Ubuntu on Windows, simply, it comes with bash.

Below are the two tutorial that I followed:

1- How to Install and Use the Linux Bash Shell on Windows 10
2- How To Install and Use Redis

Below is the image of running Redis.

Enjoy :)



回答8:

Download redis from Download Redis for windows

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

Thats it.



回答9:

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



回答10:

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.



回答11:

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



回答12:

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%\chocolatey\bin

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:\ProgramData\chocolatey\lib\redis-64.2.8.9

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

PS C:\windows\system32> 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:\ProgramData\chocolatey\bin\redis-benchmark.exe shim pointed to '..\lib\redis-64.2.8.9\redis-benchmark.exe'. Added C:\ProgramData\chocolatey\bin\redis-check-aof.exe shim pointed to '..\lib\redis-64.2.8.9\redis-check-aof.exe'. Added C:\ProgramData\chocolatey\bin\redis-check-dump.exe shim pointed to '..\lib\redis-64.2.8.9\redis-check-dump.exe'. Added C:\ProgramData\chocolatey\bin\redis-cli.exe shim pointed to '..\lib\redis-64.2.8.9\redis-cli.exe'. Added C:\ProgramData\chocolatey\bin\redis-server.exe shim pointed to '..\lib\redis-64.2.8.9\redis-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:\ProgramData\chocolatey\lib\redis-64.2.8.9\RedisService.docx to install the redis service



回答13:

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

1 - Native (and updated) port for Windows

As described here:

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

wget https://raw.github.com/ServiceStack/redis-windows/master/downloads/redis64-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.



回答14:

The Redis download page now has links to some unofficial Windows ports. The dmajkic one seems to be the most popular/complete.

More detailed answer: How to run Redis as a service under Windows



回答15:

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



回答16:

you can install Redis by following this article: https://github.com/ServiceStack/redis-windows but for going straight, you can download it by this link: https://github.com/ServiceStack/redis-windows/raw/master/downloads/redis-latest.zip after downloading, go to the directory which you like to put your files,then extract the zip file, then open a command prompt and go to the directory where you extracted your file, then type "redis-server" and hit enter(for opening redis-cli open command and route to redis directory, but instead of "redis-server" execute "redis-cli").



回答17:

I've provided installation instructions and downloads for the 2 most popular ways of running Redis on windows at: https://github.com/mythz/redis-windows that shows how to:

  1. Use Vagrant to run the latest stable version of Redis inside a VirtualBox VM.
  2. Download and run Microsoft's Native Windows port of Redis


回答18:

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



回答19:

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



回答20:

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.



回答21:

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.



回答22:

Since MSOpenTech's port of Redis is no longer maintained - anyone interested in native port of Redis for Windows can now get the "alpha" version of Redis 4.0.2 for Windows from here: https://github.com/tporadowski/redis/releases. This fork is a merge of latest 3.2.100 version from MSOpenTech and 4.0.2 from antirez/redis with a couple of bugfixes. Currently that port has no module support and dependencies are still to be updated to what Redis uses.



回答23:

Latest Redis x86 builds (32-bit) can be found here: http://bitsandpieces.it/redis-x86-32bit-builds-for-windows

Says that he will maintain both 2.8.* and 3.0.* branches.



回答24:

Taken from: http://avenshteinohad.blogspot.com/2016/01/redis-jedis-quickstart.html

If you use windows, use MSOpenTech version from:

https://github.com/MSOpenTech/redis

You also might find this post useful to get started with basic commands.



回答25:

The Redis project does not officially support Windows. However, the Microsoft Open Tech group develops and maintains this Windows port targeting Win64.

http://redis.io/download



回答26:

VARY EASY:(NO ANY CAMMAN OR NOT GOING TO ANY LINK,ONLY FOLLOW THIS STEP ,FOR ALL VERSION)   
             FIRST INSTALL REDIS 
                -->>AFTER OPEN TASKBAR
                -->>OPEN SERVICE(taskbar service)
                -->>CHOOSE REDIS 
                -->>RIGTH CLICK ON REDIS SERVICE AND OPEN SERVICE(VIEW IMAGES) 
                -->>CLICK ON START OR RESTART.(ALSO SET AUTOSTART)


回答27:

It seems this is the easiest way to get the latest version of Redis - use NuGet Manager:

1) Open NuGet setup page and download Command-Line Utility (The latest version of the nuget.exe command-line tool is always available from https://nuget.org/nuget.exe)

2) Copy this file to somewhere (for example, C:\Downloads)

3) Start a command prompt as an Administrator and execute follow commands:

cd C:\Downloads
nuget.exe install redis-64

4) In the Downloads folder will be the latest version of Redis (C:\Downloads\Redis-64.2.8.19 in my case)

5) Run redis-server.exe and start working

P.S. Note: redis from Download Redis for windows contains a very old version of Redis: 2.4.6



标签: