How to Install Redis on Windows Server 2022

Redis is an in-memory data structure store used as a database, cache, message broker, and streaming engine. While Redis is natively a Linux application, it runs on Windows Server 2022 through several supported approaches: using Memurai (a Redis-compatible server built for Windows), running official Redis inside Windows Subsystem for Linux 2 (WSL2), or using Docker Desktop on Windows. This guide covers all three approaches in detail, with emphasis on Memurai as the most straightforward native Windows option, along with Redis configuration, security, persistence, and tooling.

Option 1: Installing Memurai on Windows Server 2022

Memurai is a Redis-compatible in-memory data store built natively for Windows. It supports the full Redis API and is designed for Windows production environments where WSL2 or Docker is not desired.

Download the Memurai installer from https://www.memurai.com/get-memurai. Select the Windows 64-bit MSI installer. Run it as Administrator. During installation, Memurai will register itself as a Windows service named Memurai and install the memurai-cli command-line client (which is compatible with redis-cli syntax).

Verify the service is running:

Get-Service -Name "Memurai"

The configuration file is located at C:Program FilesMemuraimemurai.conf. The service binds to 127.0.0.1 on port 6379 by default.

Option 2: Redis via WSL2 on Windows Server 2022

WSL2 provides a full Linux kernel on Windows Server 2022, allowing you to run the official Redis for Linux. First, install WSL2 and a Linux distribution (Ubuntu is recommended).

Enable WSL2 features and install Ubuntu from PowerShell as Administrator:

wsl --install -d Ubuntu-22.04

After the Ubuntu environment is set up, install Redis inside WSL2:

sudo apt update
sudo apt install -y redis-server
sudo service redis-server start
redis-cli ping

You should see PONG. Redis in WSL2 is accessible from Windows at 127.0.0.1:6379. To start Redis automatically when WSL2 launches, add the service start command to /etc/wsl.conf or use a Windows Task Scheduler task to launch it at boot.

Option 3: Redis in Docker on Windows Server 2022

Docker Desktop (or Mirantis Container Runtime for Windows Server) allows running the official Redis Docker image. Install Docker on Windows Server 2022, then pull and run Redis:

docker pull redis:7.2
docker run -d --name redis-server `
  -p 6379:6379 `
  -v C:dataredis:/data `
  redis:7.2 redis-server --requirepass YourRedisPassword123!

This starts Redis with password authentication and mounts a Windows directory for persistence. Connect with redis-cli through Docker:

docker exec -it redis-server redis-cli -a YourRedisPassword123!

Testing Redis with redis-cli (or memurai-cli)

Whether using Memurai or Redis via WSL2/Docker, the CLI commands are identical. Open a terminal and connect:

redis-cli -h 127.0.0.1 -p 6379

If authentication is enabled, supply the password:

redis-cli -h 127.0.0.1 -p 6379 -a YourRedisPassword123!

Run the basic health check and test key operations:

PING
# Response: PONG

SET mykey "hello"
GET mykey
# Response: "hello"

SET counter 0
INCR counter
INCR counter
GET counter
# Response: "2"

EXPIRE mykey 60
TTL mykey
# Response: seconds remaining

DEL mykey
EXISTS mykey
# Response: 0 (key deleted)

Configuring redis.conf (or memurai.conf)

For Memurai, edit C:Program FilesMemuraimemurai.conf. For Redis in WSL2, edit /etc/redis/redis.conf. The configuration options are identical. Key settings to review:

# Network
bind 127.0.0.1                  # Change to 0.0.0.0 or specific IP for remote access
port 6379
protected-mode yes               # Requires bind + requirepass when disabled

# Authentication
requirepass YourRedisPassword123!

# Memory management
maxmemory 512mb                  # Limit Redis memory usage
maxmemory-policy allkeys-lru     # Evict least recently used keys when maxmemory hit
# Other eviction policies: noeviction, allkeys-lfu, volatile-lru, volatile-ttl

# Persistence - RDB snapshots
save 900 1                       # Save if at least 1 key changed in 900 seconds
save 300 10                      # Save if at least 10 keys changed in 300 seconds
save 60 10000                    # Save if at least 10000 keys changed in 60 seconds
dbfilename dump.rdb
dir /var/lib/redis               # On Windows with Memurai: C:ProgramDataMemurai

# Logging
loglevel notice
logfile "C:\ProgramData\Memurai\memurai.log"

# Connections
maxclients 100
tcp-keepalive 300

After editing the configuration, restart the service:

Restart-Service -Name "Memurai"

Redis Persistence: RDB vs AOF

Redis offers two persistence mechanisms that can be used independently or together.

RDB (Redis Database) persistence creates point-in-time snapshots of the dataset. It is configured with the save directives shown above. RDB produces compact binary files and is efficient for backups, but you may lose data written since the last snapshot in a crash scenario.

AOF (Append-Only File) persistence logs every write operation to a file. It provides much stronger durability guarantees. Enable AOF in redis.conf:

appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec              # Options: always, everysec, no
                                  # everysec is the recommended balance of safety and performance
auto-aof-rewrite-percentage 100   # Rewrite AOF file when it grows 100% larger
auto-aof-rewrite-min-size 64mb

With appendfsync everysec, Redis flushes the AOF file to disk once per second. In a crash, you lose at most one second of writes. The appendfsync always option writes synchronously on every command, providing the highest durability at a significant performance cost.

For production caches where data loss is tolerable and performance is critical, disable both RDB and AOF. For session stores or queues where durability matters, enable AOF with appendfsync everysec. Use both RDB and AOF together for the strongest recovery guarantees.

Opening Windows Firewall Port 6379

If Redis needs to be accessible from other machines on the network, open the firewall port:

New-NetFirewallRule -DisplayName "Redis 6379" `
  -Direction Inbound `
  -Protocol TCP `
  -LocalPort 6379 `
  -Action Allow `
  -Profile Domain,Private

