Environment Variables
This is an overview of all the environment variables that can be used with Plantic.
CLI
General
PLANTIC_ENV=development # Set this to 'development' to default to the local development server instead of Plantic Cloud when working on Plantic itself.
PLANTIC_API_HOST= # Defaults to 'http://localhost:8099' if PLANTIC_ENV is development, otherwise it's 'https://api.plantic.ai'—override this to use a different host.
LLM Providers
OPENAI_API_KEY= # Your OpenAI key (if self-hosting or using BYO API Key mode with Plantic Cloud)
OPENROUTER_API_KEY= # Your OpenRouter.ai API key (if self-hosting or using BYO API Key mode with Plantic Cloud)
OPENAI_API_BASE= # Your OpenAI server, such as http://localhost:1234/v1 Defaults to empty.
OPENAI_ORG_ID= # Your OpenAI organization ID. Defaults to empty.
Upgrades
PLANTIC_SKIP_UPGRADE= # Set this to '1' to skip the auto-upgrade check when running the CLI.
Development
Check out the Development Guide for more details.
PLANTIC_OUT_DIR=/usr/local/bin # Where the development binary should be output when using dev.sh
PLANTIC_DEV_CLI_OUT_DIR=/usr/local/bin # Where the development binary should be output when using dev.sh
PLANTIC_DEV_CLI_NAME=plantic-dev # The name of the development binary when using dev.sh
PLANTIC_DEV_CLI_ALIAS=pdxd # The alias for the development binary when using dev.sh
GOPATH= # This should be already set to your Go folder if you've installed Golang.
Server
Check out the Self-Hosting Guide for more details.
General
GOENV=development # Whether to run in development or production mode. Must be 'development' or 'production'
PLANTIC_BASE_DIR= # The base directory to read and write files. Defaults to '$HOME/plantic-server' in development mode, '/plantic-server' in production.
API_HOST= # The host the API server listens on. Defaults to 'http://localhost:$PORT'. In production mode, should be a host like 'https://api.your-domain.ai'.
PORT=8099 # The port the server listens on. Defaults to 8099.
docker-compose
For self-hosting with docker-compose, default environment variables are set in app/_env. This file should be copied to app/.env before running the server. You can override any of these defaults in .env.
PLANTIC_DATA_DIR=/var/lib/plantic/data # When using docker-compose, this is the directory *on your machine* that the Plantic server will use to store data—it will be mounted to the Docker container as a volume.
# Database Credentials
POSTGRES_DATABASE=plantic # Your postgres database.
POSTGRES_USER=plantic # Your postgres user.
POSTGRES_PASSWORD=plantic # Your postgres password.
Other methods
If you're not using docker-compose, you'll need a DATABASE_URL environment variable that points to a PostgreSQL database. For example, if you're running PostgreSQL locally, you might set it to something like this:
DATABASE_URL=postgres://plantic:<password>@<host>:<port>/plantic?sslmode=disable
If you're running in production mode, you'll also need to set API_HOST to the host the API server is running on.
API_HOST= https://api.your-domain.ai # The host of the API server in production mode. Defaults to 'http://localhost:$PORT' in development mode.
SMTP
If you're running in production mode (with GOENV=production, typically on a remote server), you'll need SMTP credentials:
SMTP_HOST= # Your SMTP host.
SMTP_PORT= # Set this to 1025 e.g. if you are using mailhog.
SMTP_USER= # SMTP username.
SMTP_PASSWORD= # SMTP password.