Prerequisites
Before you begin, make sure you have the following:- A GitHub account
- An Upstash account
- A Trigger.dev account
- A Supabase account
- A Vercel account
- Either a Cloudflare or AWS account
Step 1: Local setup
First, you’ll need to clone the Agentset repo and install the dependencies.1
Clone the repo
First, clone the Agentset repo.
Terminal
2
Install dependencies
Run the following command to install the dependencies:
Terminal
3
Set up environment variables
Convert the You will fill in the remaining environment variables in the following steps.
.env.example
file to .env
. You can start filling in the first few environment variables:Terminal
We currently use azure openai models as the default (when users pick the Agentset managed option). If you’d like to change that, update
apps/web/src/lib/embeddings.ts
and apps/web/src/lib/llm.ts
to use a different provider.Step 2: Set up Upstash
Next, you’ll need to set up Upstash Redis.1
Create Upstash Redis database
In your Upstash account, create a new Redis database.

2
Set up Upstash environment variables
Once your database is created, copy the 
Navigate to the QStash tab and 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.
QSTASH_TOKEN
, QSTASH_CURRENT_SIGNING_KEY
, and QSTASH_NEXT_SIGNING_KEY
from the Request Builder section into your .env
file.
Step 3: Set up Trigger.dev
Next, you’ll need to set up Trigger.dev for workflow orchestration and background job processing.1
Create Trigger.dev account and project
In your Trigger.dev account, create a new project. Once created, you’ll need to copy the project ID and secret key.
2
Set up Trigger.dev environment variables
Add the
TRIGGER_SECRET_KEY
to your root .env
file:.env
3
Set up jobs environment
Create a Replace
.env
file in the packages/jobs
directory and add your Trigger.dev project ID:Terminal
your_project_id_here
with your actual Trigger.dev project ID.4
Start the Trigger.dev development server
Navigate to the jobs directory and start the Trigger.dev development server:This will connect your local development environment to Trigger.dev and allow you to run background jobs.
Terminal
5
Deploy the Trigger.dev jobs
Navigate to the jobs directory and deploy the Trigger.dev jobs:This will build and deploy the Trigger.dev jobs to your Trigger.dev project.
Terminal
Step 4: Set up the partitioner API
Next, you’ll need to set up the partitioner API. This will be used to partition documents into chunks for vectorization. More information can be found here.Make sure
REDIS_HOST
, REDIS_PORT
, and REDIS_PASSWORD
match the values in your
Upstash Redis database created in Step
2..env
file:
.env
Step 5: Set up Supabase PostgreSQL database
Next, you’ll need to set up any PostgreSQL database (e.g. Supabase). This will be used to store application data (e.g. user sessions, user data, etc.).1
Create Supabase database
In your Supabase account, create a new database.Make sure to copy the password you write to use for the next step.

2
Set up Supabase environment variables
Then, click on the Connect button on the top left, navigate to the ORMs tab, and select Prisma.After that, copy the 
DATABASE_URL
and DIRECT_URL
into your .env
file. And make sure to replace [YOUR-PASSWORD]
with the password you wrote down in the previous step.
3
Apply migrations
In the terminal, run the following command to generate the Prisma client:Then, run the following command to apply the database migrations:
Terminal
Terminal
Step 6: Set up GitHub OAuth
Next, create a new GitHub App. This will allow you to sign in to Agentset with your GitHub account. Don’t forget to set the following Callback URLs:https://app.acme.com/api/auth/callback/github
http://localhost:3000/api/auth/callback/github
for local development.
Optional: Set the “Email addresses” account permission to read-only in order to
access private email addresses on GitHub.
Client ID
and Client Secret
into your .env
file as the GITHUB_CLIENT_ID
and GITHUB_CLIENT_SECRET
environment variables.
Step 7: Set up Google OAuth
Next, you’ll need to set up Google OAuth. This will allow you to sign in to Agentset with your Google account.1
Create Google OAuth App
In your Google Cloud Console, create a new OAuth client ID and client secret.
2
Set up Google OAuth environment variables
Once your Google OAuth App is created, copy the
Client ID
and Client Secret
into your .env
file as the GOOGLE_CLIENT_ID
and GOOGLE_CLIENT_SECRET
environment variables.Step 8: Set up Cloudflare R2
Agentset stores file uploads in either S3 or S3-compatible services like Cloudflare R2. We recommend using Cloudflare R2 for self-hosting Agentset, as it’s a more cost-effective solution compared to AWS S3. Here’s how you can set it up:1
Create R2 bucket
You’ll need to subscribe to the R2 service if you haven’t already.
agentset
) and leaving the remaining settings as is.
2
Set up access to R2
From the R2 main page, click Manage R2 API Tokens on the right-hand column.
Then, click Create API Token.
Make sure to name your API token something relevant to the service that will be using the token.Give it “Object Read & Write” permissions, and we recommend only applying ito to a single bucket.You can leave the remaining settings (TTL, Client IP Address Filtering) as is, and click Create API Token.After you create you token, copy the


Access Key ID
and Secret Access Key
values – you’ll need them in the next step.3
Set up R2 environment variables
Once you have your credentials, set them in your
.env
file:.env
Step 9: Set up Resend (optional)
Note that if you want to use magic link sign-in, this is a required step.
- Sign up for Resend and create your API key here.
- Copy the API key into your
.env
file as theRESEND_API_KEY
environment variable. - You’ll then need to set up and verify your domain by following this guide here.
Step 10: Deploy to Vercel
Once you’ve set up all of the above services, you can now deploy your app to Vercel.1
Deploy code to GitHub
If you haven’t already, push up your cloned repository to GitHub by running the following commands:
Terminal
2
Create a new Vercel project
In your Vercel account, create a new project. Then, select your GitHub repository and click Import.Make sure that your Framework Preset is set to Next.js and the Root Directory is set to 
In the Environment Variables section, add all of the environment variables from your
apps/web
.
.env
file by copying all of them and pasting it into the first input field. A few notes:- Replace the
BETTER_AUTH_URL
environment variable with the app domain that you will be using (e.g.https://app.acme.com
).
If you get a 
No Output Directory called "public" was found after the build completed
error, make sure that your Vercel deployment
settings to make sure that they match the following:
3
Done!
Once the deployment is complete, you should be able to visit your app domain (e.g. 
https://app.acme.com
) and see the following login page:
Caveats
This guide is meant to be a starting point for self-hosting Agentset. It currently depends on the following services to work:- Upstash for the Redis database
- Trigger.dev for the workflow orchestration
- Supabase for the PostgreSQL database
- Vercel for hosting