Skip to main content
Private Chat uses Upstash Redis for real-time messaging and data storage. This guide walks you through creating a database and obtaining your credentials.

Create an Upstash account

1

Sign up for Upstash

Go to upstash.com and click “Get Started” or “Sign Up”.You can sign up with:
  • GitHub
  • Google
  • Email
2

Verify your account

If you signed up with email, verify your account by clicking the link in the confirmation email.

Create a Redis database

1

Navigate to Redis

From your Upstash console, click on “Redis” in the top navigation or sidebar.
2

Create database

Click the “Create Database” button.
3

Configure your database

Fill in the database details:
  • Name: Choose a descriptive name (e.g., private-chat-prod)
  • Type: Select “Regional” for better latency
  • Region: Choose a region close to where your application will be deployed
  • TLS: Keep enabled for secure connections
If you’re deploying on Vercel, choose a region that matches your Vercel deployment region for optimal performance.
4

Create the database

Click “Create” and wait a few seconds for your database to be provisioned.

Get your credentials

Once your database is created, you need to copy your credentials.
1

Open database details

Click on your newly created database to open its details page.
2

Find REST API section

Scroll down to the “REST API” section. You’ll see two important values:
  • UPSTASH_REDIS_REST_URL
  • UPSTASH_REDIS_REST_TOKEN
3

Copy credentials

Click the copy button next to each value to copy them to your clipboard.
Keep your token secret! Never share it publicly or commit it to version control.

Add credentials to your project

Now that you have your credentials, you need to add them to your project.

For local development

Create a .env.local file in your project root:
.env.local
UPSTASH_REDIS_REST_URL=https://your-database.upstash.io
UPSTASH_REDIS_REST_TOKEN=your_token_here

For Vercel deployment

Add the environment variables in your Vercel project settings:
  1. Go to your project in Vercel
  2. Navigate to Settings → Environment Variables
  3. Add both UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN
  4. Select which environments they should be available in (Production, Preview, Development)
See the Vercel deployment guide for detailed instructions.

Free tier limits

Upstash offers a generous free tier that includes:
  • 10,000 commands per day
  • 256 MB storage
  • All regions available
  • TLS encryption
This is sufficient for development and small production deployments.
You can monitor your usage in the Upstash console. If you exceed the free tier limits, consider upgrading to a paid plan.

Next steps

Now that you have your Upstash Redis database set up:

Build docs developers (and LLMs) love