deployment-gotchas

Identify Phoenix deployment pitfalls covering runtime config, assets, migrations, and health checks.

149|15|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/j-morgan6/elixir-phoenix-guide --skill deployment-gotchas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: deployment-gotchas
Source: https://github.com/j-morgan6/elixir-phoenix-guide/tree/main/skills/deployment-gotchas
Command: npx skills add https://github.com/j-morgan6/elixir-phoenix-guide --skill deployment-gotchas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Not a deployment guide — these are the 7 things that break every first Phoenix deploy. Every rule maps to a real production incident pattern.

Core Features & Use Cases

  • Use runtime.exs for secrets and URLs — Secrets and URLs must be loaded at boot time from the environment to avoid being baked into the release.
  • Run migrations via release commands — Migrations must be executed via release-provided commands; do not rely on mix in production.
  • Set PHX_HOST and PHX_SERVER=true — Ensure proper host generation and server startup in production environments.
  • Run assets.deploy before building the release — Compile and digest assets before packaging the release.
  • Never hardcode secrets — Read secrets from runtime environment variables to avoid leaking credentials.
  • Add a /health endpoint that queries the database — Health checks should verify database connectivity alongside HTTP availability.
  • Production log level discipline — Use info or higher in production to avoid logging sensitive data.

Quick Start

Review your Phoenix app against these seven gotchas and implement the recommended practices before your next production release.

Frequently Asked Questions about deployment-gotchas

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Phoenix deployment fail when reading secrets in production?

Phoenix deployment fails when secrets are hardcoded. Use runtime.exs to load secrets and URLs from environment variables at boot time to prevent credential leaks and configuration errors.

How do I run Ecto migrations in a Phoenix production release?

Execute Ecto migrations in Phoenix production releases via release-provided commands. Do not rely on mix in production environments, as mix is unavailable in compiled releases.

What environment variables do I need to set for a Phoenix production release?

Set PHX_HOST to ensure proper host generation and PHX_SERVER=true to trigger server startup in your Phoenix production environment.

When should I compile and digest assets for a Phoenix deployment?

Run assets.deploy to compile and digest assets before building the Phoenix release. This ensures all static assets are properly packaged and ready for production serving.

How does a Phoenix health check verify database connectivity?

Add a /health endpoint that queries the database alongside HTTP availability. This ensures both the web server and database are reachable before routing traffic.

What log level should I use for Phoenix production logging?

Use info or higher log levels in Phoenix production to avoid logging sensitive data. Production log level discipline prevents leaking confidential information through application logs.