.env File

Editing the .env File

You can edit the .env file by opening your Manager Settings. Then pressing the Edit .env File button

.env File Reference

  • POSTGRES_PASSWORD: the password to the postgress database.
  • POSTGRES_USER: the username to the postgress database.
  • DB_HOST: The database host. Most likely localhost
  • DB_PORT: The port to the database.
  • POSTGRES_DB: The database name.
  • DATABASE_URL: Do not change unless you know what you're doing!
  • JWT_SECRET: This is a random value to keep the CAD secured.
  • CORS_ORIGIN_URL: The URL/IP to where the CAD is hosted at, e.g., https://cad.mysite.com or
  • NEXT_PUBLIC_PROD_ORIGIN: The URL/IP to where the API is hosted at, e.g., https://cad-api.mysite.com/v1 or
  • PORT_API: The port where you want to run the API at. (Default 8080)
  • PORT_CLIENT: The port where you want to run the client at. (Default: 3000)
  • ENCRYPTION_TOKEN: Used to generate encrypted values. Must be 32 characters long

Additional .env configuration.

Additional configuration for the .env file for authentication and role management.
  • DISCORD_BOT_TOKEN: Discord Bot Token (Used for Discord Role Integration)
  • DISCORD_SERVER_ID: The ID of the Guild that your bot is in
  • DISCORD_CLIENT_ID: The ID of your Bot (Located in the Discord Developer Portal)
  • DISCORD_CLIENT_SECRET: The secret client token of the bot (Located in Discord Developer Portal)
  • STEAM_API_KEY: Used for steam authentication.

Manager vs Command Line

SnailyCAD Manager will automatically compile your .env file when the CAD is started to save changes made to the configuration. If you're using a standalone (command-line) installation, this must be manually done. More information can be found in the SnailyCAD Documentation
This is for command-line specific installations, you don't need to follow this for a SnailyCAD Manager installation.