It's a trend. A large number of development software like development frameworks, databases and others seem to be first class citizens on Linux, IOS but not Windows. This is quite a change from the 1990s when Microsoft, Windows was where the action was at.
April 2016 however changed all that for Windows users. Windows introduced a feature called WSL (Windows Subsystem for Linux). Running Linux on Windows is possible without going through a hypervisor. Personally, ever since getting certified on Windows NT 4.0 in 1997, I was pretty sure this was possible after learning about Windows internal architecture specially the way subsystems work. In fact, Windows the way to know it is nothing but a subsystem called Win32 itself. OS architecture can be quite fascinating, here is a Wikipedia link on Windows Subsystems.
You must have guessed by now, we'll be using WSL (Windows Subsystem for Linux) to run Redis.
Enable WSL
- Press the Windows key + R to bring up the run command.
- Enter appwiz.cpl
- Click the link 'Turn Windows features on or off'
- Scroll down towards the end of the list of features and enable 'Windows Subsystem for Linux' in the popup Window
Install Ubuntu
- Ensure your Windows is updated to at least Build 16215 or later. If not, update Windows.
- Start the Microsoft Store Windows 10 app
- Search for Ubuntu. You'll probably get 3 hits. My example uses Ubuntu 18. You can choose 16, 18 or 20.
Get Redis running
Once Ubuntu is installed, start it by selecting it from the Start menu. Enter the following commands to download & build Redis.
# Download redis wget http://download.redis.io/releases/redis-5.0.8.tar.gz redis-5.0.8$ tar xzf redis-5.0.8.tar.gz # Build redis sudo apt update sudo apt install make sudo apt install gcc make distclean; make MALLOC=libc; make
Run Redis server with the following command:
src/redis-server
Run Redis client with the following command:
src/redis-cli
An alternative
If for some reason you don't want to use WSL, you do have an alernative which is to use Memurai which is a Redis compatible caching serve for Windows. If you have doubts about its compatibility, you'll be happy to know that it's so compatible that it can become a part of a Redis cluster, at least that what the vendor claims. I haven't tried Memurai myself, would appreciate any comments you have about it.
Ready for consumption
Redis run on port 6379 unless you change it. You should be able to connect to the running server from you favorite Redis client or client library which is running on Windows er.. Linux .. or whatever..