REDIS_URL
SensitiveThe Redis connection URL following the redis:// or rediss:// (TLS) URI format. Includes authentication credentials, host, port, and database number. Used by Redis client libraries across all languages and commonly provided by Redis hosting services.
Last updated:
REDIS_URL is a single-string connection URI for Redis: redis://user:password@host:port/db for plaintext, or rediss:// (note the double 's') for TLS. The trailing /db is the numbered logical database (0–15 by default). Most clients — ioredis, redis-py, node-redis, go-redis — accept it directly, and hosted providers like Upstash, Redis Cloud, and Heroku Redis hand it to you ready to use. The scheme is the part people get wrong: 'redis://' on a TLS-only endpoint fails with a cryptic protocol or connection-reset error.
- Provider
- Databases
- Category
- redis
- Set by
- Set manually or provided by Redis hosting services (Redis Cloud, Upstash, etc.)
- Example
- rediss://default:password@redis.example.com:6380/0
How to set REDIS_URL
bash (TLS)
export REDIS_URL='rediss://default:password@redis.example.com:6380/0'Node.js (ioredis)
import Redis from 'ioredis';
const redis = new Redis(process.env.REDIS_URL);docker-compose
services:
app:
environment:
REDIS_URL: redis://cache:6379/0
cache:
image: redis:7References
Frequently Asked Questions
What is the difference between redis:// and rediss://?
rediss:// (two s's) opens a TLS-encrypted connection; redis:// is plaintext. Managed providers like Upstash and Redis Cloud require rediss://. Using the plaintext scheme against a TLS endpoint causes connection errors, and against a plaintext endpoint it sends your AUTH password unencrypted.
Stay up to date
Get notified about new guides, tools, and cheatsheets.