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

# Database Setup

> Configure SQLite, PostgreSQL, or MySQL

TinyCloud stores metadata and related state in a relational database. The node accepts SQLite, PostgreSQL, and MySQL connection strings.

## Supported backends

| Backend    | Example                                 |
| ---------- | --------------------------------------- |
| SQLite     | `sqlite:./data/caps.db`                 |
| PostgreSQL | `postgres://user:pass@host:5432/dbname` |
| MySQL      | `mysql://user:pass@host:3306/dbname`    |

## SQLite

SQLite is the default. It is the simplest option for development and single-node deployments.

```toml theme={null}
[storage]
database = "sqlite:./data/caps.db"
```

```bash theme={null}
TINYCLOUD_STORAGE__DATABASE="sqlite:./data/caps.db"
```

## PostgreSQL

Use PostgreSQL for production deployments that need concurrency and operational tooling.

```toml theme={null}
[storage]
database = "postgres://tinycloud:password@localhost:5432/tinycloud"
```

```bash theme={null}
TINYCLOUD_STORAGE__DATABASE="postgres://tinycloud:password@localhost:5432/tinycloud"
```

## MySQL

MySQL is also supported if your infrastructure already uses it.

## Migrations

The node applies database migrations automatically on startup. There is no separate migration command.

## Practical guidance

* Use SQLite for a quick local node
* Use PostgreSQL for most production deployments
* Make sure the database is reachable before starting the node

<Warning>
  If startup fails after a database change, check the node logs and confirm the connection string in `tinycloud.toml` or `TINYCLOUD_STORAGE__DATABASE`.
</Warning>
