Docs / Databases / How to Install Redis on Ubuntu

How to Install Redis on Ubuntu

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 194 views · 1 min read

Redis is an in-memory data store used for caching, sessions, and message queues.

Install

apt update
apt install redis-server -y

Configure

Edit /etc/redis/redis.conf:

# Bind to localhost only
bind 127.0.0.1 ::1

# Set a password
requirepass YourSecurePassword

# Set max memory
maxmemory 256mb
maxmemory-policy allkeys-lru

Start

systemctl restart redis
systemctl enable redis

Test

redis-cli
AUTH YourSecurePassword
PING
SET hello world
GET hello

Was this article helpful?