Self Hosting

This guide will demonstrate how to self host the Vault API on your own server or a cloud provider of your choice.


  • A server running Ubuntu 18.04 or later
  • A domain name that you own
  • A valid SSL certificate for your domain name
  • A sendgrid account with an API key
  • Some knowledge of reverse proxies and DNS
  • An OpenAI API key or Your own Self hosted model (more on that later)

Step 1 - Configure DNS

You will need to configure your DNS to point to your server. You can do this by creating an A record for each of the subdomains you want to use.


Step 2 - Install Docker on machine

Follow the guide here to install docker on your server:

Step 3 - Clone the repository


git clone
cd trieve

Step 4 - Configure the Environment Variables for the API

There are 3 files you need to modify We have an example .env file in the root of the repository. You can use this as a starting point for your own configuration.

cat .env.server .env.docker-compose > .env

The main ENV variables you will need to update are:


# For CHAT

Everything else can be left as default but there are some passwords that may want to be hardened if this is for production.

To see a full list of ENV variables and what they do please see the env file

Step 5 - Setup docker compose


docker compose up -d

This docker compose file will setup the following services:

  • postgres
  • Qdrant
  • server
  • chat
  • search

We DO NOT reccomend to run Qdrant or Postgres on the same machine as the API. You can use a managed database service such as AWS RDS or Neon (our prefernce) to host postgres. and we reccomend using a differnt machine for Qdrant (Mainly just to prevent the chance of data loss).

Step 6 - Configure Caddyfile

Install caddy using the instructions here:

We have an example Caddyfile in the root of the repository. You can use this as a starting point for your own configuration.

sudo cp Caddyfile /etc/caddy/Caddyfile


# Global options

# Define a site block for {
    reverse_proxy localhost:3000

# Define a site block for {
    reverse_proxy localhost:8090

# Define a site block for {
    reverse_proxy localhost:3001

Once you have this you can run the caddy daemon using systemctl

sudo systemctl enable caddy.service
sudo systemctl restart caddy.service

Step 7 - Profit 🦀🦀🦀

Congratulations you have now self hosted the Trieve API. You can now use the API by navigating to your domain name in your browser on either chat or search.