Heroku is an interesting platform. Many folks, especially developers, often use their service to host a hobby project for free. The others, who are just starting a project, are also trying Heroku to host and run their MVP, for free. Here are the things you need to know before using Heroku to run your production app.
It’s not free for a production app
Heroku is not free if you want to run a production app. Instead, it gives you free 550 hours to run your app every month. You can get more 450 hours if you give them your credit card number for verification.
Be mindful that these free dyno hours applied for your whole Heroku account . Let’s take an example.
Suppose you have two running Heroku applications under your verified Heroku account, then each of this app will have 500 hours at maximum, per month, per app.
Not only that, the application that runs on the free dyno will sleep every 30 minutes if it doesn’t receive any request.
This means you need to set up a pinger service to ping your Heroku app every 30 minutes or less, to prevent it goes sleep.
It’s possible to run a hobby app without sleeping
But you need to have only one Heroku application on that verified account. One month equals 731 hours. This means you can run a hobby app for free every month, without letting it goes to sleep.
Of course, you need to set up a pinger service to keep sending a ping to your Heroku application, to keep it wake up.
It’s not a web hosting
People often think Heroku is similar to traditional shared web hosting. In fact, it’s not.
Never expect to store some files like images or videos on Heroku. This because when the dyno restarts, all of them will be gone.
You need to have another storage to store such files to use by your Heroku application. It can be an AWS S3, Dropbox, or any other cloud storages.
It’s more expensive (for most cases)
Unless you run a Ruby on Rails app or NodeJS app, it would be better to go for VPS like Digital Ocean or AWS Lightsail or go with traditional shared web hosting if you don’t want to mess up with setting up a VPS.
Let’s compare the pricing.
Digital Ocean droplets start from $5/month. Unlike Heroku, you can store files there. With DO, you don’t need to sign up for other cloud storage just to save the files for your app persistently.
AWS Lightsail starts from $3.5/month. Don’t forget that a new AWS account is eligible for free tier for the first year.
While Heroku paid tier starts from $7/month. Again, you still need to sign up for another cloud service to store the files.
That is if you just want to run a typical WordPress blog, it’s better to go with shared web hosting which will cost you less than $7/month. As an example, my hosting on VeeroTech starts from $3.95/month.
You may be tempted to run WordPress on Heroku. It’s not feasible. I had tried it myself. Seriously, it’s not worth your time.
Heroku does have many advantages. But for me, the most important one is it frees the developer from the hassles to set up a VPS.
Setting up a DO droplet or AWS EC2 instance can take a full day before it’s ready to run a Rails application.
On the opposite, running Rails app on Heroku is just a matter of minutes or seconds. Fire up the git push command, wait several seconds or minutes to be done, then you can access it on the internet.
As always, there is no one service that fits all the needs. The same goes for Heroku.
It is a platform as a service. It lets you deploy and run a Ruby on Rails or NodeJS or any app that had supported stack easily.
In most cases, deploying to Heroku is just a matter of running the git push command.