Create a Database
Provision a managed PostgreSQL or MariaDB database with automatic credential generation, Vault-secured secrets, and a ready-to-use connection string.
What you are building
A fully managed database instance with automated backups, secure credential storage, and a connection endpoint accessible from your applications.
When to use this approach
- You need a relational database without managing the server
- You want automatic credential management and backup
- You are running PostgreSQL or MariaDB workloads
If you need full control over the database server, install it on a VPS instead.
What you need
- A WAYSCloud account
- An API key with database permissions (for the API path)
Step 1 — Choose your database type and tier
WAYSCloud supports two database engines and two tiers:
| Engine | Tier | Description |
|---|---|---|
| PostgreSQL | Standard | Shared infrastructure, automatic backups |
| PostgreSQL | Enterprise | Dedicated node, encryption at rest |
| MariaDB | Standard | Shared infrastructure, automatic backups |
| MariaDB | Enterprise | Dedicated node, encryption at rest |
Step 2 — Create the database
Dashboard
- Open Services → Data & Storage → Databases in the dashboard
- Click Create
- Select the database type (PostgreSQL or MariaDB)
- Choose a tier (standard or enterprise)
- Enter a name and optional description
- Click Create
Credentials are generated automatically and displayed once.
API
bash
curl -X POST https://api.wayscloud.services/v1/databases \
-H "X-API-Key: $WAYSCLOUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"db_name": "prod_webapp_db",
"db_type": "postgresql",
"tier": "standard",
"description": "Production database for web application"
}'Response:
json
{
"db_name": "prod_webapp_db",
"db_type": "postgresql",
"username": "user_abc123",
"host": "db.no.wayscloud.services",
"port": 5432,
"connection_string": "postgresql://user_abc123:***@db.no.wayscloud.services:5432/prod_webapp_db"
}Important: The password is only shown once at creation. Store it securely.
Step 3 — Connect to your database
Use the connection string from the creation response:
PostgreSQL:
bash
psql "postgresql://user_abc123:yourpassword@db.no.wayscloud.services:5432/prod_webapp_db"MariaDB:
bash
mysql -h db.no.wayscloud.services -u user_abc123 -p prod_webapp_dbFrom application code (Python):
python
import psycopg2
conn = psycopg2.connect(
host="db.no.wayscloud.services",
port=5432,
dbname="prod_webapp_db",
user="user_abc123",
password="yourpassword"
)Step 4 — Next steps
- Add firewall rules — Restrict access to specific IP addresses from the dashboard
- Connect from a VPS — Your database is accessible from any WAYSCloud VPS. See Deploy a VPS.
- Store files alongside data — Use Object Storage for binary assets. See Store Files.
- Monitor usage — View connection counts and storage usage in the dashboard
Related services
- Managed Databases — full service documentation
- Object Storage — file and asset storage
- Virtual Private Servers — compute for your application
Related guides
- Authentication — API key setup
- Billing & Pricing — database pricing model
API reference
- Databases API — all database endpoints