Subscribe

Setting up a free PostgreSQL database on Heroku

✍️

How to get a free postgres database on Heroku

22 Oct, 2021 · 2 min read

Recently I wanted to explore Postgres databases for a specific use case. However, this use case needed the database to be hosted online.

Then I discovered you could quickly set up a free Postgres database on Heroku!

In this article, I’ll show you how you can also create your own free Postgres database.

Do note this database will be limited to the free plan. It’s easy for prototyping but might be too limited for your existing apps.

Set up Heroku and your first app

First, we must create or log into our Heroku account. To do this, head over to their website and follow the login/signup process.

Heroku website

Once your log in, add a new app by clicking the “new” button.

Heroku add new app

Give this app a name and pick a region that works for you.

Heroku new app

Once your app is set up, we need to visit the resource panel and search for ‘Postgres’ to add this add-on.

Add Postgres to Heroku

In the next step, picking the hobby tier is crucial as this is the only free one.

Hobby tier Postgres on Heroku

Viewing the database credentials

To find the database credentials click on the Postgres add-on in your resource overview.

Open up Postgres details

This will open up a new page where you can view the actual Postgres database in more detail. To find the credentials open up the settings menu.

Credentials for Postgres on Heroku

For instance, use these credentials in a database explorer to connect to it. (I’ll be using TablePlus)

Connect to Postgres on Heroku

And there you go, we now have a free Postgres database we can use!

Thank you for reading, and let’s connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter

Spread the knowledge with fellow developers on Twitter
Tweet this tip
Powered by Webmentions - Learn more

Read next 📖

Install PostgreSQL on Mac with Homebrew

2 Feb, 2024 · 3 min read

Install PostgreSQL on Mac with Homebrew

I wrote 1000 articles, what’s next?

22 Dec, 2022 · 3 min read

I wrote 1000 articles, what’s next?

Join 2099 devs and subscribe to my newsletter