.env file in the server/ directory. Use server/.example.env as your starting template.
Required secrets
You should use 256-bit secret keys for
BOT_API_KEY_ENCRYPT_SECRET, USER_TOKEN_ENCRYPT_SECRET, and PAYMENTS_CUSTOM_DATA_ENCRYPT_SECRET_KEY. You can generate a 256-bit key in hexadecimal format using a tool like this one.string
required
Secret key used to sign and encrypt session cookies. Use a long, random string.
string
required
256-bit secret key used to encrypt bot API keys stored in the database.
string
required
256-bit secret key used to encrypt Discord user access tokens at rest.
string
required
256-bit secret key used to encrypt custom metadata attached to payment records.
string
required
Secret key used to sign and verify JSON Web Tokens issued by the server.
string
required
Shared secret used to authenticate requests from the Next.js client’s server-side rendering.
Discord credentials
string
required
The bot token for your Discord application. Found in the Discord Developer Portal under Bot > Token.
string
required
The OAuth2 client secret for your Discord application. Found in the Developer Portal under OAuth2 > Client Secret.
string
required
The application (client) ID for your Discord application. Found in the Developer Portal under General Information.
string
A Discord webhook URL used to post notifications to an internal portal channel (e.g. new bot approved, new emoji published). This webhook must be created by the bot itself so that interactive components (link buttons) are included in the messages.Must follow the format
https://discord.com/api/webhooks/XXX/XXX. Safe to leave empty.Database
string
required
MongoDB connection string. Accepts both local instances (
mongodb://localhost:27017/discordplace) and cloud-hosted services like MongoDB Atlas.S3 storage
AllS3_* variables (excluding the database backup set) are required. discord.place uses S3-compatible object storage to serve emoji images and sound files. Cloudflare R2 is recommended but any S3-compatible provider works.
string
required
Name of the S3 bucket used for storing emoji and sound assets.
string
required
Access key ID for authenticating with the S3 provider.
string
required
Secret access key for authenticating with the S3 provider.
string
required
Region where the bucket is hosted (e.g.
us-east-1, auto for Cloudflare R2).string
required
Custom endpoint URL for S3-compatible providers. For Cloudflare R2 this looks like
https://<account-id>.r2.cloudflarestorage.com.string
required
Public base URL of the CDN from which assets are served. Must be a valid URL with no trailing slash, e.g.
https://cdn.yourdomain.com. This value should match NEXT_PUBLIC_CDN_URL on the client.S3 database backups (optional)
These variables configure a separate S3 bucket for daily database backups. If left empty the server will still start but will print warnings and skip backups entirely.string
Name of the S3 bucket used for database backup archives.
string
Access key ID for the backup bucket.
string
Secret access key for the backup bucket.
string
Region for the backup bucket.
string
Endpoint URL for the backup bucket’s S3-compatible provider.
Bot protection
string
required
Your Cloudflare Turnstile secret key, used server-side to verify Turnstile tokens submitted by users. Obtain this from the Cloudflare Turnstile dashboard.
Payments — Lemon Squeezy (optional)
string
Webhook signing secret used to verify that incoming events are from Lemon Squeezy. See the Lemon Squeezy webhook docs for setup instructions.
string
API key for making authenticated requests to the Lemon Squeezy API. See the Lemon Squeezy Developer Guide to create one.
Uptime monitoring (optional)
string
Heartbeat ID from Better Stack Uptime. A ping is sent to this heartbeat after each successful daily database backup.
string
Heartbeat ID for monitoring S3 bucket availability. A ping is sent after each successful S3 health check.
Bot guild count API (optional)
string
Base URL of a private API used to look up the approximate guild count for a bot. If omitted, bots will not be able to update
server_count via the public API.string
Secret key for authenticating requests to the guild count API above.
Webhook proxy (optional)
If you route outgoing webhook requests through a proxy server, set these variables. Leave all of them empty to send webhooks directly.string
Protocol for the proxy server, e.g.
http or https.string
Hostname or IP address of the proxy server.
string
Port number the proxy server listens on.
string
Username for proxy authentication. Leave empty if not required.
string
Password for proxy authentication. Leave empty if not required.
Error tracking — Sentry (optional)
string
Sentry Data Source Name (DSN) for error and performance monitoring. Obtain this from your Sentry project settings. Leave empty to disable Sentry.
GitHub translator sync (optional)
string
Secret key used to authenticate the GitHub webhook that triggers automatic syncing of translator roles in the base guild. When configured, a push to the
main branch will sync role assignments based on the client/locales/translators.json file.
