Databases

Run PostgreSQL or another database on a VPS

Keep control of the database version, configuration, storage, access, and backup process on your own server.

Last updated:

A database on a VPS gives you control of the version, extensions, configuration, and maintenance schedule. It can run beside a small application or on a separate server with its own memory and storage.

When self-hosting fits

This works for teams that can operate PostgreSQL or another Linux database and want direct access to its configuration and data. A managed database is usually a better fit when you need provider-managed upgrades, automatic failover, or do not want to maintain an on-call database team.

Keep the database off the public internet whenever possible. An application on the same VPS can connect over loopback. Separate servers should use a restricted network path and firewall rules limited to the application hosts.

Choosing a server size

Database memory, active data, indexes, write volume, and retention matter more than a simple visitor count. Medium is the smallest plan linked to this use case. Large and XL add memory and CPU, while storage limits still need to be checked separately. Compare the VPS plans with your memory and storage requirements.

Leave disk space for write-ahead logs, temporary files, maintenance, and backup staging. Monitor actual growth before the volume becomes full.

What you manage

You are responsible for users, updates, performance, monitoring, backups, restore tests, replication, and failover design. Platform backups are an extra safeguard, not a replacement for database-aware backups.

The PostgreSQL on a VPS guide covers a complete Ubuntu 26.04 installation and a tested pg_dump and pg_restore workflow.