The Best Cloud Hosting Providers for Elixir Phoenix

Elixir provides a ton of unique capabilities out of the box. There are many different cloud hosting providers to choose from, and it can be hard to determine which one is best to take advantage of these incredible features. Based on our five years of experience with Phoenix in production and extensive testing, we determined that these are the four cloud hosting platforms you should use for your Elixir applications.

The overall best cloud hosting provider to easily leverage the capability of Elixir is Gigalixir.

What are the best cloud hosting platforms for Elixir Phoenix?

  1. GigalixirEditor’s choice
  2. Fly.io – Best for Phoenix LiveView applications
  3. Render – Best for deploying with multiple languages and platforms
  4. Heroku – Best for simple setups and easy integrations

#1. Gigalixir

Check Current Pricing | Editor’s Choice

gigalixir dashboard
Gigalixir Dashboard

Pros and cons

Pros

  • Primary focus is Elixir
  • Supports Mix, Release, and Distillery options
  • Provides access to remote console, observer, and distributed clustering
  • Comprehensive documentation and exceptional support

Cons

  • Lacks one-click integration with other services
  • Documentation site design looks dated

Our experience with Gigalixir

We followed the Getting Started Guide to deploy our Phoenix application. We created our Phoenix app, updated for releases, and finally added Gigalixir environment variable config. You deploy using the Gigalixir CLI which creates a git remote named "gigalixir". When you push to the remote, Gigalixir deploys your Elixir application.

Follow along in our guides on how to deploy Phoenix and Postgres to Gigalixir with Elixir releases, how to set up continuous deployment with GitHub Actions, and finally the HelloGigalixir project on GitHub.

We also had some previous experience using Gigalixir for a Phoenix app with a GraphQL API.

Ease of Use

It was easy to deploy following the Getting Started Guide using the Gigalixir CLI. We had to add a .buildpack file since we used runtime.exs for config but otherwise deploying only required updates to prod.exs and runtime.exs config files. Docker is not required.

Available Features

We appreciate Gigalixir was built to leverage all the Elixir and BEAM capabilities. You have access to remote console, remote observer, and clustering. The dashboard provides health and performance metrics. You have the option of deloying to multiple AWS and GCP regions. You are able to use Elixir and BEAM for many services (e.g. ETS instead of Redis). However, it does not have a large marketplace with easy integrations for other tools.

Documentation / Support

The documentation is extensive and is focused on Elixir-specific guides and issues. While the content is exceptional, the design does look outdated compared to other hosting platforms. Our experience with support was excellent. We missed a section in the docs while deploying. We sent an email late at night and it was answered at the very beginning of the next business day.

Conclusion

Gigalixir was built to deploy Elixir and pricing is reasonable compared to the other companies we reviewed. It provides a great experience for Elixir developers. Gigalixir is the best overall cloud hosting provider to easily leverage the capability of Elixir.

Check Current Pricing

#2. Fly.io

Check Current Pricing | Best for Phoenix LiveView

Fly Dashboard
Fly Dashboard

Pros and cons

Pros
  • Multi-region clustering may reduce latency for Phoenix LiveView apps
  • Provides access to remote console, observer, and distributed clustering
  • Comprehensive documentation
Cons
  • Lacks one-click integration with other services

Our experience with Fly

We followed the Build, Deploy and Run an Elixir Application guide to deploy Phoenix and Postgres using releases and Docker. Then we set up continuous deployment using GitHub Actions.

We created our Phoenix app and updated for releases. Next we added Fly environment variable config and a Dockerfile. Finally, we deployed our Elixir application using the flyctl cli tool. We also used the flyctl cli tool to create a database instance and connect it to our new app.

Check out our article Deploy Elixir Phoenix to Fly with Continuous Deployment and the accompanying HelloFly project on GitHub.

Ease of Use

It was easy to follow the guide to deploy our application using the Fly CLI tool. Fly gives you a Dockerfile template, but some users may prefer to avoid using Docker*. Fly had the only guide covering both Postgres and releases that didn’t make us jump around to different parts of the documentation. Continuous deployment was easy to set up with GitHub Actions. It wasn’t as easy as clicking a button. However, you just need to save a yml template file in you project and push to GitHub.

*Update: With Phoenix 1.6.4+ and the latest flyctl, the deployment process for a Phoenix app on Fly is simply:

$ mix phx.new my_app
$ fly launch
Available Features

You have access to remote console, remote observer, and multi-region clustering. Multi-region clustering may reduce latency for Phoenix LiveView apps because you can deploy the application closer to users. The dashboard provides health and performance metrics. You can easily deploy to different regions during the deploy process.

Documentation / Support

