Deploy Phoenix (Elixir) in minutes

Phoenix apps deploy on Darmi Cloud as Elixir releases via the Dockerfile preset. Because your app runs as a persistent container, LiveView's WebSocket connections work out of the box.

Deploy from GitHub Automatic HTTPS subdomain Live build & runtime logs
Step by step

How to deploy Phoenix (Elixir)

Darmi Cloud doesn't have a dedicated Phoenix (Elixir) preset yet — but the Dockerfile preset gets you deployed just as fast.

  1. 1

    Add a Dockerfile to your repo

    Commit the Dockerfile below to the root of your Phoenix (Elixir) repository. Darmi Cloud will build the image from it.

  2. 2

    Sign in with GitHub

    Open darmicloud.tech and sign in with GitHub (or Google). On first sign-in you grant read access so the deploy worker can clone your repositories.

  3. 3

    Import your repository

    Click New Project, pick your Phoenix (Elixir) repository, and choose the branch to deploy — the default branch is preselected.

  4. 4

    Select the Dockerfile preset

    Choose the Dockerfile preset so Darmi Cloud builds and runs the image from your committed Dockerfile. Set the container port to 4000.

  5. 5

    Add environment variables

    Add any environment variables your app needs (database URLs, API keys, secrets). Mark sensitive values as secrets — they are injected into the container and hidden in the UI afterwards.

  6. 6

    Deploy and watch it go live

    Click Deploy. Watch the live build and runtime logs, and your app goes live on an automatic HTTPS subdomain. Every push to your branch redeploys automatically.

Dockerfile for Phoenix (Elixir)

Copy this into a file named Dockerfile at the root of your repository.

# syntax=docker/dockerfile:1
FROM elixir:1.17 AS build
WORKDIR /app
RUN mix local.hex --force && mix local.rebar --force
ENV MIX_ENV=prod
COPY mix.exs mix.lock ./
RUN mix deps.get --only prod
COPY . .
RUN mix assets.deploy && mix release

FROM debian:bookworm-slim
RUN apt-get update -qq && apt-get install -y libssl3 libncurses6 ca-certificates && rm -rf /var/lib/apt/lists/*
ENV LANG=C.UTF-8 PHX_SERVER=true PORT=4000
WORKDIR /app
# Replace my_app with your OTP application name
COPY --from=build /app/_build/prod/rel/my_app ./
EXPOSE 4000
CMD ["bin/my_app", "start"]

Tips for Phoenix (Elixir) on Darmi Cloud

  • Generate a production Dockerfile with mix phx.gen.release --docker if you prefer — it works with the Dockerfile preset too.
  • Set SECRET_KEY_BASE (mix phx.gen.secret) and DATABASE_URL in project settings before the first deploy.
  • Set PHX_HOST to your subdomain or custom domain so URL generation and origin checks are correct.
FAQ

Phoenix (Elixir) deployment FAQ

Does Phoenix LiveView work on Darmi Cloud?

Yes. Your app runs as a persistent container behind Traefik, so LiveView's long-lived WebSocket connections work — no serverless timeouts.

How do I run Ecto migrations on deploy?

Use the release module generated by mix phx.gen.release: change CMD to run bin/my_app eval "MyApp.Release.migrate" before start, or run it as a release command.

Can I use my own custom domain?

Yes. Connect an existing domain or buy one inside Darmi Cloud. DNS is configured automatically and every domain gets free SSL via Let's Encrypt.

Can I self-host instead of using darmicloud.tech?

Yes. Darmi Cloud is fully self-hostable on any VPS with Docker, PostgreSQL, Redis and Traefik using a single docker-compose file — same features, your infrastructure.

Deploy other frameworks

Ready to deploy your Phoenix (Elixir) app?

Connect GitHub and ship in minutes — on a free HTTPS subdomain, or on your own custom domain.

Deploy Phoenix (Elixir) now