Advanced Setup
The advanced steps below are intended for people with sysadmin experience. If you are not comfortable with these steps, please refer to the basic setup guide.
Introduction
For the advanced setup, first follow the basic setup guide to get the server up and running. Once you have the server running, you can follow the steps below to configure the server for your specific needs.
Configuration
Setting config via environment variables
The server uses environment variables to store configs. You can set these environment variables in a .env file in the root of the project. The .env file should look like this:
# .env
KEY1=value1
KEY2=value2The server will automatically load the .env file when it starts. You can also set the environment variables directly in your shell. Refer to your operating system's documentation on how to set environment variables in the current session.
The valid options are listed in .env.default in the root of the builder and server directories. You can copy the .env.default file to .env and modify the values as needed.
# Copy the .env.default file to .env
cp .env.default .envSecrets directory
The secret directory is located at ./secrets. You can store any secrets you need in this directory. The server will automatically load the secrets when it starts.
An example for a secret called my_secret would look like this:
This is useful when running on docker so you can copy the secrets into the container without exposing them in the Dockerfile.
Database selection
PostgreSQL
We use a Supabase PostgreSQL as the database. You will swap the commands you use to generate and run prisma to the following
This will generate the Prisma client for PostgreSQL. You will also need to run the PostgreSQL database in a separate container. You can use the docker-compose.yml file in the rnd directory to run the PostgreSQL database.
You can then run the migrations from the backend directory.
AutoGPT Agent Server Advanced set up
This guide walks you through a dockerized set up, with an external DB (postgres)
Setup
We use the Poetry to manage the dependencies. To set up the project, follow these steps inside this directory:
Install Poetry
Configure Poetry to use .venv in your project directory
Enter the poetry shell
Install dependencies
Copy .env.default to .env
Generate the Prisma client
In case Prisma generates the client for the global Python installation instead of the virtual environment, the current mitigation is to just uninstall the global Prisma package:
Then run the generation again. The path should look something like this:
<some path>/pypoetry/virtualenvs/backend-TQIRSwR6-py3.12/bin/prismaRun the postgres database from the /rnd folder
Run the migrations (from the backend folder)
Running The Server
Starting the server directly
Run the following command:
Last updated
Was this helpful?