Step by step guide to run redis-server inside WSL(Windows Subsystem for Linux) on Windows
In the end I have manually created a simple one that does the job. This script basically starts a hidden Ubuntu Window and starts redis-server inside it.
Install WSL (this is tested with Ubuntu 18.04 version)
Install redis-server inside WSL
sudo apt install redis-server
Add sudo permission to your user to execute service command without password Open sudoers file
sudo visudoand add to end:
your_username ALL=NOPASSWD:/usr/sbin/service redis-serveror if you want to disable sudo passwords generally add this to the end:
your_username ALL=(ALL:ALL) NOPASSWD:ALL
Create vbs file e.g start-redis.vbs inside startup folder (Open Run and enter
In vbs file insert following:
Set oShell = CreateObject("WScript.Shell") oShell.Run "wsl", 0 oShell.Run "bash -c ""sudo service redis-server start --daemonize yes"""
- That's it. You can try it by running vbs script and then run htop inside WSL terminal. You should see that redis is running. You can also set this up to work with Windows Task Scheduler.