Recommended Elixir/Phoenix/OTP vers. / Versions Elixir/Phoenix/OTP recom.
Anonymous
FREEOP

3 months ago

Bonjour,

Je prépare le déploiement d’une app Elixir/Phoenix (API JSON) consommée par une PWA SPA, et je souhaite aligner exactement mon environnement local (asdf) avec celui de Railway. Pourriez-vous m’indiquer quelles versions d’Erlang/OTP, d’Elixir et de Phoenix sont actuellement recommandées/supportées pour les projets Phoenix, et comment Nixpacks décide ou respecte ces versions (via .elixir-version, mix.exs, NIXPACKS_ELIXIR_VERSION, etc.) ?

Merci également si vous avez un exemple minimal de configuration ou de commande de démarrage recommandée pour une app Phoenix standard sur Railway.

-------------------------------------

Hello,

I’m preparing to deploy an Elixir/Phoenix app (JSON API) consumed by a SPA PWA, and I’d like to align my local environment (asdf) exactly with Railway’s runtime. Could you tell me which Erlang/OTP, Elixir, and Phoenix versions are currently recommended/supported for Phoenix projects, and how Nixpacks chooses or respects these versions (via .elixir-version, mix.exs, NIXPACKS_ELIXIR_VERSION, etc.)?

If possible, I’d also appreciate a minimal example of the recommended configuration or start command for a standard Phoenix app on Railway.

Solved$10 Bounty

7 Replies

yusufmo1
PRO

2 months ago

Nixpacks supports Elixir 1.9-1.17 (latest default) but OTP version is auto-set and cannot be customized with Nixpacks. You can specify Elixir version via .elixir-version file, NIXPACKS_ELIXIR_VERSION env var, or it extracts from mix.exs.

However, Railway is migrating to Railpack (new default builder). Railpack supports OTP version control via mise config files .tool-versions or mise.toml). If you need OTP 26+ (required for Phoenix 1.7.12+), use Railpack with:

```

# .tool-versions

erlang 27.0

elixir 1.17.0

```

Recommended start command:

```

mix ecto.setup && mix phx.server

```

env vars:

- SECRET_KEY_BASE (generate with mix phx.gen.secret)

- DATABASE_URL = ${{Postgres.DATABASE_URL}}

- ECTO_IPV6 = true (for private networking)

- LANG / LC_CTYPE = en_US.UTF-8

See: https://docs.railway.com/guides/phoenix and https://nixpacks.com/docs/providers/elixir


ilyassbreth
FREE

2 months ago

railway supports both nixpacks and railpack builders. for full otp version control (which you need), use railpack

create a .tool-versions file in your project root:

erlang 27.3
elixir 1.18.0-otp-27

railpack will respect this automatically. these are also the current recommended versions.

required env vars:

  • SECRET_KEY_BASE (generate with mix phx.gen.secret)

  • DATABASE_URL=${{Postgres.DATABASE_URL}}

  • ECTO_IPV6=true

  • LANG=en_US.UTF-8

  • LC_CTYPE=en_US.UTF-8

start command: mix ecto.setup && mix phx.server

railpack docs: https://railpack.com/languages/elixir/ railway phoenix guide: https://docs.railway.com/guides/phoenix

this setup will keep your asdf and railway perfectly aligned


ilyassbreth
FREE

2 months ago

j'ai fait aussi une translation en francais pour toi :

railway supporte les builders nixpacks et railpack. pour un contrôle complet des versions otp (dont vous avez besoin), utilisez railpack.

créez un fichier .tool-versions à la racine de votre projet :

erlang 27.3
elixir 1.18.0-otp-27

railpack respectera ceci automatiquement. ce sont aussi les versions actuellement recommandées.

variables d'environnement requises :

  • SECRET_KEY_BASE (générez avec mix phx.gen.secret)

  • DATABASE_URL=${{Postgres.DATABASE_URL}}

  • ECTO_IPV6=true

  • LANG=en_US.UTF-8

  • LC_CTYPE=en_US.UTF-8

commande de démarrage : mix ecto.setup && mix phx.server

docs railpack : https://railpack.com/languages/elixir/ guide phoenix railway : https://docs.railway.com/guides/phoenix

cette configuration maintiendra votre asdf et railway parfaitement alignés.


Anonymous
FREE

2 months ago

Thanls a lot for the replies guys...and for the translations too slightly_smiling_face emoji Have a great week !


Thanls a lot for the replies guys...and for the translations too Have a great week !

ilyassbreth
FREE

2 months ago

your welcome


ilyassbreth

j'ai fait aussi une translation en francais pour toi :railway supporte les builders nixpacks et railpack. pour un contrôle complet des versions otp (dont vous avez besoin), utilisez railpack.créez un fichier .tool-versions à la racine de votre projet :erlang 27.3 elixir 1.18.0-otp-27railpack respectera ceci automatiquement. ce sont aussi les versions actuellement recommandées.variables d'environnement requises :SECRET_KEY_BASE (générez avec mix phx.gen.secret)DATABASE_URL=${{Postgres.DATABASE_URL}}ECTO_IPV6=trueLANG=en_US.UTF-8LC_CTYPE=en_US.UTF-8commande de démarrage : mix ecto.setup && mix phx.serverdocs railpack : https://railpack.com/languages/elixir/ guide phoenix railway : https://docs.railway.com/guides/phoenixcette configuration maintiendra votre asdf et railway parfaitement alignés.

2 months ago

For future reference, please make sure to keep all communications in English.


Status changed to Awaiting User Response Railway 2 months ago


brody

For future reference, please make sure to keep all communications in English.

ilyassbreth
FREE

2 months ago

Okay, i will make sure that all future communications are conducted in English, as you requested


Status changed to Awaiting Railway Response Railway 2 months ago


Status changed to Solved brody 2 months ago


Loading...