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:
- Changing the port (e.g.
6380)
- Adding a password using
requirepass
- Running Redis manually or as a background service
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.
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.