How to Set Up a Free PostgreSQL Database on Heroku
Let’s explore how we can quickly set up a small Postgres instance in Heroku for our personal projects.
Heroku intended this free Hobby Tier to be used for “proof of concepts, MVPs, and personal projects”.
By using this free tier, we are limited in the following:
- Enforced row limits of
- Maximum storage of
- Maximum of
- No in-memory cache: The lack of an in-memory cache limits performance, because the data can’t be accessed on low-latency storage
- No fork/follow support: Fork and follow, used to create replica databases and leader-follower setups, are not supported
- No Expensive Queries support
- Expected uptime of
- Unannounced maintenance and database upgrades
- No Postgres logs
- No additional credentials
1. Log into Heroku
First, we’ll need to go to Heroku’s Login Page to either login or sign up for an account.
We’ll be brought to our Heroku Dashboard, listing all of our Heroku apps.
2. Create a new app
We want to create a new app.
Create new app
App name, type in a name such as
After creating the new app, we’ll be brought to the app page.
3. Attach PostgreSQL database
Time to create the database.
- Head over to the
- In the
Add-onssearch bar, search
Plan name, select the
Hobby Dev - Freeplan
After confirming, we’ll be brought back to the
4. Get database credentials
Next, we need to get the database credentials and connection URL to make calls to this database.
Heroku Postgres. It will open the Heroku Data Dashboard.
- In the Data Dashboard, select the
These credentials (i.e.
Password, etc.) are needed to connect to the database from our frontend.