The documentation is well-written and covered the exact steps for our desired setup. It looks like they are continuing to expand their Elixir specific docs. Fly offers community support through a Discourse forum.

Conclusion

Fly recently hired Chris McCord, creator of Phoenix, to help it with Phoenix and Elixir support. Chris has mentioned he is excited about multi-region clustering as a way to deploy LiveView close to users. We expect it to continue adding more Elixir support and documentation. Fly is your best choice for Phoenix LiveView apps.

Check Current Pricing

If you choose Fly, make sure to check out the Phoenix Deployment Handbook. It is all about deploying to Fly and managing your app in production. See below for how to get the Quick Reference Guide for free.

#3. Render

Check Current Pricing | Best for deploying with multiple languages and platforms

Render Dashboard
Render Dashboard

Pros and cons

Pros
  • Easy to set up deployment with releases
  • Simple continuous deployment with GitHub integration
  • Provides access to distributed clustering
Cons
  • Elixir-specific documentation only covers basics

Our experience with Render

We followed the Deploy a Phoenix App with Mix Releases guide to deploy Phoenix and Postgres. First, we created our Phoenix app, updated for releases, added Render environment variable config, and added a Render-provided build script file. We had to refer to Phoenix Deployment with Distillery guide for database set up. Finally, we set up continuous deployment using Render’s one-click integration with GitHub.

Check out our guide to Deploy Elixir Phoenix to Render with Continuous Deployment and the associated HelloRender project on GitHub.

Ease of Use

It was easy to deploy following the Elixir guides. Continuous Deployment was very easy to set up with a one-click integration to GitHub. We connected our GitHub account to our Render account. Then it automatically started building and deploying our app with with every push to GitHub. We had a great experience setting up our Elixir app on Render.

Available Features

You have access to clustering. The dashboard provides health and performance metrics. It’s unclear if you can use remote console or observer since those are not documented. Render does not have scheduled (or unscheduled) restarts, so you should be able to use ETS and GenServer. Render supports a ton of different other languages and frameworks.

Documentation / Support

The documentation is well-written and covered the steps to get started, including clustering. Additional Elixir-specific documentation is sparse. Render provides email and community support (through a Discourse forum) to its customers.

Conclusion

Our experience deploying Phoenix to Render was excellent. It provides more Elixir features than Heroku which we’ll discuss next. Render is a great option if you have a simple Elixir app and deploy a lot of different languages and platforms.

Check Current Pricing

#4. Heroku

Check Current Pricing | Best for simple setups and easy integrations

Heroku Cloud Hosting Dashboard
Heroku Dashboard

Pros and cons

Pros
  • Easy set up with Mix
  • Extensive list of services to integrate
  • Lots of community content and guides
Cons
  • Restrictions limit use of many Elixir features

Our experience with Heroku

There are two different ways to deploy a Phoenix app on Heroku. You can use Heroku buildpacks or the Heroku container stack. For testing, we followed the Deploying on Heroku guide from the Phoenix docs to deploy Phoenix and Postgres using the Heroku container stack and Docker. We created our Phoenix app, updated for releases, added Heroku environment variable config, and added a Dockerfile.

We had to make some additional modifications to the Dockerfile and release.ex files to get automated database migrations on startup working. Then we set up continuous deployment for our new app using one-click GitHub integration.

Check out our guide to Deploy Elixir Phoenix to Heroku Containers with Docker and the associated HelloHeroku project on GitHub.

We’ve also had a Phoenix app deployed to Heroku for 5 years using the Heroku buildpack approach.

Ease of Use

You can deploy using Mix with minimal additional configuration following the official Phoenix guide. You click a button to provide access to your GitHub repo and you have a continuous deployment pipeline. There is a an extensive marketplace of services available to integrate, often with the click of a button.

Available Features

The web dashboard provides information about the health and performance of the Elixir app (not available for free-tier). However, some of the features provided by Elixir are not available:

  • Number of simultaneous connections and duration of connections is limited
  • Distributed clustering is not possible due to dyno firewalls
  • In-memory state used by GenServers and ETS will be lost every 24 hours due to dyno restarts
  • Remote observer can’t be used

In our experience, some of these limitations have work-arounds using other tools.

Documentation / Support

Heroku doesn’t have a lot of official Elixir documentation. However, Heroku was the only example in the Phoenix getting started guide for many years, so there is a lot of community content and guides available if you run into issues. Heroku provides support via help ticket.

Conclusion

There are a lot of Elixir production apps deployed on Heroku. It has a completely free tier for Hobby projects, but scaling can become expensive. Heroku is still a good option for a simple Elixir app. However, we recommend choosing another provider if you want to maximize Elixir’s features in your application.

