Users and Attaching
Create databases and logins (Redis too), rotate passwords and wire a database into an app.
Manage databases and logins on PostgreSQL, MySQL, MariaDB and Redis instances from the dashboard, and hand an application its own credentials in one step.
Databases
Create a database with an optional owner, or drop one. Names are lowercase letters, digits and underscores, starting with a letter or underscore, up to 63 characters.
Users
Create a login with one of three access levels on a database:
VPSPilot generates the password and stores it encrypted. Rotate sets a new random password on the database and updates the stored copy, and any app it is attached to picks up the new value on its next deploy.
Redis logins
The Logins tab of a Redis instance creates logins with Redis ACLs: read-only or read-write, optionally limited to a key pattern such as cache:*. Dangerous commands (FLUSHALL, CONFIG, KEYS and similar) are never allowed. Only a hash of the password is written to Redis.
On managed instances, logins are saved in the instance's configuration and survive restarts. On an external Redis they last until it restarts, unless its own configuration saves ACLs. Needs agent 1.1.0 or later.
Attach to an application
Attaching wires a database into an app without copying credentials around by hand:
- PostgreSQL, MySQL and MariaDB: VPSPilot creates a database and a login dedicated to the app.
- Redis: VPSPilot creates a read-write login for the app (agent 1.1.0 or later; older agents use the admin password).
- The connection URL is added to the app’s environment as a secret, under
DATABASE_URLor a name you choose.
POST /api/v1/databases/{instance_id}/attach{ "application_id": "9ab2…", "env_key": "DATABASE_URL" }Rules
- A managed database can only be attached to apps on its own server, since it is only reachable there.
- The app must not already have a variable with that name.
- Redeploy the app to start using the new variable. See Environment Variables.