# Quickstart

Create a free PostgreSQL database on KeelDB, connect with psql and create your first table in a few minutes.

KeelDB runs managed PostgreSQL 18, 17 and 16. This guide takes you from sign-up to your first query on the Free plan, which needs no payment method.

## Before you start

You need `psql` from PostgreSQL 14 or newer. Older clients don't send the TLS server name (SNI) that KeelDB uses to route connections. If you are stuck on an older client, see [Clients without SNI](/docs/connect#clients-without-sni).

```bash
psql --version
```

## 1. Create an account

Sign up at [keeldb.com/signup](https://keeldb.com/signup) and confirm your email address with the link we send you (it is valid for 24 hours). Passwords need at least 10 characters.

KeelDB creates a personal organization for you. Databases, API keys, billing and team members all belong to an organization, and you can create more organizations later.

## 2. Create a database

In the console, choose **New database** and fill in:

| Field | What to pick |
| --- | --- |
| Name | Anything from 2 to 48 characters, for example `shop`. The PostgreSQL database name is derived from it. |
| Plan | **Free**: autoscaling from 0.25 to 2 CU (1 CU is 1 vCPU and 4 GB of RAM), 1 GB of storage, 100 CU-hours a month per database. Each organization can have ten Free databases, with 300 CU-hours a month in all. |
| Region | One of six regions on AWS: US East (`us-east-1`, Northern Virginia), US West (`us-west-2`, Oregon), Europe (`eu-central-1`, Frankfurt), UK (`eu-west-2`, London), Asia (`ap-southeast-1`, Singapore) and Middle East (`me-central-1`, UAE). The console offers the regions you can create a database in. |
| PostgreSQL version | 18 (default), 17 or 16. |

Select **Create database**. The status moves from `provisioning` to `ready` in about a minute. If our shared servers are full at that moment, the database waits in line: the console shows "In line for a database", and the API returns `waiting_line` with the time it joined. It is created by itself as soon as there is room, with the hostname and credentials it already has, Launch databases first and then Free ones, oldest first. Nothing is billed while it waits, and you can delete it at any time.

Prefer the API? The same database from the command line, with an [API key](/docs/api#authentication):

```bash
curl -X POST https://keeldb.com/api/v1/databases \
  -H "Authorization: Bearer $KEELDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "shop", "plan": "free"}'
```

## 3. Copy the connection string

Open the database. The **Overview** page shows the connection panel:

1. Turn **Pooled connection** off for an interactive `psql` session. Pooled connections are best for application traffic; see [Connecting](/docs/connect#choose-a-host).
2. Select **Copy**. It copies the string with its password in it; **Show password** is only for reading it on screen.

The string looks like this (the database id `k7m2x9qa4pz1` identifies your database):

```bash
postgresql://shop_owner:<password>@k7m2x9qa4pz1.us-east.db.keeldb.com:5432/shop?sslmode=require&connect_timeout=10
```

| Part | Value |
| --- | --- |
| User | `<database>_owner`, the role that owns your database |
| Host | `<id>.us-east.db.keeldb.com` for direct connections; the middle part names the region |
| Port | `5432` |
| Database | Derived from the name you chose (`shop`) |
| `sslmode=require` | TLS is mandatory on every connection |
| `connect_timeout=10` | Lets your client move on quickly to another of our proxies if one is unreachable |

Showing the password requires the owner, admin or developer role, and each reveal is recorded in the database's audit log.

## 4. Connect with psql

```bash
psql "postgresql://shop_owner:<password>@k7m2x9qa4pz1.us-east.db.keeldb.com:5432/shop?sslmode=require"
```

Free databases shrink to a small warm size after 5 minutes without connections and sleep after 60 more. If yours is asleep, the first connection wakes it and waits until it is ready, up to 90 seconds. See [Waking a sleeping database](/docs/connect#waking-a-sleeping-database).

## 5. Create your first table

```sql
CREATE TABLE todos (
  id         bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  title      text NOT NULL,
  done       boolean NOT NULL DEFAULT false,
  created_at timestamptz NOT NULL DEFAULT now()
);

INSERT INTO todos (title) VALUES ('Read the KeelDB docs'), ('Ship the app');

SELECT id, title, done FROM todos ORDER BY id;
```

You can run the same statements from the **SQL** tab in the console, which also has a schema browser.

## Next steps

- [Connecting](/docs/connect): pooled, direct and read-only hosts, and examples for Node.js, Prisma, Drizzle, Python, Go, Rails and Django.
- [Plans and billing](/docs/plans-and-billing): Free, Launch and Scale (pay for what you use, from $5 a month) and Dedicated (your own servers, billed per hour with each node capped at its monthly price, storage and egress on top).
- [Branching](/docs/branching): copy a database instantly for previews and tests, with branches that delete themselves.
- [Backups and restore](/docs/backups-and-restore): point-in-time restore on every plan, within its restore window.
- [Scaling](/docs/scaling): autoscaling, scale to zero and high availability across data centers.
- [Extensions](/docs/extensions): pgvector, PostGIS and the other extensions you can use.
- [REST API](/docs/api) and [MCP server](/docs/mcp): manage databases from scripts, CI and AI assistants.
