Redis
This guide shows how to create a Redis server and connect to it. Redis is an in-memory key-value store. Use it as a cache, a queue, or a session store for your applications.
Before you begin
- You need the Owner, Admin, or Developer role.
- The smallest plan for Redis has 0.5 vCPU, 512 MiB of memory, and 5 GiB of disk.
1. Create the server
- Go to Servers. Click New server.
- Under Image, select Apps. Under App, select Redis.
- Under Redis settings, type a Password, or leave it blank to generate one.
- Select a region and a plan. Click Create server.
2. Read the password
Sign in with SSH and read the settings file:
bash
sudo cat /etc/one-click/app.env| Setting | Value |
|---|---|
REDIS_PASSWORD | The password that clients send with AUTH. |
If the login message shows Setup is still running., wait one minute and sign in again.
3. Connect
Redis listens on port 6379 on every address. From another server in the same region, use the private IPv6 address of the Redis server:
bash
redis-cli -h <private IPv6 address> -a '<password>' pingThe command returns PONG. In an application, use a URL such as redis://:<password>@[<private IPv6 address>]:6379/0.
To connect from outside the region, see Connect to the service. If the firewall is on, allow TCP port 6379.
Change the password
- Edit
/etc/redis/one-click.conf. Change therequirepassline. - Run
sudo systemctl restart redis-server. - Change
REDIS_PASSWORDin/etc/one-click/app.env, so the file stays correct.
What next
Apps: first boot, passwords, and network access for every app.