Important: Redis should never be exposed to the public internet. Always restrict access to trusted internal subnets using the bind directive in redis.conf and firewall rules scoped to specific source IP ranges. Enabling requirepass provides an additional authentication layer but is not a substitute for network-level access control.

Test remote connectivity:

Test-NetConnection -ComputerName 192.168.1.60 -Port 6379

Redis as a Windows Service with Memurai

Memurai automatically installs as a Windows service. You can view and control it via the Services MMC snap-in (services.msc) or PowerShell. To change the configuration file path used by the service, edit the service registry key or reinstall with the appropriate configuration path. You can also control it from an elevated Command Prompt using the sc utility:

sc query Memurai
sc stop Memurai
sc start Memurai

Redis Desktop Manager and Other GUI Tools

Several GUI tools are available for Redis administration on Windows:

RedisInsight (formerly Redis Desktop Manager) is the official GUI from Redis Labs. Download it from https://redis.com/redis-enterprise/redis-insight/. It supports browsing keys, running CLI commands, viewing memory usage, analyzing slow log entries, and monitoring real-time metrics. Connect by entering your host (127.0.0.1 or remote IP), port 6379, and password if set.

Another option is TablePlus, which supports Redis alongside relational databases. For command-line power users, the redis-cli built-in monitor mode is invaluable for debugging:

redis-cli -h 127.0.0.1 -p 6379 -a YourPassword MONITOR

This streams every command processed by the Redis server in real time, useful for debugging application behavior.

Redis Sentinel Overview

Redis Sentinel provides high availability for Redis without Redis Cluster. Sentinel monitors master and replica instances, automatically promotes a replica to master if the master fails, and notifies clients of the new master address. A typical Sentinel setup requires three Sentinel processes (for quorum) and at least one Redis replica.

On each Sentinel node, the sentinel.conf file configures monitoring:

sentinel monitor mymaster 192.168.1.60 6379 2
sentinel auth-pass mymaster YourRedisPassword123!
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 60000
sentinel parallel-syncs mymaster 1

Start a Sentinel process:

redis-server C:Redissentinel.conf --sentinel

Applications connect to Sentinel instead of directly to the Redis master. The Sentinel service returns the current master address, and clients automatically reconnect after failover. This setup provides automatic failover with no manual intervention required.

Summary

Redis on Windows Server 2022 is best deployed through Memurai for a native Windows service experience, WSL2 for the official Redis build, or Docker for containerized deployments. Regardless of the installation method, the configuration directives in redis.conf control all critical behaviors: network binding, authentication via requirepass, memory limits and eviction policies, and persistence through RDB snapshots or AOF logging. RedisInsight provides a modern GUI for administration, while redis-cli remains the primary tool for testing and debugging. Securing Redis behind the Windows Firewall and binding it to internal network interfaces only are essential steps before putting any Redis instance into production.