Skip to content

Redis on a VPS

In-memory cache and queues

Category
Databases
Hosting
Databases
Author
Redis Ltd.
License
AGPL-3.0
Version
8.10.2

The script is free · VPS from $2.79 per month · installs in about 45 seconds

Install over SSH

root@vps:~# command -v docker >/dev/null || curl -fsSL https://get.docker.com | sh; docker run -d --name redis --restart unless-stopped -p 127.0.0.1:6379:6379 -v redis-data:/data redis:8 redis-server --save 60 1

  • SystemUbuntu 24.04 · x86_64ok
  • Sourcegithub.com/redis/redisok
  • Version8.10.2ok
  • Port6379/tcplisten

✓ Redis 8.10.2 installed · about 45 seconds

root@vps:~#

Install command from the library. Output is shortened and may differ on your server.

What it is

  • Cache
  • Queues
  • In-memory
  • Telegram bots

Redis is an in-memory data store. It is used as a cache, task queue, store for sessions and Telegram bot states, counters and rate limiting.

Sub-millisecond responses take load off your main database: frequent queries are served from Redis instead of PostgreSQL or MySQL.

The command runs the official Redis 8 image with persistence to disk. The port is reachable only from the server itself. Redis 8 is distributed under a choice of three licenses, one of which is AGPL-3.0.

  • Strings, hashes, lists, sets and streams
  • Pub/Sub and task queues
  • Key TTLs: cache and sessions
  • Persistence to disk (RDB and AOF)
  • Search and JSON built into Redis 8

Recommended plan

For Redis: at least 1 vCPU, 2 GB RAM and 10 GB NVMe.

Minimum to run
1 vCPU · 1 GB RAM · 10 GB disk
Systems
Ubuntu 22.04 · Ubuntu 24.04 · Debian 12

How to install

Three steps in the bot or one command over SSH; installation takes about 45 seconds.

  1. 01

    Choose a plan in the bot

    Open @ExpressHost_bot and pay for a VPS. The server will be ready in about 60 seconds.

  2. 02

    Add Redis

    At the “Add-ons” step pick the script from the library, or run it later: Server settings → Scripts.

  3. 03

    Check that it works

    docker exec -it redis redis-cli ping (response: PONG)

Manually over SSH

Connect to the server as root and run the command. Supported systems: Ubuntu 22.04, Ubuntu 24.04, Debian 12.

Install command
command -v docker >/dev/null || curl -fsSL https://get.docker.com | sh; docker run -d --name redis --restart unless-stopped -p 127.0.0.1:6379:6379 -v redis-data:/data redis:8 redis-server --save 60 1

Ports

Redis ports
PortProtocolPurpose
6379tcpClient connections (127.0.0.1 only)

After installation

  1. 1.Check that it works: docker exec -it redis redis-cli ping (response: PONG)
  2. 2.Connect from your app at redis://127.0.0.1:6379
  3. 3.If other servers need Redis, set a password with --requirepass and open the port only to their IPs

Redis FAQ

Didn’t find an answer? Message @ExpressHost_SupportBot.

How much memory is needed?

Redis keeps all data in RAM. A few hundred megabytes is enough for a small project's cache; the limit is set with the --maxmemory parameter.

Will data be lost on reboot?

With --save 60 1, Redis saves a snapshot to disk every minute if there were changes. For more durability, enable --appendonly yes.

Where is the data stored?

In the redis-data Docker volume (the /data folder inside the container).

Redis installs at checkout — in the bot.