Even a beginner can deploy their app to the live web in minutes
How to use Heroku to make your awesome web app live and available for everyone on the Web
It's hard to get excited about your web app if you can't even see it on the Internet. You should have a URL that you can visit, whether you're on your computer or your phone, to see any new feature that you add.
That’s why I was pleasantly surprised to learn that you can do that in minutes even as a beginner with Heroku.
Here’s how:
Installing Heroku
I don’t know why but there are a bunch of different ways to install Heroku and not all of them work. Here’s the one that worked for me on my terminal (I’m using Mac):
curl https://cli-assets.heroku.com/install.sh | sh
Setting up your app for deployment
The Learn Enough Rails book has a chapter on setting up Heroku for deployment. Follow that. It’s available for free on their website.
It will take a few minutes and you’ll end up with a URL that will take you or anyone that visits it on their browser to your app!
How to add a custom domain to the app deployed on Heroku
The URL that you end up with on the above step is provided by Heroku that looks something like this - https://quiet-anchorage-29070.herokuapp.com
If you want to customise this and use your a domain you own, you can follow the steps in this tutorial.
Viewing logs
After you have deployed your app on the web, you won’t be able to see the error logs on your terminal like you used to. You’ll need to use the heroku logs
command or the dashboard to view them. This article explains how.
Note:
Heroku has announced that starting November 28th, 2022, free Heroku Dynos, free Heroku Postgres, and free Heroku Data for Redis will no longer be available - the things that make it possible to deploy your app on Heroku. You may have to pay for them.
Check out this post on their blog to learn more about it.