Installing Redis Community
Installing Redis community for development with Qumulus is super easy
Getting up to speed with Redis community for your development is super easy with Qumulus.
Create a new instance, select Ubuntu 24.04, Instance type as m1.micro (or the size which suits you) and add script to the user data section, click launch!

Here is the 'user data' script you can use
#!/bin/bash
# Update package list and install Redis and UFW
apt-get update
apt-get install -y redis-server ufw
# Define your desired Redis password.
# Replace 'PleaseChangeYourPassword' with your actual secure password once the installation is completed.
REDIS_PASSWORD="PleaseChangeYourPassword"
# Path to the Redis configuration file
REDIS_CONF="/etc/redis/redis.conf"
# Update Redis configuration:
# 1. Set the Redis password.
sed -i "s/^# *requirepass.*/requirepass $REDIS_PASSWORD/" $REDIS_CONF
sed -i "s/^requirepass.*/requirepass $REDIS_PASSWORD/" $REDIS_CONF
# 2. Enable Append Only File (AOF) persistence.
sed -i "s/^appendonly no/appendonly yes/" $REDIS_CONF
# 3. Enable remote access by binding Redis to all interfaces.
sed -i "s/^bind .*/bind 0.0.0.0/" $REDIS_CONF
# Optionally, if you need to disable protected mode for remote connections,
# uncomment the following line. Note: This is not recommended unless you have other security measures in place.
# sed -i "s/^protected-mode yes/protected-mode no/" $REDIS_CONF
# Restart Redis to apply configuration changes and enable it to start on boot.
systemctl restart redis-server
systemctl enable redis-server
# Enable UFW if it's inactive.
if ufw status | grep -iq "inactive"; then
echo "y" | ufw enable
fi
# Allow incoming TCP connections on port 6379 (Redis).
ufw allow 6379/tcp
# Allow incoming TCP connections for SSH.
ufw allow 22/tcp
ufw reload
Once your instance is up and running, You can assign a public IP to it and SSH to it .Make sure you have inbound rules defined to allow SSH for the instance and open port for Redis in the Security Group assigned to your VM.


You can SSH to your VM and run redis-cli to check if Redis is installed and running on your VM.

First things first. Let's change the password of Redis.
sudo nano /etc/redis/redis.conf
Search for 'PleaseChangeYourPassword' and replace it with your new password

Once you have changed the password, Save and exit the editor and restart the Redis server.
sudo service redis-server restart
Now you are all set!
You can also check the performance of this Redis instance. Simply run the following command with your password
redis-benchmark -a "YourPasswordHere"
m1.micro on Qumulus is able to give a throughput of more than 45k operations per second.

Lastly, you may want to connect to redis from Redis Insight. Make sure that you have allowed port 6379 in security groups for inbound rule from the IP you are trying to connect from

Last updated