> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentset.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Step 2: Upstash

> Configure Upstash Redis and QStash for queue management

Next, you'll need to set up [Upstash](https://upstash.com) Redis for caching and queue management.

<Steps>
  <Step title="Create Upstash Redis database">
    In your [Upstash account](https://console.upstash.com/), create a new Redis database.

    <Frame>
      <img src="https://mintcdn.com/agentset/vcYsAoevgOLWGz34/images/self-hosting/upstash-create-redis.png?fit=max&auto=format&n=vcYsAoevgOLWGz34&q=85&s=ba48d44c366841f9620a673eda339486" alt="Upstash Redis database" width="2244" height="1306" data-path="images/self-hosting/upstash-create-redis.png" />
    </Frame>
  </Step>

  <Step title="Set up Upstash environment variables">
    Once your database is created, copy the `UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` from the **REST API** section into your `.env` file as `REDIS_URL` and `REDIS_TOKEN` respectively.

    <Frame>
      <img src="https://mintcdn.com/agentset/vcYsAoevgOLWGz34/images/self-hosting/upstash-redis-tokens.png?fit=max&auto=format&n=vcYsAoevgOLWGz34&q=85&s=e02864ffe8e7f2f93e781b80bc924e14" alt="Upstash Redis tokens" width="1264" height="340" data-path="images/self-hosting/upstash-redis-tokens.png" />
    </Frame>

    Navigate to the [QStash tab](https://console.upstash.com/qstash) and copy the `QSTASH_TOKEN`, `QSTASH_CURRENT_SIGNING_KEY`, and `QSTASH_NEXT_SIGNING_KEY` from the **Request Builder** section into your `.env` file.

    <Frame>
      <img src="https://mintcdn.com/agentset/vcYsAoevgOLWGz34/images/self-hosting/upstash-qstash-tokens.png?fit=max&auto=format&n=vcYsAoevgOLWGz34&q=85&s=992f733b3a35f15c4dbbe5333c7262ca" alt="Upstash QStash tokens" width="1270" height="418" data-path="images/self-hosting/upstash-qstash-tokens.png" />
    </Frame>
  </Step>
</Steps>

## Next Steps

Once you've completed the Upstash setup, proceed to [Step 3: Trigger.dev](/open-source/step-3-trigger) to set up workflow orchestration.
