# Specify OTP/Erlang and Elixir versions on deploy

**URL:** <https://community.fly.io/t/specify-otp-erlang-and-elixir-versions-on-deploy/5678>\
**Category:** Questions / Help\
**Created:** [June 17, 2022, 2:47pm UTC](https://community.fly.io/t/specify-otp-erlang-and-elixir-versions-on-deploy/5678 "2022-06-17T14:47:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![building39](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@building39](https://community.fly.io/u/building39)\
**Post date:** [June 17, 2022, 2:47pm UTC](https://community.fly.io/t/specify-otp-erlang-and-elixir-versions-on-deploy/5678/1 "2022-06-17T14:47:35Z")

</div>

We have a Phoenix application that we would like to deploy to Fly (it’s currently on Heroku). This application has a hard requirement of OTP version \<= 23. Can we specify the version we want at launch/deploy time? If so, how?

---

<div class="post-metadata">

**Author:** ![msimonborg](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/msimonborg/32/3652_2.png) [@msimonborg](https://community.fly.io/u/msimonborg)\
**Post date:** [June 17, 2022, 5:03pm UTC](https://community.fly.io/t/specify-otp-erlang-and-elixir-versions-on-deploy/5678/2 "2022-06-17T17:03:09Z")

</div>

Hey @building39 ,

If you are deploying to fly with heroku buildpacks you should be able to keep your version config that you already have setup in `elixir_buildpack.config`. However, you may want to use Docker and `mix release`, to have more fine-grained control over your builds and especially to take advantage of clustering on fly’s private network. Running `fly launch` will generate a `fly.toml` and a Dockerfile plus related release files for you, or you can run `mix phx.gen.release --docker` (which `fly launch` calls to under the hood). At the top of the generated Dockerfile you’ll see something like this:

```auto
ARG ELIXIR_VERSION=1.13.4
ARG OTP_VERSION=25.0
ARG DEBIAN_VERSION=bullseye-20210902-slim

ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"

```

Hex.pm provides images for every compatible Elixir/OTP version pair, so you can change this to whatever versions you need. I recommend reading carefully through the Phoenix deployment docs about deploying with [releases](https://hexdocs.pm/phoenix/releases.html) and on [fly](https://hexdocs.pm/phoenix/fly.html), especially the section on clustering if that’s your goal.

---

<div class="post-metadata">

**Author:** ![building39](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@building39](https://community.fly.io/u/building39)\
**Post date:** [June 17, 2022, 7:11pm UTC](https://community.fly.io/t/specify-otp-erlang-and-elixir-versions-on-deploy/5678/3 "2022-06-17T19:11:03Z")

</div>

Excellent! I’ll try that. Thanks for the quick response.
