# Self-host libSQL Server

> Server for libSQL, the open contribution fork of SQLite, speaking the Hrana protocol over HTTP. Runs as a single primary node with data on a volume.

- Page: https://levelrail.com/templates/libsql/
- JSON: https://levelrail.com/templates/libsql.json
- Category: Database Tools
- Licence: MIT (Permissive license)
- Source: https://github.com/tursodatabase/libsql
- Upstream docs: https://github.com/tursodatabase/libsql/tree/main/libsql-server

## Requirements
- Memory: about 128 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: v0.24.32

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| libsql | ghcr.io/tursodatabase/libsql-server | v0.24.32 | 8080 | data -> /var/lib/sqld |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| libsql | SQLD_HTTP_LISTEN_ADDR | preset |
| libsql | SQLD_NODE | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy libsql --name my-libsql
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/libsql/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## First run
1. Connect a libSQL client to this address. The server has no login, so keep it private or put an auth layer in front.

## Questions

### Can I deploy libSQL Server on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for libSQL Server, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image ghcr.io/tursodatabase/libsql-server:v0.24.32 is what you deploy there.

Self-host libSQL Server, libSQL Server docker compose file, deploy libSQL Server on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
