• Docs
  • Changelog
Sign in
Get started
    • Home
    • Your first deploy
    • Free instances
    • Platform features by plan
    • Use with coding agents
    • FAQ
    • Templates
      • Migrate from…
        • Heroku
        • Railway
    • Compute plans
    • SandboxesBeta
      • Service types
        • Which to use?
        • Static sites
        • Web services
        • Private services
        • Background workers
        • Cron jobs
        • Workflows
        • Multi-service architectures
      • Data storage
        • Render Postgres
        • Render Key Value (Redis®-compatible)
        • Persistent disks
    • How deploys work
    • Supported languages
    • Git providers (GitHub, etc.)
    • Build pipeline
    • Deploy hooks
    • Monorepo support
    • Troubleshooting deploys
      • Previewing changes
        • Single-service previews
        • Preview environments (multi-service)
      • Docker deploys
        • Overview
        • Deploy a registered image
        • Using secrets
      • Runtime
        • Native runtimes
        • Environment variables & secrets
        • Default environment variables
    • Intro to sandboxes
    • Limits
      • How to…
        • Create & configure sandboxes
        • Execute commands
        • Manage files
        • Manage snapshots
      • Use with…
        • Claude Managed Agents
        • Cursor Cloud Agents
        • OpenAI Agents API
      • SDK/CLI reference
        • TypeScript SDK
        • Python SDK
        • CLI commands
    • Intro to workflows
    • Tutorial
    • Limits & pricing
      • How to…
        • Define tasks
        • Define flowsNew
        • Trigger runs
        • Develop locally
      • SDK reference
        • TypeScript SDK
        • Python SDK
      • Example workflows
        • TypeScript examples
        • Python examples
    • Overview
    • Create & connect
    • Database credentials
    • Extensions
    • Version upgrades
    • Logical replication
    • Legacy instance types
      • Database recovery
        • Recovery & backups
        • High availability
      • Database performance
        • Read replicas
        • Connection pooling
        • Admin apps
        • Repacking tables
        • Troubleshooting performance
    • Regions
    • Inbound IP rules
    • Edge caching
    • WebSockets
    • TLS certificates
      • Custom domains
        • Overview
        • Cloudflare
        • Namecheap
        • Other DNS providers
      • Internal traffic
        • Private network
        • Private links
      • Outbound traffic
        • Default IP ranges
        • Dedicated IP addresses
        • Outbound bandwidth
        • Handling network changes
      • Static site config
        • Custom response headers
        • Redirects & rewrites
    • The Render Dashboard
    • SSH / Shell access
    • Projects & environments
      • Service actions
        • Scaling
        • Rollbacks
        • Maintenance mode
        • One-off jobs
      • Infrastructure as code
        • Blueprints overview
        • render.yaml reference
        • Terraform provider
    • In-dashboard metrics
    • Health checks
    • Uptime best practices
      • Logging
        • In-dashboard logs
        • Log streams (syslog/HTTPS)
      • OpenTelemetry (OTel) metrics
        • Provider setup
        • Metrics reference
      • Notifications
        • Webhooks
        • Email / Slack
    • MCP Server
      • Render CLI
        • Overview
        • Command reference
      • REST API
        • Overview
        • API reference
      • Third-party connections
        • OIDC support
        • Datadog
    • Workspaces, members, & roles
    • Login settings
    • Audit logs
      • Organizations
        • Overview
        • SAML SSO
    • DDoS protection
    • Platform maintenance
      • Compliance
        • Overview
        • HIPAA (US health data)
        • HIPAA best practices
        • Shared responsibility model
        • Pentest policy
    • Heroku vs Render
    • Vercel vs Render

Deploy a Phoenix App on Render

This guide walks through deploying a Phoenix application on Render.

The finished code for this example is available on GitHub.

Getting started

Create a new Phoenix app in the terminal. We don't need a database for this example, so pass the --no-ecto flag to mix:

Create a build script

We need to run a series of commands to build our app on every push to our Git repo, which we can accomplish with a build script. Create a script named build.sh at the root of your repo:

Make sure the script is executable before you commit it:

Update your app for Render

Update config/runtime.exs to change the highlighted line below:

to this:

Render populates RENDER_EXTERNAL_HOSTNAME for config/runtime.exs.

If you add a custom domain to your Render app, don't forget to change the host to your new domain.

Build and test your release locally

Compile your release locally by running ./build.sh. The end of the output should look like this:

Test your release by running the following command and navigating to http://localhost:4000.

You might need to run mix deps.get locally to enable phx.gen.secret, because it's a dev dependency instead of a prod dependency. You should add/commit your mix.lock file before running this.

You might notice the start command is different from the output of build.sh. The phx.gen.release command in the build script creates a wrapper for launching your application that includes setting the PHX_SERVER variable, so a web server will start. You can also use the start command from the build.sh output, but you will need to set PHX_SERVER to true in the environment variables if you do.

If everything looks good, push your changes to your repo. Next, let's deploy your app to Render!

Deploy to Render

  1. In the Render Dashboard, create a new web service and connect your Phoenix app's repo.

  2. Set the following values during service creation:

    SettingValue
    LanguageElixir
    Build Command./build.sh
    Start Command_build/prod/rel/phoenix_hello/bin/server
  3. Add the following environment variable to your web service:

    KeyValue

    SECRET_KEY_BASE

    A sufficiently strong secret. You can generate one from your local project directory with the following command:

That's it! Your Phoenix web service will be live at its onrender.com subdomain as soon as the deploy finishes.

Read about setting Elixir and Erlang/OTP versions for your app.

Deploy a Phoenix App on Render
  • Getting started
  • Create a build script
  • Update your app for Render
  • Build and test your release locally
  • Deploy to Render
All Systems Operational
© Render Inc. All rights reserved.