---
title: "Deploy libSQL Server | (Just Updated) Turso SQLite Database, Auth Token Generated"
description: "SQLite-compatible Turso database server, auth token generated"
category: "Storage"
url: https://railway.com/deploy/libsql-server-or-just-updated-turso-sqli
---

# Deploy libSQL Server | (Just Updated) Turso SQLite Database, Auth Token Generated

SQLite-compatible Turso database server, auth token generated

**[Deploy libSQL Server | (Just Updated) Turso SQLite Database, Auth Token Generated on Railway](https://railway.com/template/libsql-server-or-just-updated-turso-sqli)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/libsql-server-or-just-updated-turso-sqli/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Storage

## Template content

### libsql

- **Image:** ghcr.io/tursodatabase/libsql-server@sha256:6dd3eb276d9d3604e4a48ac4a999a2e267814732d57d7e94c04ba71482333a67
- **Start command:** `/bin/sh -c 'export SQLD_DB_PATH=/var/lib/sqld/data SQLD_NODE=standalone SQLD_HTTP_LISTEN_ADDR="[::]:$PORT" SQLD_HTTP_AUTH="basic:$(printf "admin:%s" "$LIBSQL_AUTH_TOKEN" | base64 -w0)"; echo "libsql uid=$(id -u) data=$SQLD_DB_PATH"; exec /usr/local/bin/docker-wrapper.sh /bin/sqld'`
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host libSQL Server on Railway

libSQL Server (`sqld`) is Turso's open-source, SQLite-compatible database server. It speaks the Hrana protocol over HTTP, so any libSQL or Turso client can read and write a SQLite database over the network. This template runs it with a persistent volume, a generated auth token, and a public HTTPS endpoint.

## About Hosting libSQL Server

This template runs `ghcr.io/tursodatabase/libsql-server` (pinned by digest) in standalone mode. The database files live on a volume mounted at `/var/lib/sqld`, so data survives redeploys. HTTP basic auth is enabled at boot: the username is `admin` and the password is the `LIBSQL_AUTH_TOKEN` variable, generated for you at deploy time. `/health` stays open for Railway's healthcheck; every other route requires the token.

Agent contract:

- Base URL: `https://`
- Username: `admin`
- Password variable: `LIBSQL_AUTH_TOKEN`
- Health path: `/health`
- SQL endpoint: `POST /v2/pipeline` (Hrana over HTTP)

```bash
curl -s -u admin:$LIBSQL_AUTH_TOKEN -X POST https:///v2/pipeline \
  -H 'content-type: application/json' \
  -d '{"requests":[{"type":"execute","stmt":{"sql":"create table if not exists t(a)"}},{"type":"execute","stmt":{"sql":"insert into t values (1)"}},{"type":"execute","stmt":{"sql":"select a from t"}}]}'
```

## Why Deploy libSQL Server on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying libSQL Server on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

- **SQLite semantics, network access** — keep the SQL you know and reach it over HTTPS.
- **Secure by default** — the token is generated per deploy and unauthenticated requests get 401.
- **Data survives redeploys** — the volume is preconfigured and verified with a write, redeploy, read.
- **No vendor lock-in** — standard libSQL clients work against your own domain.

## Common Use Cases

- **Agent and app memory** — a small, durable SQL store for AI agents and side projects.
- **Edge-style apps** — libSQL or Turso SDKs in serverless functions pointing at one server.
- **Dev and staging databases** — a cheap SQLite-compatible server that is not tied to a laptop file.

## Dependencies for libSQL Server Hosting

- A volume mounted at `/var/lib/sqld` (included in this template).

### Deployment Dependencies

- [tursodatabase/libsql](https://github.com/tursodatabase/libsql) — upstream server (MIT)
- [libsql-server image on GHCR](https://github.com/tursodatabase/libsql/pkgs/container/libsql-server) — the pinned image this template deploys


## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.

Open this page in a browser: https://railway.com/deploy/libsql-server-or-just-updated-turso-sqli
