How to install Redis and use it as a cache
Updated 11/29/2026
Redis is an in-memory data store used as a cache, message broker or fast database. A few milliseconds of latency make the difference for busy apps.
1. Install
apt-get update -y
apt-get install -y redis-server
systemctl enable --now redis-server
2. Secure it
In /etc/redis/redis.conf, set a password and bind Redis to localhost only:
requirepass strong_password
bind 127.0.0.1
systemctl restart redis-server
3. Test
redis-cli
AUTH strong_password
SET test "works"
GET test
4. Use as a cache
Most frameworks (Laravel, Django, Node) have native support for Redis as a cache and for sessions. You just configure the host (127.0.0.1), port (6379) and password in your app.
Or install it with one click
Pick Redis from the app catalog for a ready-configured install.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
How to install and secure PostgreSQL on Ubuntu
Install the most advanced open-source database and configure it safely: password, scram-sha-256 authentication and controlled access.
Updated 11/29/2026DatabasesHow to install and secure MySQL on Ubuntu
Install MySQL or MariaDB on your VPS and secure it properly: root password, removing test accounts and controlled access.
Updated 11/29/2026DatabasesHow to create a MySQL user and grant privileges
Create dedicated MySQL users per application and grant exactly the privileges needed, step by step.
Updated 11/29/2026