DEV Community

Cover image for Setting up a free PostgreSQL database on Heroku
Chris Bongers
Chris Bongers

Posted on β€’ Originally published at daily-dev-tips.com

14 4

Setting up a free PostgreSQL database on Heroku

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 found out you can 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 of all, we need to create or log into our Heroku account. Do todo this head over to their website and follow the login/signup process.

Heroku website

Once your login, 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

On the next step, it's crucial to pick the hobby tier 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

Use these credentials in a database explorer for instance 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

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly β€” using the tools and languages you already love!

Learn More

Top comments (5)

Collapse
 
madza profile image
Madza β€’

I'm currently using one for visitor stats πŸ˜‰
10k row limit is pretty tight, have to manually empty it once in a while πŸ˜€πŸ˜€

Collapse
 
dailydevtips1 profile image
Chris Bongers β€’

Ah yeah can imagine for that kind of data.
But I guess it's working for you?

I'm using it for upvotes, so might hit that quickly πŸ˜‚

Collapse
 
waylonwalker profile image
Waylon Walker β€’

oh that sounds really cool. I'm always afraid to add server side things to maintain on my site. Mainly I just want it to be simple and continue to work no matter what without me fussing with it.

Collapse
 
waylonwalker profile image
Waylon Walker β€’

This seems super cool, wondering what I could do with this to add some flair to my personal site.

Collapse
 
dailydevtips1 profile image
Chris Bongers β€’

Quite a lot of cool things we could do with it, Maybe even take some inspiration f rom Kent C Dodds with his teams?

Billboard image

Try REST API Generation for MS SQL Server.

DreamFactory generates live REST APIs from database schemas with standardized endpoints for tables, views, and procedures in OpenAPI format. We support on-prem deployment with firewall security and include RBAC for secure, granular security controls.

See more!

πŸ‘‹ Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay