Databases and volumes
Run managed PostgreSQL or MySQL, connect it to your apps, and keep files on persistent volumes.
Managed databases
Nanpod runs PostgreSQL 17 and MySQL 8.4 on all tiers (including Free, within your tier's resource and storage limits). Add one from the template gallery's Databases group. Pick its name, login, storage size and resource ceiling.
- A database runs exactly one instance and is always on. It never sleeps, so its actual consumed CPU and memory are metered while it runs, plus its provisioned volume storage.
- It is private: only services in the same project and environment can reach it. Nothing outside Nanpod can connect.
- It is provisioned as soon as you save it. There is no Deploy button; it is Ready when the engine accepts connections.
Connect a database to a service
In a service's Settings, choose Connect database. Each connected service gets its own database and user with a generated password, and these variables:
| Engine | Variables |
|---|---|
| PostgreSQL | DATABASE_URL, PGHOST, PGPORT, PGDATABASE, PGUSER, PGPASSWORD |
| MySQL | DATABASE_URL, MYSQL_HOST, MYSQL_PORT, MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD |
DATABASE_URL and the password are sealed. The variables are managed by Nanpod and can't be edited. Deploy the service to use them.
Persistent volumes
A container's files are lost on every restart and deploy. Attach a volume to keep files such as uploads or a SQLite database.
- One volume per service, mounted at an absolute path you choose.
- 1 to 20 GiB per volume, in whole GiB. Volumes can grow but never shrink. Total workspace storage depends on your active tier: 1 GiB on Free, 20 GiB on Starter, and 50 GiB on Pro.
- A service with a volume runs at most one instance. Deploys stop the running version before starting the new one, so two versions never write to the volume at the same time.
- The mount path can't be
/or a system folder such as/etc,/usror/proc.
Backups and restore
Volumes, including database storage, are backed up every night and backups are kept for 7 days. You can restore a backup from the volume page. Nanpod takes a fresh backup first, so a restore can be undone.