libSQL
Deploy a libSQL (sqld) database with primary and replica nodes, namespaces, external ports and S3 backups.
libSQL is an open-source SQLite fork that runs as a server (sqld), so applications reach it over HTTP instead of opening a file.
Create the database
In a project environment, click New, choose Database and select libSQL. Besides name and description:
| Field | What it does | Default |
|---|---|---|
| Sqld node | primary or replica. | primary |
| Sqld primary URL | URL of the primary to replicate from. Required for replicas only. | None |
| Enable namespaces | Starts sqld with --enable-namespaces: one server hosts several isolated databases. | Off |
| Database user | User for HTTP basic auth. | libsql |
| Database password | Password for HTTP basic auth. | Generated |
| Docker image | Image to run. | ghcr.io/tursodatabase/libsql-server:v0.24.32 |
wtree Cloud creates a named volume <app-name>-data at /var/lib/sqld, so data survives redeploys.
Ports and credentials
| Port | Purpose |
|---|---|
8080 | HTTP API. Applications connect here. |
5001 | gRPC. Replicas replicate from a primary over it. |
5000 | Admin API. |
The Overview tab shows:
- Internal credentials: user, password, node type, host and the Internal connection URL
http://<user>:<password>@<app-name>:8080. Primaries also show an Internal replication connection URL on port5001. - External credentials: set External port (internet) to publish the HTTP API. After saving, you can also publish External admin port (internet) and, on primaries, External GRPC port (internet).
Replicas can't publish an external gRPC port. Only primaries accept replication connections.
Add a replica
On the primary, copy the Internal replication connection URL. If the replica runs on another server, publish External GRPC port (internet) on the primary and use the external gRPC URL.
Create a second libSQL service with Sqld node set to replica and paste the URL into Sqld primary URL.
Backups
libSQL has the same Backups tab as other SQL databases: scheduled S3 backups, retention, manual runs and restore. See Database backups.
Logs, Metrics and Settings work as for every database. See Databases.
