Skip to main content

Redis Setup

Prime SaaS uses Redis as the backing store for BullMQ — the background job queue that handles async tasks like email sending, account expiration checks, trial notifications, and media cleanup.

1. Install Redis​

macOS (Homebrew):

brew install redis
brew services start redis

Ubuntu/Debian:

sudo apt update
sudo apt install redis-server
sudo systemctl start redis-server
sudo systemctl enable redis-server

Docker:

docker run -d \
--name primesaas-redis \
-p 6379:6379 \
redis:7-alpine

2. Verify Redis is running​

redis-cli ping
# PONG

3. Configure environment variables​

In demo-server/.env:

REDIS_HOST=localhost
REDIS_PORT=6379
# REDIS_PASSWORD=yourpassword # Only needed if Redis auth is enabled

Background jobs powered by Redis​

BullMQ uses Redis to queue and process these jobs:

JobDescription
Account expirationMarks accounts as expired when trials end
Trial notificationsSends warning emails before trial expires
Billing refreshResets usage counters on billing cycle renewal
Media cleanupRemoves orphaned media files from S3
Plan validationChecks plan consistency across accounts
Slack notificationsSends alerts for payments, errors, violations