MeshWorld India LogoMeshWorld.

How to Install Redis Server & Redis CLI on Ubuntu & Linux (2026)

(Updated: Jul 24, 2026)
Listen to ArticleAI Speech
~5 min read narration
100%
How to Install Redis Server & Redis CLI on Ubuntu & Linux (2026)

Redis (Remote Dictionary Server) is an open-source, in-memory data structure store utilized as a high-performance database, caching broker, session store, and message queue. Supporting key-value strings, hashes, lists, sets, sorted sets, bitmaps, hyperloglogs, and geospatial indexes, Redis operates with sub-millisecond latency.

Setting up a production-ready Redis instance on Ubuntu 24.04 LTS (Noble Numbat) or 22.04 LTS (Jammy Jellyfish) requires configuring the official Redis APT repository (packages.redis.io), securing memory allocation policies in redis.conf, enabling authentication passwords, and managing the systemd service.

Last updated: July 24, 2026


What are the system requirements for Redis on Linux?

Before installing Redis Server on Ubuntu, Debian, or Linux Mint, verify system prerequisites:

  • Operating System: Ubuntu 24.04 LTS, 22.04 LTS, Debian 12, or Linux Mint 22
  • Privileges: User account with sudo administrative rights
  • Memory: Minimum 512 MB RAM (RAM requirements scale directly with dataset volume size)
  • Utilities: curl, gpg, lsb-release, and terminal access

How do you install Redis Server from official APT repository?

Installing Redis from official upstream repositories guarantees you receive up-to-date security patches and performance optimizations.

Step 1: Install GPG Key and Add Redis Repository

Open your terminal (Ctrl+Alt+T) and import the official Redis signing keyring:

BASH
sudo apt update
sudo apt install -y curl ca-certificates gpg lsb-release

# Import official Redis GPG key
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg

# Add Redis official repository to APT sources
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list

Step 2: Update Package Index and Install Redis

Update package lists and install redis (which includes both redis-server and redis-cli):

BASH
sudo apt update
sudo apt install -y redis

Step 3: Verify Redis Service Status

Confirm that the Redis server service is active and running:

BASH
sudo systemctl status redis-server

Ensure Redis automatically starts during system boot:

BASH
sudo systemctl enable redis-server

How do you configure Redis for security and performance?

Default installation configurations require adjustments for systemd integration, memory limits, and authentication.

Step 1: Edit redis.conf Configuration File

Open the primary Redis configuration file in a text editor:

BASH
sudo nano /etc/redis/redis.conf

Step 2: Configure Systemd Supervision

Locate the supervised directive and change it from no to systemd to allow Ubuntu’s service manager to control Redis lifecycle events:

TEXT
# Enable systemd integration
supervised systemd

Step 3: Set Memory Limit and Eviction Policy

Prevent Redis from exhausting host system RAM by setting a maximum memory threshold (maxmemory) and an eviction policy (maxmemory-policy):

TEXT
# Set memory cap (e.g., 2 Gigabytes)
maxmemory 2gb

# Evict least recently used keys when memory limit is reached
maxmemory-policy allkeys-lru

Step 4: Enable Password Authentication

Uncomment and configure a strong authentication password under the SECURITY section:

TEXT
# Require password for client connections
requirepass YourSuperStrongRedisPassword

Save and close the file (Ctrl+O, Enter, Ctrl+X).

Step 5: Restart Service to Apply Changes

Restart the Redis service to load your configuration:

BASH
sudo systemctl restart redis-server

How do you test Redis connections using Redis CLI?

Use the bundled redis-cli utility to verify database connectivity, test authentication, and execute key-value operations.

Step 1: Connect with Password Authentication

Open redis-cli and authenticate:

BASH
redis-cli -a YourSuperStrongRedisPassword

Step 2: Test Server Ping

Send a ping command to test response latency:

SQL
127.0.0.1:6379> ping
PONG

Step 3: Execute Basic Key-Value Operations

Set and retrieve data keys inside the console:

SQL
-- Store a key-value pair
127.0.0.1:6379> SET app:user "Vishnu"
OK

-- Retrieve key value
127.0.0.1:6379> GET app:user
"Vishnu"

-- Set expiration time (60 seconds)
127.0.0.1:6379> EXPIRE app:user 60
(integer) 1

Exit the CLI:

SQL
127.0.0.1:6379> exit


Frequently Asked Questions (PAA)

Is Redis free for commercial use?

Yes. Redis community edition remains open source and available for commercial deployment. Upstream packages downloaded via packages.redis.io are fully functional without licensing fees.

How do I check which version of Redis is running?

Run redis-server --version or redis-cli --version in terminal. Inside redis-cli, execute INFO server to view detailed build info.

What is the difference between redis-server and redis-cli?

redis-server is the background daemon process that manages in-memory data structures and client connections. redis-cli is the command-line client interface used by developers to interact with the database.

How do I run benchmark tests on Redis?

Redis includes a built-in benchmarking tool named redis-benchmark. To simulate 50 parallel clients sending 10,000 requests to your local instance:

BASH
redis-benchmark -h 127.0.0.1 -p 6379 -a YourSuperStrongRedisPassword -c 50 -n 10000

Reader Quality Feedback

Did this technical guide help solve your problem?

Suggest Errata ($0)
Vishnu
Primary Author

Vishnu

Founder & Principal Architect at MeshWorld. Senior engineer and instructor specializing in AI agent systems, scalable web architecture, and modern development workflows.

Explore Author Archive
Vishnu
Editorial Reviewer

Vishnu

Founder & Principal Architect at MeshWorld. Senior engineer and instructor specializing in AI agent systems, scalable web architecture, and modern development workflows.

View Dossier
Compute Fuel & Open Testbed
100% Independent & Verified

Fuel High-Density, Zero-Fluff Engineering Deep-Dives

Every guide on MeshWorld is validated on physical Linux nodes and reproducible testbeds. If this article saved you hours of debugging or unblocked production, consider funding our next cluster run.

Weekly Dispatch

Join MeshWorld Dispatch

Get practical tutorials, system blueprints, and curated AI engineering notes straight to your inbox. No fluff, zero spam.

Zero spam. 1-click unsubscribe anytime.Prefer RSS?
Curated Continuations

Up Next in This Domain.

Browse Full Archive