Port 6379
Redis In-Memory Data Store
Port 6379: Redis
| Protocol | TCP |
| Service | Redis |
| Encrypted | Optional (TLS) |
| IANA Status | Official |
What is Port 6379?
Port 6379 is the default port for Redis, an open-source in-memory data structure store. Redis is commonly used for caching, session storage, message queuing, and real-time analytics.
Connection Examples
# redis-cli
redis-cli -h localhost -p 6379
redis-cli -h localhost -p 6379 -a password
# Connection URL
redis://localhost:6379
redis://:password@localhost:6379/0
rediss://localhost:6379 # TLS
# Node.js (ioredis)
const Redis = require('ioredis');
const redis = new Redis({
host: 'localhost',
port: 6379,
password: 'secret'
});
# Python
import redis
r = redis.Redis(host='localhost', port=6379, password='secret')
Security Configuration
Redis has no authentication by default
Always set a password and bind to localhost or use firewall rules.
# /etc/redis/redis.conf
# Bind to localhost only (safe default)
bind 127.0.0.1 ::1
# Set a strong password
requirepass your_strong_password_here
# Disable dangerous commands
rename-command FLUSHDB ""
rename-command FLUSHALL ""
rename-command DEBUG ""
rename-command CONFIG ""
# Restart Redis
sudo systemctl restart redis
Common Use Cases
- Caching: Store frequently accessed data in memory
- Session storage: Store user sessions for web apps
- Rate limiting: Track request counts with TTL
- Message queue: Pub/Sub for real-time messaging
- Leaderboards: Sorted sets for rankings
Basic Commands
# Test connection
redis-cli ping
# Response: PONG
# Set and get values
SET mykey "Hello"
GET mykey
# Set with expiration (seconds)
SETEX session:123 3600 "user_data"
# Check TTL
TTL session:123
# List all keys (use carefully in production)
KEYS *
# Get server info
INFO
Troubleshooting
# Check if Redis is running
sudo systemctl status redis
sudo ss -tlnp | grep 6379
# Test connection
redis-cli ping
redis-cli -a password ping
# Check what Redis is bound to
redis-cli CONFIG GET bind
# Monitor commands in real-time
redis-cli monitor
# Check memory usage
redis-cli INFO memory
Common Issues
- NOAUTH: Authentication required - provide password
- Connection refused: Redis not running or wrong bind address
- OOM: Out of memory - increase maxmemory or eviction policy
- Slow operations: Check for blocking commands with SLOWLOG
How to Check if Port 6379 is Open
Verify Redis connectivity with these commands.
# Quick health check
redis-cli ping # PONG = healthy
redis-cli -a password ping # With auth
# Check if Redis is listening
sudo ss -tlnp | grep 6379
sudo lsof -i :6379
# From a remote machine
nc -zv redis-server.example.com 6379
nmap -p 6379 redis-server.example.com
# Check bind address and config
redis-cli CONFIG GET bind
redis-cli CONFIG GET requirepass
redis-cli INFO server | grep tcp_port
Redis Memory Management
Redis stores data in memory, so proper memory configuration is critical to avoid OOM (Out of Memory) errors.
# /etc/redis/redis.conf
# Set maximum memory limit
maxmemory 256mb
# Eviction policy when maxmemory is reached
maxmemory-policy allkeys-lru # Evict least recently used keys
# Other options: volatile-lru, allkeys-random, noeviction
# Check memory usage
redis-cli INFO memory
redis-cli MEMORY USAGE mykey
# Find biggest keys
redis-cli --bigkeys
Monitoring Redis with UptimeSignal
Redis downtime on port 6379 can cause session loss, cache misses that overload your database, and broken real-time features. UptimeSignal monitors your application endpoints to detect when Redis issues start impacting users. Combine with checks on PostgreSQL (port 5432) and MySQL (port 3306) for complete data layer visibility.
Frequently Asked Questions
What runs on port 6379?
Is Redis secure by default on port 6379?
requirepass in redis.conf, bind to 127.0.0.1, disable dangerous commands (FLUSHALL, CONFIG, DEBUG), and use firewall rules. Exposed Redis instances have been exploited for cryptomining and data theft. Never put Redis on the public internet without auth and TLS.
What causes the Redis "NOAUTH" error?
NOAUTH Authentication required error means Redis has a password set via requirepass but the client didn't authenticate. Fix it: redis-cli -a yourpassword, or use the URL redis://:yourpassword@localhost:6379. In application code, include the password in Redis client config.
How do I check if Redis is running on port 6379?
redis-cli ping which returns PONG if healthy. To verify the port: sudo ss -tlnp | grep 6379. From a remote machine: nc -zv hostname 6379. For a full health overview: redis-cli INFO shows memory, connections, persistence status, and more.
What does Redis OOM (Out of Memory) mean?
maxmemory is reached, Redis applies the configured eviction policy. With noeviction policy (default), writes fail with OOM errors. Fix by: setting maxmemory-policy allkeys-lru to evict least-recently-used keys, increasing maxmemory, or auditing key sizes with redis-cli --bigkeys.