---
title: "Elixir"
description: "Deploy Elixir and Phoenix applications on Miget."
---
Miget Buildpacks automatically detect and build your Elixir applications when you select **Auto detection (Miget Buildpacks)** as the build method. No configuration is required for most projects. For the full reference, visit the [migetpacks Elixir documentation](https://migetpacks.com/languages/elixir).
## Detection
Your application is detected as Elixir when these files are present in the root directory:
- `mix.exs`
- `mix.lock`
## Version Detection
The Elixir and Erlang versions are determined from the following sources, in order of priority:
1. `elixir` version constraint in `mix.exs`
2. `.elixir-version` file
3. `.tool-versions` file (for both Elixir and Erlang versions)
If no version is specified, the latest stable versions are used.
## Build Process
During the build, the following steps are performed:
1. **Elixir and Erlang installation** - The appropriate versions of Elixir and Erlang/OTP are installed using the official Elixir images.
2. **Dependency installation** - Dependencies are fetched and compiled using `mix deps.get` and `mix deps.compile`.
3. **Phoenix detection** - If Phoenix is detected, the assets pipeline runs automatically (e.g., `mix assets.deploy`).
4. **Release build** - A Mix release is built for production deployment.
5. **Umbrella projects** - Umbrella project structures are fully supported.
## Run Command
The run command is auto-detected based on your project configuration:
- **Phoenix applications** - `mix phx.server` or the Mix release binary
- **Other applications** - The Mix release binary
You can override the run command by defining a `web` process in a `Procfile` at the root of your repository. You can also override the run command directly in the Miget dashboard when creating your app or changing the deployment source.
## Configuration
You can customize the build and runtime behavior through the Miget dashboard and repository configuration files:
- **Environment variables** - Set under **Settings -> Variables** in the Miget dashboard
- **Procfile** - Define the start command at the root of your repository
- **Project Path** - For monorepo setups, specify the subdirectory containing your application code in the **Advanced** tab
- **Pre-Deploy Command** - Run a command before deployment (e.g., database migrations) in the **Advanced** tab
- **Post-Deploy Command** - Run a command after successful deployment (e.g., seeding data, cache warming) in the **Advanced** tab
Common environment variables for Elixir applications include:
- `SECRET_KEY_BASE` - Required for Phoenix applications
- `MIX_ENV` - Set to `prod` by default during builds
- `PHX_SERVER` - Set to `true` to start the Phoenix server
## Docker Hardened Images
Docker Hardened Images (DHI) are not currently supported for Elixir applications. Use a custom Dockerfile if you need a hardened runtime image.
For the complete reference, see the [migetpacks Elixir documentation](https://migetpacks.com/languages/elixir).