Copied!
Redis

How to Setup Custom Redis Server on Windows (with Password & Port)

setup-custom-redis-server-on-windows
Shahroz Javed
Nov 04, 2025 . 27 views

Table Of Contents

 

Setup Custom Redis Server on Windows with Password and Custom Port

Redis can easily be customized to run on a different port, with a password, or even as a background Windows Service. In this guide, you’ll learn how to configure a custom Redis instance on Windows with your own settings.

💡 Tip: Running a separate Redis instance with a password and custom port is great for local testing, staging, or secure multi-instance setups.

Introduction

By default, Redis on Windows runs without authentication on port 6379. For better security and flexibility, you can create your own configuration — such as:

💡 Related: Check out our guide on Connecting Node.js with Redis Securely using Password.

1. Locate Your Redis Configuration File

Depending on your operating system, your Redis configuration file (redis.conf) is located in different paths:

Windows:
  C:\Program Files\Redis\redis.windows.conf
  C:\Program Files\Redis\redis.windows-service.conf  ← default Windows Redis service

Linux:
  /etc/redis/redis.conf

macOS (Homebrew):
  /usr/local/etc/redis.conf
    

2. Edit redis.conf to Use Custom Settings

Open the config file in any text editor and modify the following lines:

port 6380
requirepass mySecret123
    
⚠️ Note: Make sure you use a strong password and a port number not already in use.

3. Run Custom Redis in Background (Non-Service Mode)

You can start your Redis server manually using your custom config file.

# Run Redis with custom config in background
start /min redis-server "C:\Program Files\Redis\redis.windows.conf"

# Stop Redis manually
taskkill /IM redis-server.exe /F
    

The start /min command opens Redis in the background, and taskkill stops it.

4. Register Custom Redis as a Windows Service

To automatically start Redis on boot or manage it as a service, register it with a custom name:

# Install custom Redis as a Windows service
redis-server "C:\Program Files\Redis\redis.windows.conf"
redis-server --service-install "C:\Program Files\Redis\redis.windows.conf" --service-name RedisCustom

# Start and stop the service
net start RedisCustom
net stop RedisCustom

# Uninstall the custom service
redis-server --service-uninstall --service-name RedisCustom
    
🧰 You can create multiple Redis services with different configurations (ports, passwords, etc.) by using unique service names.

5. Verify Your Redis Instance

You can check if your Redis server is running and which port it’s using with:

netstat -ano | findstr :6380
    

Then connect to it using the Redis CLI:

redis-cli -p 6380
AUTH mySecret123
    

Once authenticated, you can run Redis commands securely on your new instance.

Custom Redis Setup Example on Windows
Custom Redis server running on port 6380 with authentication

6. Connect Node.js to Your Custom Redis

Finally, use the same credentials in your Node.js app:

import { createClient } from "redis";

const client = createClient({
  url: "redis://:mySecret123@127.0.0.1:6380",
});

await client.connect();
console.log("✅ Connected to custom Redis!");
    

Conclusion

Setting up a custom Redis server allows you to separate environments (development, staging, production) and secure your data with authentication. You can also run multiple instances for testing different projects simultaneously. This flexibility makes Redis a great choice for developers and system architects alike.

✅ Pro Tip: Always protect your Redis instances with a strong password and avoid exposing Redis directly to the internet.

15 Shares

Similar Posts