Configuring Redis as a Windows Service and Managing Instances

Acquiring the Windows Binaries

Redis does not officially distribute native Windows executables, but community-maintained archives and third-party ports are widely available. For Windows environments, obtain the pre-compiled ZIP archive or the MSI installer from the release repository. The ZIP package requires manual configuration, while the MSI automates service registration. This guide focuses on the ZIP distribution for granular control.

Manual Execution and Verification

Extract the archive to a dedicated directory, such as C:\Redis\. Open a terminal, navigate to the extraction path, and launch the server process:

.\redis-server.exe .\redis.windows.conf

A successful initialization displays the Redis ASCII art and port binding information. To verify connectivity, open a second terminal instance in the same directory and invoke the command-line interface:

.\redis-cli.exe
127.0.0.1:6379> ping
PONG

Terminating the terminal window halts the server process, which is unsuitable for persistent development or production environments.

Registering as a Windows Service

To run Redis persistently in the background, register the executable as a Windows service. Ensure no manual instances are running before proceeding. Execute the following command with administrative privileges:

.\redis-server.exe --service-install .\redis.windows.conf --loglevel notice

The --loglevel flag controls verbosity (e.g., debug, verbose, notice, warning). Upon successful registration, the service appears in the Windows Services manager (services.msc) but remains in a stopped state by default.

Service Lifecycle Management

Control the registered service using the built-in service flags or standard Windows utilities:

# Start the background process
.\redis-server.exe --service-start

# Gracefully terminate the process
.\redis-server.exe --service-stop

# Remove the service registration entirely
.\redis-server.exe --service-uninstall

Deploying Multiple Isolated Instances

Running several Redis nodes on a single machine requires distinct service names and port configurations. Create separate configuration files (e.g., redis_6380.conf, redis_6381.conf) with unique port and logfile directives. Register each instance individually:

.\redis-server.exe --service-install .\redis_6380.conf --service-name RedisNodeA --port 6380
.\redis-server.exe --service-start --service-name RedisNodeA

.\redis-server.exe --service-install .\redis_6381.conf --service-name RedisNodeB --port 6381
.\redis-server.exe --service-start --service-name RedisNodeB

Each service operates independently and can be managed via its assigned --service-name.

Client Connectivity and Authentication

Once the service is active, connect using the CLI with explicit connection parameters. If authentication is enabled in the configuration file via the requirepass directive, include the credentials:

.\redis-cli.exe -h 127.0.0.1 -p 6379 -a "YourStrongPassword"
127.0.0.1:6379> set test_key "verification_value"
OK
127.0.0.1:6379> get test_key
"verification_value"

Enabling Remote Network Access

By default, Redis binds to the loopback interface and enables protected mode, blocking external connections. To allow access from other machines on the local network, modify the active configuration file:

  1. Locate the bind directive and replace 127.0.0.1 with the server's LAN address or 0.0.0.0 (use caution with 0.0.0.0).
  2. Change protected-mode yes to protected-mode no.
  3. Ensure requirepass is set to a strong password to prevent unauthorized access.
  4. Restart the Windows service to apply changes:
    .\redis-server.exe --service-stop
    .\redis-server.exe --service-start
    

Verify remote connectivity from a client machine:

redis-cli -h 192.168.10.50 -p 6379 -a "YourStrongPassword"

Network firewalls must permit inbound traffic on the configured TCP port.

Graphical Administration

For users preferring a visual interface over the command line, third-party GUI clients such as Redis Desktop Manager, Another Redis Desktop Manager, or Medis provide connection management, key browsing, and performance monitoring. Configure the connection profile with the host IP, port, and authentication credentials established during the service setup.

Tags: Redis Windows Service-Deployment Database-Administration CLI

Posted on Fri, 08 May 2026 00:12:38 +0000 by Crowly