Skip to main content
If you have an existing Elixir app that you want to move over to Fly, this guide walks you through the initial deployment process and shows you techniques you can use to troubleshoot issues you may encounter in a new environment.

Provision Elixir and Postgres Servers

To configure and launch your Elixir app, you can use fly launch and follow the wizard. When you run fly launch from the newly-created project directory, the launcher provides some defaults for your new app, and gives you the option to tweak the settings. Run:
You’ll get a summary of the defaults chosen for your app:
Type y at the prompt to open the Fly Launch page, and make the following changes to your app config:
  • Change the default app name and region, if needed.
  • For Databases, select Fly Postgres, give the Postgres database app a name (for example, your app name with -db appended) and choose a configuration.
Once you confirm your settings, you can return to the terminal, where the launcher will:
  • Run the deployment setup task
  • Build the image
  • Set secrets required by (SECRET_KEY_BASE, for example)
  • Deploy the application in your selected region
Make sure to note your Postgres credentials from the output.
That’s it! Run fly apps open to see your deployed app in action. Try a few other commands:
  • fly logs - Tail your application logs
  • fly status - App deployment details
  • fly status -a postgres-database-app-name - Database deployment details
  • fly deploy - Deploy the application after making changes

Troubleshooting your initial deployment

Since this is an existing Elixir app, its highly likely it might not boot because you probably need to configure secrets or other service dependencies. Let’s walk through how to troubleshoot these issues so you can get your app running.

View log files

If your application didn’t boot on the first deploy, run fly logs to see what’s going on.
This shows the past few log file entries and tails your production log files.

Open an IEx Session

It can be helpful to open a IEx Session to run commands and diagnose production issues. To do this, we will login with SSH to our application VM. There is a one-time setup task for using SSH. Follow the instructions.
With SSH configured, let’s open a console.
You have a live IEx shell into your application!

Deploy your application after changes

Deploying your application is done with the following command:
This will take a few seconds as it uploads your application, builds a machine image, deploys the images, and then monitors to ensure it starts successfully. Once complete visit your app with the following command:
If all went well, you’ll see your Elixir application homepage.