DEV Community

Can Ural
Can Ural

Posted on

From Heroku to Fly; Two ways to deploy your projects for free

Starting November 28, 2022, we plan to stop offering free product plans and plan to start shutting down free dynos and data services.

It is time, Heroku is ending their free product plans as of tomorrow. This meant one thing for me, to migrate my APIs to a free service. On top of that, I wanted that service to offer me easy solutions while migrating and/or updating my apps.

So while looking for possibilities, I bumped into Fly. Upon looking at their site; I realised that they have a dedicated page for deploying Heroku apps in their service, which immediately caught my attention.

In this article, I will walk you through two options how you can deploy your apps in Fly.

1. Turboku

Turboku is a service created by Fly to deploy Heroku applications. According to Turboku's page, it is 60% faster than Heroku dynos.

Migrating my apps to Fly with Turboku was a breeze, it was my first option to go with and I didn't have any issues whatsoever.

What is required from you is to; connect Fly account to Heroku, make some configurations (e.g. new app's name, region, which app to deploy) and then clicking on launch. After taking these steps, you will see deploy logs on the left side of the screen and then voilà; your app is deployed and published, congratulations! ✨ 🥳

Some key topics to note;

  • I didn't have any issues with environment variables. They were transferred directly with Turboku and this was a really nice surprise.
  • Because the app is deployed with Turboku through Heroku and not deployed manually, updating the app later on might be tricky because the app gets the latest state from Heroku. Which brings me to second way of deploying the app; manual deploys.

More on Turboku can be found in their blog post

2. Manual deploy

Manual deploy is not as easy as Turboku, but it will help you have more control over you app's state in Fly.

First thing we need to do is to install flyctl, a command-line utility by Fly. We will use flyctl to login, launch and deploy our app to Fly.

Secondly, looking through docs, we need to find how to deploy our app with selected language. For me it was Node.js and looking through their docs, it wasn't difficult to find the guide.

What comes next is following the guide and deploying the app. Congratulations again! ✨ 🥳

Some key topics to note in here are;

  • Setting up secrets/environment variables require to check another page in their documentation but it isn't difficult or too much time consuming to set them. Every time you set a new secret, app will be re-deployed.
  • So far I deployed two of my APIs with Fly and both uses MongoDB. I needed to provide production URL for both but here comes the issue; in first one I could deploy the app with only flyctl launch and then flyctl deploy. But in second one, I needed to provide MongoDB connection string while deploying otherwise deploy failed (environment variables are supported with a flag).
flyctl deploy -e KEY=VALUE
Enter fullscreen mode Exit fullscreen mode

This command was enough to overcome my issue and then I could deploy successfully.

I hope this guide was helpful to overcome a bumpy transition to a better one.

Finally, I would like to mention that this how-to guide/post was written purely from my experience. Thanks for making it thus for in my first blog post ever!

Top comments (0)