PostgreSQL
Hostim.dev offers managed PostgreSQL databases that you can add to any project. These databases are ready to use, secure by default, and require no manual setup.
Free tier
A free PostgreSQL plan is available with limited resources, great for development or small side projects.
Shared vs dedicated PostgreSQL
You can choose between two options:
- Shared PostgreSQL: Fast and affordable. Multiple users share the same server, but each database is isolated.
- Dedicated PostgreSQL: Your own isolated PostgreSQL server. Better for performance, reliability, and security.
Choose shared for testing, staging, or small apps. Choose dedicated for production.
How to add a PostgreSQL database
- Open your project in the dashboard
- Click Create Service -> New PostgreSQL
- Give your database a name
- Choose a plan (shared or dedicated and size)
- Click Create PostgreSQL
Hostim will provision the database and provide connection details.
Connection details
After creation, you'll see:
- Hostname
- Port
- Database
- Username and password
You can connect from any app in the same project using internal networking. Just use the credentials from the dashboard. External access is possible via Bastion SSH container.
Just like MySQL, PostgreSQL databases expose environment variables named after
the service. If you create a database called blog
, you can use
BLOG_POSTGRESQL_HOST
, BLOG_POSTGRESQL_PORT
,
BLOG_POSTGRESQL_DATABASE
, BLOG_POSTGRESQL_USER
and
BLOG_POSTGRESQL_PASSWORD
in your app configuration. Refer to them with
the $(VAR_NAME)
syntax when defining other environment variables.
Managing PostgreSQL
You can:
- Scale database plan up or down
- Remove the database when no longer needed
Accessing PostgreSQL via SSH
You can also connect to your database using the Bastion container. This is useful for importing or exporting data using tools like psql
or pg_dump
.
More advanced features like metrics, slow query logs, automatic backups, external access and read replicas may be added in future versions.