Databases
Harblet runs PostgreSQL and MySQL databases next to your services. Only services in the same project can connect to them.
| Type | Versions |
|---|---|
| PostgreSQL | 18 |
| MySQL | 9.7, 8.4 |
Create a database
Open the project
Open a project and click New service → Database.
Fill in the form
postgres or root. Up to 32 lowercase letters, digits and underscores, starting with a letter. PostgreSQL usernames can't start with pg_. Can't be changed later.app. Up to 63 characters, the same ones as the username. Names the database reserves, such as template1 or mysql, aren't allowed. Can't be changed later.Create it
Click Create database. Harblet generates a password and starts the database right away.
Connect to it
The database's Overview tab shows its connection details under Connection:
| Field | Example |
|---|---|
| Host | postgresql-x7k2 |
| Port | 5432 for PostgreSQL, 3306 for MySQL |
| Database | app |
| Username | postgres |
| Password | Generated, hidden until you click the eye button |
| Connection URL | postgresql://postgres:<password>@postgresql-x7k2:5432/app |
Copy the Connection URL into an environment variable of the service that uses it, such as DATABASE_URL, and deploy that service.
- Only services in the same project can connect. Other projects and the internet can't reach the database.
- The host never changes, also when you rename the database.
- Every member of your Harblet can see the password.
root, Harblet sets a random root password that it doesn't show. Use the username from the connection details.Where the data lives
A database stores its data on the disk of the server it runs on. It stays on that server: if the server fails, the database waits for it to come back, while other services move to another server.
Set up backups so you don't lose data when a disk fails.
Update to a new patch release
Click Deploy on the database. Harblet restarts the database briefly and pulls the newest patch release of its version, for example the newest PostgreSQL 18.x.
If the new release fails to start, Harblet automatically deploys the version that ran before. The deployment list shows it as Rollback.
What you can change
Under Settings, you can rename the database. Its version, username, database name and password stay as they were created.
Databases have no environment variables, domains or deploy hooks.
Delete a database
Open the database's Settings tab and click Delete service. Harblet deletes the database with all its data.