Skip to content

Settings

teabot reads its settings from teabot.env, in your instance's folder. After a change, recreate the bot's container, so it reads the file again:

docker compose up -d --force-recreate bot

On a bare-metal host, the file is /etc/teabot/teabot.env, and the restart is systemctl restart teabot.

The ones people change

Setting What it does
TEABOT_DISCORD_TOKEN The bot's token. setup.sh writes it.
TEABOT_PUBLIC_URL Your bot's public HTTPS address, so AI assistants on other machines can connect, and where your teabot's site is served. See HTTPS.
TEABOT_DISCORD_CLIENT_SECRET The application's OAuth2 client secret, which lets admins sign in to the site. See Your teabot's site.
TEABOT_SITE_PAGES The folder with your site's privacy.md and terms.md. pages if left out. See Your teabot's site.
TEABOT_DISABLED_PLUGINS Plugins turned off in every server. See Adding plugins.
TEABOT_GUILD_RETENTION_DAYS How long a server's data is kept after the bot leaves it.
TEABOT_DIRECTORY_RETENTION_DAYS How long the member directory keeps its history and members who have left. A year if left out. Your privacy policy says how long.
TEABOT_DIRECTORY_MEMBER_LIMIT Servers with more members than this have no member directory. 0, the default, is no limit.
TEABOT_MESSAGE_CONTENT true lets plugins read what members write. Turn on Message Content Intent under Bot in the Discord developer portal first. A bot in more than 100 servers needs Discord's approval for it.

A plugin may need settings of its own, such as an API key. They are named TEABOT_PLUGIN_<ID>_<NAME>, such as TEABOT_PLUGIN_WOM_API_KEY, and go in teabot.env too. The plugin's README lists them. Restart teabot after changing one.

Every setting

This is the template's teabot.env.example, which setup.sh copies to teabot.env:

teabot.env
# teabot settings. setup.sh copies this file to teabot.env, which teabot reads.
# Every name starts with TEABOT_. A variable set in the environment wins over this file.
# After a change, recreate the bot's container: docker compose up -d --force-recreate bot

# --- Discord ---
# The bot's token, from the Discord developer portal. setup.sh asks for it.
TEABOT_DISCORD_TOKEN=
# Readable logs and extra checks, for developing teabot or a plugin.
TEABOT_DEV_MODE=false

# --- Postgres ---
# `teabot init` creates the database roles and fills in their passwords. With Docker Compose, leave these as they
# are: Compose points the bot at its own Postgres.
TEABOT_DB_HOST=127.0.0.1
TEABOT_DB_PORT=5432
TEABOT_DB_NAME=teabot
TEABOT_DB_OWNER_USER=teabot_owner
# The start of every database role name teabot creates. Change it to share one Postgres server between instances.
TEABOT_DB_ROLE_PREFIX=teabot
# With Docker Compose, leave this blank: Compose passes the one in .env.
TEABOT_DB_OWNER_PASSWORD=
TEABOT_DB_APP_PASSWORD=
TEABOT_DB_PLUGINS_PASSWORD=
# Database connections per pool.
TEABOT_DB_POOL_SIZE=10

# --- HTTP, for AI assistants (MCP) and the service API ---
# Keep it on localhost, behind a reverse proxy that adds HTTPS. With Docker Compose, leave these two: Compose sets
# the address, and the port on this machine is TEABOT_HTTP_PORT in .env.
TEABOT_HTTP_HOST=127.0.0.1
TEABOT_HTTP_PORT=8780
# The public HTTPS address, such as https://teabot.example.org. Set it so AI assistants on other machines can
# connect, and to serve your teabot's site there: its home page and its plugins. /tokens create then gives
# assistants this address.
TEABOT_PUBLIC_URL=
# The OAuth2 client secret of the bot's application, from the developer portal. With TEABOT_PUBLIC_URL, it lets
# admins sign in to the site with Discord and turn plugins on and off there.
TEABOT_DISCORD_CLIENT_SECRET=
# The folder holding your site's privacy.md and terms.md, shown at /privacy and /terms when they exist.
TEABOT_SITE_PAGES=pages

# --- Plugins and data ---
# Plugins blocked in every server, comma-separated, such as giveaways,raffles. Their data is kept.
TEABOT_DISABLED_PLUGINS=
# Days a server's data is kept after the bot leaves it. If the bot is added back sooner, everything is as it was.
TEABOT_GUILD_RETENTION_DAYS=30
# true lets plugins read what members write, for plugins that need it. Turn on "Message Content Intent" under
# Bot in the Discord developer portal first, or Discord refuses the connection.
TEABOT_MESSAGE_CONTENT=false

# --- The member directory ---
# Days the member directory keeps its history, and members who have left. Say so in your privacy policy.
TEABOT_DIRECTORY_RETENTION_DAYS=365
# Servers with more members than this have no directory. 0 for no limit.
TEABOT_DIRECTORY_MEMBER_LIMIT=0
# true reads how each member joined, such as by which invite, from Discord's member search, which Discord's published
# API docs do not list. false leaves join method unknown.
TEABOT_DIRECTORY_JOIN_LOOKUP=true

# --- The event loop's watchdog ---
# A plugin that holds the loop this many seconds is logged, with its file and line.
TEABOT_LOOP_WARN_SECONDS=1
# Held this long, teabot logs every thread's traceback and exits, for systemd or Compose to restart it.
TEABOT_LOOP_LIMIT_SECONDS=30
# The same limit while plugins load and migrate at startup.
TEABOT_STARTUP_LIMIT_SECONDS=600

# --- Logging ---
# DEBUG, INFO, WARNING or ERROR.
TEABOT_LOG_LEVEL=INFO
# auto, text or json. auto is text in dev mode and json otherwise.
TEABOT_LOG_FORMAT=auto

The .env file

Docker Compose reads .env, which setup.sh writes. It is separate from teabot.env:

.env
TEABOT_DB_OWNER_PASSWORD=...   # the database password; Postgres keeps the one it first started with
TEABOT_UID=1000                # the user and group the bot runs as, who must own teabot.env
TEABOT_GID=1000

To use other ports on this machine, add TEABOT_HTTP_PORT (default 8780) or TEABOT_DB_PORT (default 55432) to .env, not to teabot.env, then run docker compose up -d.

The bot may use up to 1 GB of memory, and is restarted if it goes past, so a leak cannot starve Postgres. Set TEABOT_MEMORY_LIMIT in .env, such as TEABOT_MEMORY_LIMIT=2g, to change it. On a bare-metal host, it is MemoryMax= in teabot.service.

Next: Adding plugins.