
This covers the production operations checklist for Phoenix apps: releases, runtime configuration in config/runtime.exs, libcluster strategies for multi-node PubSub and Presence, telemetry setup with OpenTelemetry, and endpoint hardening (HTTPS, rate limiting, CORS). It walks through asset deployment with mix assets.deploy, Oban for background jobs, and deployment patterns for containers and systemd. The health check and observability sections are practical. Most useful when you're moving a Phoenix app from development to production or debugging clustering issues. The common pitfalls list at the end is worth reading first, especially the note about PHX_SERVER=true and avoiding compile-time secrets.
$ npx -y skills add bobmatnyc/claude-mpm-skills --skill phoenix-ops --agent claude-codeInstalls into .claude/skills of the current project.
Production-ready Phoenix apps rely on releases, runtime configuration, telemetry, clustering, and secure endpoints. The BEAM enables rolling restarts and supervision resilience when configured correctly.
MIX_ENV=prod PHX_SERVER=true mix assets.deploy
MIX_ENV=prod mix release
_build/prod/rel/my_app/bin/my_app eval "IO.puts(:os.type())"
_build/prod/rel/my_app/bin/my_app start
config/runtime.exs for env-driven settings:
config :my_app, MyApp.Repo,
url: System.fetch_env!("DATABASE_URL"),
pool_size: String.to_integer(System.get_env("POOL_SIZE", "10")),
ssl: true
config :my_app, MyAppWeb.Endpoint,
url: [host: System.fetch_env!("PHX_HOST"), port: 443, scheme: "https"],
http: [ip: {0,0,0,0}, port: String.to_integer(System.get_env("PORT", "4000"))],
secret_key_base: System.fetch_env!("SECRET_KEY_BASE"),
server: true
Secrets
SECRET_KEY_BASE with mix phx.gen.secret.Sponsors