---
title: "Deploy LibreDB Studio | (Just Updated) Web SQL Editor For PostgreSQL, MySQL And MongoDB, Admin Password Generated"
description: "LibreDB Studio web SQL editor for PostgreSQL, MySQL, SQLite, MongoDB"
category: "Other"
url: https://railway.com/deploy/libredb-studio-or-just-updated-web-sql-e
---

# Deploy LibreDB Studio | (Just Updated) Web SQL Editor For PostgreSQL, MySQL And MongoDB, Admin Password Generated

LibreDB Studio web SQL editor for PostgreSQL, MySQL, SQLite, MongoDB

**[Deploy LibreDB Studio | (Just Updated) Web SQL Editor For PostgreSQL, MySQL And MongoDB, Admin Password Generated on Railway](https://railway.com/template/libredb-studio-or-just-updated-web-sql-e)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/libredb-studio-or-just-updated-web-sql-e/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Other

## Template content

### libredb-studio

- **Image:** ghcr.io/bon5co/libredb-studio-railway:1.3.0@sha256:8132b5bb5e143fbedaa4c80dad6a9802412f90f233f7958c4d8d6f5215386ca0
- **Health check:** /api/health
- **Public domain:** Yes

## Documentation

# Deploy and Host LibreDB Studio on Railway

**Built for an LLM agent to deploy and use.** The deploy form has two generated fields and nothing to fill in: the administrator password and the session secret are generated, the administrator account is created at first boot, and saved connections, queries, history and accounts survive redeploys. LibreDB Studio is an open-source, self-hosted web SQL editor and database console: it connects to PostgreSQL, MySQL, SQLite, MongoDB, Redis, DuckDB and more, runs queries, browses schemas and keeps saved queries and history.

## About Hosting LibreDB Studio

This template runs one service, **libredb-studio**, on one public domain with a volume at `/app/data`. It is the upstream LibreDB Studio 1.3.0 image pinned by digest, started with server-side SQLite storage, so the account table, saved connections, saved queries, history and the built-in sample database all sit on the volume instead of in one browser's local storage.

**No default login and no sign-up race.** The administrator `admin@example.com` is created at boot from the generated `ADMIN_PASSWORD` (32 characters), and `JWT_SECRET` (48 characters) signs the sessions, so a redeploy does not sign everyone out. The healthcheck is `/api/health`, which answers 200 once the server is up.

**What the wrapper fixes for Railway.** Upstream's default storage mode keeps everything in the browser, so a fresh deploy looks empty on every device and an agent has nowhere durable to save a connection. The wrapper switches it to SQLite on the volume. Upstream already honours Railway's injected `PORT` and fixes the ownership of a root-owned volume at start.

**Using it.** Sign in at `https://YOUR_DOMAIN/` as `admin@example.com` with `ADMIN_PASSWORD`. A connection to the built-in "Sample (Employees)" SQLite database is already there to try queries on. Add your own PostgreSQL, MySQL, MongoDB or Redis connection from the connection screen; the service must be able to reach it, for example over Railway's private network with `postgres.railway.internal`.

### Agent contract

- Public URL: `https://RAILWAY_PUBLIC_DOMAIN` (the generated domain of the `libredb-studio` service)
- Private URL: `http://libredb-studio.railway.internal:8080`
- Credentials: the variable `ADMIN_PASSWORD` on the `libredb-studio` service, for the fixed email `admin@example.com` (the email is not a template variable)
- Auth: `POST /api/auth/login` with JSON `email` and `password` returns a session cookie, which the other routes take. A write with no session answers `401` and a login with the wrong password answers `401`.
- Health: `GET /api/health` returns 200

```bash
#!/bin/sh
# needs: RAILWAY_PUBLIC_DOMAIN, ADMIN_PASSWORD (variables of the libredb-studio service); also curl.
R="https://$RAILWAY_PUBLIC_DOMAIN"; J="Content-Type: application/json"
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/api/health")" = 200 ]; do n=$((n+1)); [ "$n" -le 60 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/api/health"
curl -s -c jar.txt -o /dev/null -w "login: %{http_code}\n" -X POST "$R/api/auth/login" -H "$J" -d "{\"email\":\"admin@example.com\",\"password\":\"$ADMIN_PASSWORD\"}"
curl -s -b jar.txt -o /dev/null -w "session: %{http_code}\n" "$R/api/auth/me"
curl -s -b jar.txt -o /dev/null -w "write with session: %{http_code}\n" -X PUT "$R/api/storage/saved_queries" -H "$J" -d '{"data":[{"id":"agent-1","name":"agent query","query":"SELECT 1"}]}'
curl -s -b jar.txt "$R/api/storage" | grep -c agent-1 | sed 's/^/saved query found after write: /'
curl -s -o /dev/null -w "write without key: %{http_code}\n" -X PUT "$R/api/storage/saved_queries" -H "$J" -d '{"data":[]}'
curl -s -o /dev/null -w "login with wrong credentials: %{http_code}\n" -X POST "$R/api/auth/login" -H "$J" -d "{\"email\":\"admin@example.com\",\"password\":\"x$ADMIN_PASSWORD\"}"
```

A fresh deploy prints `health: 200`, `login: 200`, `session: 200`, `write with session: 200`, `saved query found after write: 1`, `write without key: 401` and `login with wrong credentials: 401`.

## Why Deploy LibreDB Studio 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 LibreDB Studio 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.

- **Agent-ready** - two generated variables, a contract block and one script that proves health, sign-in, an authenticated write and read-back, and the refusal of a write with no session and of a wrong password.
- **No sign-up race and no default login** - the administrator is created at boot from a generated password.
- **Data survives redeploys** - accounts, saved connections, queries and history sit in SQLite on the volume.
- **Sessions survive redeploys** - the signing secret is generated once, not re-minted each boot.
- **Pinned** - the upstream image is pinned by digest and the wrapper by tag and digest.

## Common Use Cases

- **Web SQL console for your Railway databases** - query PostgreSQL, MySQL and Redis services over the private network without installing a desktop client.
- **Shared saved queries and history** - one place a team keeps queries, schema snapshots and charts.
- **Agent-driven data work** - give an agent a signed-in session to save connections and queries and read results back.
- **Read-only exploration** - browse schemas and run ad hoc queries against production replicas.

## Dependencies for LibreDB Studio Hosting

- The libredb-studio service with its volume, created by the template. A database to connect to is optional: the built-in sample database works on its own.

### Deployment Dependencies

- [LibreDB Studio repository](https://github.com/libredb/libredb-studio)
- [Wrapper image source](https://github.com/bon5co/libredb-studio-railway)


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/libredb-studio-or-just-updated-web-sql-e
