Port 6379 is the default port for Redis and compatible servers such as Valkey, used as a cache, queue and session store. It should not be reachable from the public internet.
- Port
- 6379
- Protocol
- TCP
- Service
- Redis
- Expose to internet?
- No
- Also used by
- Redis, Valkey, KeyDB, Dragonfly
Is port 6379 safe to open?
Redis was designed for trusted networks and has no password by default. An attacker who reaches an open instance can read all keys and abuse CONFIG SET to write files, such as an SSH key or cron job, leading to full server compromise. Exposed Redis is mass-scanned and a common cryptominer entry point.
How to secure Redis
- Bind to localhost or a private address:
bind 127.0.0.1 -::1in redis.conf. - Keep
protected-mode yes. - Set a strong password with
requirepass, or use ACL users (Redis 6+). - Rename or disable dangerous commands such as
CONFIG,FLUSHALLandDEBUGwithrename-command. - Run Redis as an unprivileged user, never root.
Check if port 6379 is open
Linux: what is listening on this port
sudo ss -tlpn | grep ':6379 'Windows (PowerShell): what is listening
Get-NetTCPConnection -LocalPort 6379 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}From another machine: is it reachable
nc -zv HOST 6379
# or
nmap -p 6379 HOST
# Windows
Test-NetConnection HOST -Port 6379Test the Redis service itself
redis-cli -h HOST -p 6379 pingRestrict port 6379 in the firewall
Replace 10.0.0.0/8 with the network or address that needs access. Docker publishes container ports through its own iptables rules, which bypass ufw; bind published ports to 127.0.0.1 (-p 127.0.0.1:6379:6379) instead of relying on the host firewall.
ufw: allow only your private network, deny everyone else
sudo ufw allow from 10.0.0.0/8 to any port 6379 proto tcp
sudo ufw deny 6379/tcpfirewalld: allow one source network only
sudo firewall-cmd --permanent --remove-port=6379/tcp
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="6379" protocol="tcp" accept'
sudo firewall-cmd --reloadiptables
sudo iptables -A INPUT -p tcp --dport 6379 -s 10.0.0.0/8 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 6379 -j DROPWindows Firewall (PowerShell, as Administrator)
New-NetFirewallRule -DisplayName "Block 6379 from internet" -Direction Inbound -Protocol TCP -LocalPort 6379 -RemoteAddress Internet -Action BlockMonitor port 6379
Run a TCP port monitor against your public IP on port 6379: here, a failed connection is the healthy result, so you know the firewall is still doing its job. On Linux, the Statance agent also reports every listening port on the server. TCP port monitoring.
Related ports
| Port 11211 | Memcached | Critical risk |
| Port 6443 | Kubernetes API server | High risk |
| Port 27017 | MongoDB | Critical risk |
FAQ
Is it safe to expose Redis port 6379?
No. Redis has no authentication unless you configure it, and open instances are routinely used to take over servers. Keep it on localhost or a private network and set a password.
What does protected-mode do in Redis?
With protected mode on and no password set, Redis only answers clients connecting over loopback. It is a safety net, not a substitute for binding to localhost and setting a password.
What is port 6379 used for?
Port 6379 is the default port for Redis and compatible servers such as Valkey, used as a cache, queue and session store. It is also used by Redis, Valkey, KeyDB, Dragonfly.
Is port 6379 TCP or UDP?
Redis uses TCP on port 6379.
How do I check if port 6379 is open?
On the server, run sudo ss -tulpn | grep ':6379 ' (Linux) or Get-NetTCPConnection -LocalPort 6379 (Windows) to see what is listening. From another machine, run nc -zv HOST 6379 or Test-NetConnection HOST -Port 6379.
Know the moment a port stops answering.
TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.