Dragonfly

Redis Default Port, How to Change It, and 4 Alternative Port Options

By default, Redis listens on TCP port 6379. This default can be changed through the port directive in the Redis configuration file (redis.conf).

July 1, 2025

cover

What Are the Default Ports Used by Redis?

By default, Redis listens on TCP port 6379, which allows clients to communicate with the Redis server using the Redis protocol. This default can be changed through the port directive in the Redis configuration file (redis.conf) or via command-line options when starting the server.

Redis can also be configured to support TLS/SSL connections, which by convention use port 6380. This is not hardcoded but commonly adopted to differentiate between standard and encrypted traffic. When TLS is enabled, the tls-port directive specifies the port to use.

In addition to TCP, Redis supports Unix domain sockets for local interprocess communication, which bypasses the need for a network port entirely. Single-host environments often use this method for performance or security reasons, configuring it using the unixsocket directive.

Redis Port History

Redis was first released in 2009, and from its early versions, it has consistently used port 6379 as the default TCP port. The choice of 6379 was arbitrary but deliberate—it was selected because it’s not commonly used by other applications, reducing the risk of port conflicts.

Over time, as security demands increased, Redis introduced support for SSL/TLS. This feature became officially available in Redis 6.0, released in May 2020. To accommodate encrypted traffic, many setups began using port 6380 as a convention for TLS, although Redis itself allows administrators to specify any port.

The ability to bind to multiple interfaces and support both secure and insecure traffic simultaneously was also introduced in later versions, giving administrators greater flexibility in configuring port usage. Additionally, Redis Cluster and Sentinel components use their own communication ports (e.g., base port + 10000 for cluster bus), but these are separate from the client-facing port.

How to Change the Default Port in Redis Configuration

By default, Redis uses port 6379 for client connections. If you want to change this port number to a different value, you can modify the port configuration option in the Redis configuration file (redis.conf). Here’s a concise guide on how to change the default port.

  • On Linux systems, you can use the following command to open the Redis configuration file (redis.conf) in the nano text editor:
sudo nano /etc/redis/redis.conf	
# Accept connections on the specified port, default is 6379 (IANA #815344).
# If port 0 is specified Redis will not listen on a TCP socket.
port 6379

# TCP listen() backlog.
#
# In high requests-per-second environments you need a high backlog in order
# to avoid slow clients connection issues. Note that the Linux kernel
# will silently truncate it to the value of /proc/sys/net/core/somaxconn so
# make sure to raise both the value of somaxconn and tcp_max_syn_backlog
# in order to get the desired effect.
tcp-backlog 511

# Unix socket.
#
# Specify the path for the Unix socket that will be used to listen for
# incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified.
#
# unixsocket /run/redis.sock
# unixsocketperm 700
  • Find the line that specifies the port: port 6379.
  • Change 6379 to your desired port number, for example: port 6380.
  • Save the changes and close the editor. In nano, you can do this by pressing Ctrl+O to write the changes and Ctrl+X to exit.
  • Apply the changes by restarting the Redis server:
sudo systemctl restart redis

# Example output just to confirm that the port is configured properly.
#=> Configuration loaded
#=> Running mode=standalone, port=6380.
#=> Server initialized
#=> Ready to accept connections tcp

After restarting, clients will need to reconnect using the new port number, which is 6380.

4 Common Alternative Redis Ports and Their Use Cases

While Redis defaults to port 6379 for unencrypted communication, several other ports are commonly used in practice to support specific configurations or deployment models:

1. Port 6380: TLS/SSL-Encrypted Redis Traffic

Although Redis doesn’t default to port 6380 for TLS, this port is widely adopted by convention to distinguish encrypted connections from plaintext ones. When enabling TLS in Redis (typically via the tls-port directive), administrators often set the port to 6380 to align with this common pattern. This allows both encrypted and unencrypted traffic to coexist on separate ports.

2. Custom Ports in Multi-Instance Setups

In environments running multiple Redis instances on a single host—common in development, testing, or containerized deployments—custom ports like 6381, 6382, etc., are often assigned to differentiate between instances. This practice requires careful coordination of configuration files and startup scripts to ensure no port conflicts occur.

Using non-default ports can improve security through obscurity, support multiple Redis services, and isolate different traffic types. However, such setups must be accompanied by appropriate firewall rules and documentation to avoid misconfiguration.

3. Cluster Bus: Port 16379 (6379 + 10000)

In Redis Cluster mode, nodes use a second port—calculated as the base port plus 10000—for internal node-to-node communication. If a Redis node is listening on port 6379, by default the cluster bus will communicate over port 16379 (this is also configurable). This port must be open between all cluster nodes. The main functions of the cluster bus are propagating cluster state and configuration updates between primary nodes, detecting primary node failures, and orchestrating failovers.

4. Sentinel: Port 26379

Redis Sentinel, a high-availability solution for Redis, uses port 26379 by default. This port is used for inter-sentinel communication and for client interactions related to master discovery and monitoring. Each Sentinel instance listens on this port unless configured otherwise.

The Sentinel port is partially client-facing. While clients primarily interact with primary/replica instances, they still need to connect to Sentinel for service discovery. Since Sentinels maintain awareness of the current primary, many client libraries are designed to first connect to a Sentinel instance, after which the library handles the remaining connection logic automatically.


Dragonfly: The Next-Generation In-Memory Data Store

Dragonfly is a modern, source-available, multi-threaded, Redis-compatible in-memory data store that stands out by delivering unmatched performance and efficiency. Designed from the ground up to disrupt existing legacy technologies, Dragonfly redefines what an in-memory data store can achieve. With Dragonfly, you get the familiar API of Redis without the performance bottlenecks, making it an essential tool for modern cloud architectures aiming for peak performance and cost savings. Migrating from Redis to Dragonfly requires zero or minimal code changes.

Key Advancements of Dragonfly

  • Multi-Threaded Architecture: Efficiently leverages modern multi-core processors to maximize throughput and minimize latency.
  • Unmatched Performance: Achieves 25x better performance than Redis, ensuring your applications run with extremely high throughput and consistent latency.
  • Cost Efficiency: Reduces hardware and operational costs without sacrificing performance, making it an ideal choice for budget-conscious enterprises.
  • Redis API Compatibility: Offers seamless integration with existing Redis applications and frameworks while overcoming its limitations.
  • Innovative Design: Built to scale vertically and horizontally, providing a robust solution for rapidly growing data needs.

Dragonfly Cloud is a fully managed service from the creators of Dragonfly, handling all operations and delivering effortless scaling so you can focus on what matters without worrying about in-memory data infrastructure anymore.

Was this content helpful?

Help us improve by giving us your feedback.

Dragonfly Wings

Stay up to date on all things Dragonfly

Join our community for unparalleled support and insights

Join

Switch & save up to 80%

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement. Instantly experience up to a 25X boost in performance and 80% reduction in cost