Check Current Pricing

Frequently Asked Questions (FAQs)

Here are some answers to common Elixir deployment FAQs.

Should I deploy with Mix or Elixir Releases?

Elixir 1.9 introduced Elixir releases. Releases allow developers to precompile and package all of their code and the runtime into a single unit. Most of the hosting platforms we recommend suggest or require you deploy with Elixir Releases. The advantages of using releases include access to remote observer and faster startup due to smaller slug sizes. Read more about Why Releases? from the official Elixir documentation.

What is the best way to handle config?

We recommend everyone continue using config.exs, dev.exs, test.exs, and prod.exs for compile time config and transition to runtime.exs for both Mix and releases. When Elixir v1.9 introduced releases, it also introduced runtime config for releases with a release.exs file. Elixir v1.11 added runtime.exs which unifies the approach for runtime config and environment variables when using both Mix and releases.

In most cases you can edit the file config/prod.secret.exs to change the filename to config/runtime.exs. However, with runtime.exs you may need to wrap your prod config since runtime.exs will run in all environments and will overwrite your compile config in test and dev. See Elixir v1.11 changelog for more details.

You may also need additional config for your cloud hosting platform. It will no longer be able to tell whether your are deploying from Mix or releases based on the presence of the releases.exs file.

Do I need to use Docker?

Releases must be assembled with the same operating system (OS) distribution and version as where it will run in production. Many platforms use Docker to build and deploy releases. For example, Fly uses a two-stage Dockerfile to build the release and then deploy the release. Other platforms (e.g. Gigalixir) have you push code to a git remote on their machines. Then you can build and deploy your release without managing your own Dockerfile. If you are interested in learning more about Docker, check out our article Build an Elixir Release with Docker to Deploy Anywhere.

Why didn’t you recommend AWS?

We considered AWS hosting options (e.g. EC2, ECS, and Elastic Beanstalk). However, given our Ease of Use criteria, the platforms we recommend will provide a better developer experience. Some of our recommended platforms will allow you to choose to deploy on AWS or GCP if you desire to deploy on their infrastructure (e.g. to reduce latency).

What about my favorite Virtual Private Server (VPS) cloud hosting provider?

We have deployed to a Digital Ocean droplet using Docker. It is possible to deploy Elixir to any VPS. But the cloud hosting platforms we recommend will make it easier for your to leverage the full capability of the BEAM.

What do I do about errors in production?

Check out our article covering the best error monitoring services for Elixir so you can deploy with confidence and effectively manage errors.

Methodology

We conducted extensive research into the hosting options for Elixir and Phoenix. You can deploy to any platform using Docker. However, many hosting providers offer Elixir-specific guides and tools to make deployments easier. These platforms and take full advantage of the BEAM.

During evaluation, we deployed a Phoenix application with a Postgres database to each of the cloud hosting platforms. Our elixir version was v1.12.3. If available, we tried to deploy using Elixir releases and runtime configuration for environment variables.

Once we had our Phoenix app running in production with a database instance, we set up a continuous deployment pipeline for the Elixir app from a GitHub repository. Finally, we examined the available dashboard and options for integrating other tools. Most platforms let you easily set up a custom domain, although we did not test that process during our research.

Rating Criteria

We assessed each platform in three areas:

  • Ease of Use
  • Available Features
  • Documentation / Support

Ease of Use

Ideally, a cloud web hosting service will provide a good user experience (UX) to help customers get their applications up and running quickly and securely. The best hosting platforms will have tools designed to make deploying an Elixir / Phoenix application as seamless as possible.

Furthermore, these platforms will offer tools and/or guides to quickly set up a continuous deployment pipeline, clustering (if available), and other common tasks.

Available Features

The best contenders will offer technical resources — such as CPU power, RAM, and storage — that can meet the needs of your application.

Additionally, these platforms will provide a dashboard with real-time performance and error monitoring. Plus it will have easy integration with other tools.

Finally, Elixir and BEAM provide many out of the box features not available from other languages. We rate hosting platforms better if more of these features are available for use.

Documentation / Support

The best hosting platforms will have Elixir and Phoenix specific documentation with FAQs addressing common deployment and ops issues.

For support, we expect providers to offer help via email or help ticket. If we needed assistance, we made a note about the responsiveness of our request.

Platforms get a bonus for having a large collection of Elixir community-developed guides and other content available for use and troubleshooting.

Want To Know How To Deploy Phoenix Apps Using A single Command?

This brand-new FREE training reveals the most powerful new way to reduce your deployment time and skyrocket your productivity… and truly see your programming career explode off the charts!