Skip to content

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:

EngineTierDescription
PostgreSQLStandardShared infrastructure, automatic backups
PostgreSQLEnterpriseDedicated node, encryption at rest
MariaDBStandardShared infrastructure, automatic backups
MariaDBEnterpriseDedicated node, encryption at rest

Step 2 — Create the database

Dashboard

  1. Open ServicesData & StorageDatabases in the dashboard
  2. Click Create
  3. Select the database type (PostgreSQL or MariaDB)
  4. Choose a tier (standard or enterprise)
  5. Enter a name and optional description
  6. 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_db

From 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

API reference

WAYSCloud AS