Install Redis on Windows via WSL2

Use the official Linux Redis packages inside Windows Subsystem for Linux 2. Keep close parity with Linux servers while developing on Windows.

TL;DR — 7 quick steps

  1. Enable WSL and virtualization: turn on Windows features for WSL and Virtual Machine Platform, then reboot.
  2. Install a Linux distribution: pick a distro from Microsoft Store (e.g., Ubuntu) and complete first‑run setup.
  3. Update packages: open the distro terminal and update its package index.
  4. Install Redis: use your distro’s package manager to install the redis server package.
  5. Start the server: run the service and confirm it starts without errors.
  6. Enable autostart (optional): configure the service to start automatically when the distro launches.
  7. Verify connectivity: from Windows, connect to the Redis instance listening on the default port (typically 6379).

Before you start

  • Windows 10/11 with WSL2 support
  • Admin rights to enable features
  • Stable internet connection for package downloads
This guide focuses on upstream Linux Redis via WSL2. If you prefer a native Windows service, see Memurai.

Networking on Windows ↔ WSL2

  • Localhost access: on modern Windows/WSL2, apps on Windows can usually reach services in WSL2 via localhost if the service is bound to all interfaces inside WSL2.
  • Fallback by IP: if localhost doesn’t work, use the distro’s current IP (it may change across reboots) and allow the port through your firewall.
  • Firewall scopes: keep rules tight (local machine or dev subnet only). Avoid exposing Redis publicly.
  • Port conflicts: ensure no other process is using 6379 on the Windows host.

Autostart and persistence

  • Service autostart: configure your Linux service manager to start Redis when the distro launches.
  • Distro autostart: ensure your WSL2 distro is started on login if you need Redis up early.
  • Persistence: review snapshotting vs. AOF based on durability/performance needs.
  • AV exclusions: for better I/O, exclude Redis data directories from real‑time scanning (Windows Defender/other AV).

Troubleshooting

  • WSL not enabled: confirm both WSL and Virtual Machine Platform features are active, then reboot.
  • Service won’t start: check distro logs for configuration errors or missing dependencies.
  • Can’t connect from Windows: verify the service is listening, the correct address is used, and firewall rules allow the port.
  • Performance dips: check AV exclusions, disk type, and persistence settings. See Performance notes.

Prefer a different path?

Want a native Windows service? Try Memurai. Need a quick local run? Use the direct Windows build (Cygwin‑based).

Install Memurai Direct Download (ZIP)

The ZIP is a convenience Windows build (Cygwin‑based) and not the official Windows release by Redis Ltd.