> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sabaothcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI quickstart

> Sign in, create a PostgreSQL service, follow its logs and back it up from the terminal

This walkthrough goes from a fresh install to a running service with a backup. It takes about five minutes, most of which is waiting for the service to provision.

> [!NOTE]
>
> You need a SabaothCloud account with a plan that has room for another service. See [Plans and pricing](https://docs.sabaothcloud.com/guides/pricing-plans.md).

**1. Install the CLI**

```bash theme={null}
npm install --global @sabaoth-cloud/cli
sabaoth --version
```

You need Node.js 22.12 or later. See [Install the CLI](https://docs.sabaothcloud.com/cli/installation.md).

**2. Create an API key**

In the dashboard, open **API Keys**, click **Create API Key** and copy the key. It starts with `mpg_` and is shown only once. See [API keys](https://docs.sabaothcloud.com/dashboard/api-keys.md).

**3. Log in**

```bash theme={null}
sabaoth login
```

Paste the key at the hidden prompt. The CLI checks it, saves it in your OS keychain and selects its organization:

```text theme={null}
Sabaoth API key:
Logged in to Acme (org_abc).
```

**4. Create a service**

Choose a name and the resources to give it. CPU is in millicores (`500` is half a vCPU), memory in MiB and storage in GiB.

```bash theme={null}
sabaoth postgres create \
  --name orders-db \
  --cpu-millicores 500 \
  --memory-mb 1024 \
  --storage-gb 10
```

The CLI shows exactly what it will create and asks you to confirm, because a service is billable:

```text theme={null}
Create a PostgreSQL service in Acme (org_abc):
  Name:      orders-db
  CPU:       500m
  Memory:    1024Mi
  Storage:   10Gi

Anything not listed uses the server default. This provisions billable resources.
Continue? [y/N] y
Created orders-db (clu_abc), currently provisioning.
Provisioning continues in the background; check with `sabaoth postgres get clu_abc`.
```

Note the service ID (`clu_abc` here). You'll use it in the next steps.

**5. Wait until it is ready**

```bash theme={null}
sabaoth postgres get clu_abc
```

Run it again until `Status` shows `ready`. Provisioning usually takes a couple of minutes. To list every service instead, run `sabaoth postgres list`.

**6. Get the connection details**

Once the service is ready, `sabaoth postgres get` shows its host, port, database and username:

```text theme={null}
Connection:
  Host:      orders-db.example.sabaothcloud.com
  Port:      5432
  Database:  app
  Username:  app_owner
```

The CLI never shows passwords. Create a database user and get its password in the dashboard; see [Database users](https://docs.sabaothcloud.com/dashboard/database-users.md). To connect from outside SabaothCloud, see [Networking](https://docs.sabaothcloud.com/dashboard/networking.md).

**7. Follow the logs**

```bash theme={null}
sabaoth postgres logs clu_abc --follow
```

Log events stream in as they happen. Press **Ctrl-C** to stop. See [`sabaoth postgres logs`](https://docs.sabaothcloud.com/cli/commands/postgres-logs) for filtering by severity and replaying history.

**8. Take a backup**

```bash theme={null}
sabaoth backup create clu_abc --name first-backup
```

Confirm with `y`. The backup is queued, then runs in the background. Check on it with:

```bash theme={null}
sabaoth backup list clu_abc
```

## Clean up

If you created the service just to try things out, delete it so it stops costing money:

```bash theme={null}
sabaoth postgres delete clu_abc
```

You'll be asked to type the service ID back to confirm. Deletion is permanent.

## Next steps

> [card] [Scripting and CI](https://docs.sabaothcloud.com/cli/scripting.md)
>
> Use `--json`, exit codes and `SABAOTH_API_KEY` in pipelines.

> [card] [Command reference](https://docs.sabaothcloud.com/cli/commands/postgres-create.md)
>
> Every flag for every command.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.