Auto-Generated Variables

When you create an app, Potions auto-generates environment variables so your Phoenix app can boot and connect to its database without any manual configuration. These variables are marked with an auto badge to distinguish them from variables you add yourself.

The Variables

Variable Default Value Purpose
SECRET_KEY_BASE Random 64-byte base64 string Phoenix uses this to sign and encrypt sessions, cookies, and tokens
DATABASE_URL ecto://<user>:<pass>@localhost:5432/<db> PostgreSQL connection string for your app's dedicated database
PHX_HOST Your server's IP address The hostname Phoenix uses for URL generation, websocket endpoints, and email links
PHX_SERVER true Tells Phoenix to start the HTTP server when the release boots
PORT App's assigned port (e.g., 4000) The port your app listens on. Caddy reverse-proxies traffic from ports 80/443 to this port
MIX_ENV prod The Mix environment used during build and at runtime

The Environment tab showing auto-generated variables with the auto badge

Editing and Deleting Auto-Generated Variables

Auto-generated variables are fully editable. You can change the value of any variable from the Environment tab, or delete it if your app doesn't need it.

Changes to environment variables take effect on the next deploy. They don't affect your currently running instance.

Things to Know

  • PHX_HOST updates automatically with domains. When you add your first custom domain, Potions updates PHX_HOST to match. If you delete the primary domain, Potions reverts PHX_HOST to the server IP. You can also change it manually at any time. See Adding a Custom Domain for details.
  • All values are encrypted at rest. Potions uses AES-256-GCM encryption for every variable, not only auto-generated ones.
  • Deleting DATABASE_URL won't delete your database. The PostgreSQL database and user continue to exist on the server. The variable is only the connection string.
  • Your variables are excluded from build logs. Potions redacts sensitive values from build output so credentials never appear in deployment logs.