---
title: "Deploy libSQL Server"
description: "SQLite-compatible database server with token auth and a persistent volume"
category: "Storage"
url: https://railway.com/deploy/libsql-server
---

# Deploy libSQL Server

SQLite-compatible database server with token auth and a persistent volume

**[Deploy libSQL Server on Railway](https://railway.com/template/libsql-server)**

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

- **Creator:** Agaz Self-Host
- **Category:** Storage

## Template content

### libSQL https://cdn.jsdelivr.net/gh/libsql/libsql.github.io@3e0af61e03085fb7159a8d1f0a449d0feecdeac9/images/favicon/android-chrome-512x512.png

- **Source:** https://github.com/aalfath/libsql-server-railway-template
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host libSQL Server on Railway

libSQL Server (`sqld`) is the server mode of libSQL, Turso's open-source, open-contribution fork of SQLite. It puts a SQLite-compatible database behind an HTTP and WebSocket API, so apps anywhere can query it with libSQL clients for TypeScript, Python, Rust or Go, or sync local embedded replicas from it.

## About Hosting libSQL Server

This template runs the official libSQL Server v0.24.33 image, pinned by version and digest, built from a public GitHub repo. The database sits on a Railway volume at `/var/lib/sqld`, so it survives redeploys and restarts. Authentication is on from the first deploy: the template generates `SQLD_AUTH_TOKEN`, and the server rejects any query without it (it refuses to start with no auth at all). A public HTTPS domain and a `/health` check are set up for you. After deploying, copy `LIBSQL_URL` and `SQLD_AUTH_TOKEN` from the service's Variables tab into your app. Updates arrive as Railway "update available" notices when we bump the pinned version.

## Common Use Cases

* A hosted SQLite-compatible database for web apps, APIs and serverless functions, using `@libsql/client` or another libSQL SDK
* A sync source for embedded replicas, so apps read from a local SQLite file and write through to the server
* A self-hosted alternative to a managed Turso database for side projects, prototypes and internal tools

## Dependencies for libSQL Server Hosting

* A Railway volume for the database files (included)
* A libSQL client in your app, with the URL and token from the service's variables

### Deployment Dependencies

* libSQL repository and docs: https://github.com/tursodatabase/libsql
* Docker image reference: https://github.com/tursodatabase/libsql/blob/libsql-server-v0.24.33/docs/DOCKER.md
* Release used: https://github.com/tursodatabase/libsql/releases/tag/libsql-server-v0.24.33
* Template repo: https://github.com/aalfath/libsql-server-railway-template

### Implementation Details

Connect from your app:

```js
import { createClient } from "@libsql/client";
const db = createClient({ url: process.env.LIBSQL_URL, authToken: process.env.SQLD_AUTH_TOKEN });
await db.execute("SELECT 1");
```

From another service in the same project, use `${{libSQL.LIBSQL_PRIVATE_URL}}` and `${{libSQL.SQLD_AUTH_TOKEN}}` to stay on the private network. To rotate the token, change `SQLD_AUTH_TOKEN` and redeploy. For JWT authentication instead, add `SQLD_AUTH_JWT_KEY` (an Ed25519 public key). Download a SQL backup with `curl -H "Authorization: Bearer YOUR-TOKEN" https://YOUR-DOMAIN/dump`.

## 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.



## 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.
- [Neo4j 2026.10 Community](https://railway.com/deploy/neo4j-202610-community) — Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

Open this page in a browser: https://railway.com/deploy/libsql-server
