# Self-host LibreDB Studio

> A browser based SQL and NoSQL client for PostgreSQL, MySQL, MongoDB, Redis and more, with a query editor, schema explorer and saved connections. MIT licensed. The admin password and session secret are generated for you and shown in the deployment variables.

- Page: https://levelrail.com/templates/libredb-studio/
- JSON: https://levelrail.com/templates/libredb-studio.json
- Category: Databases
- Licence: MIT (Permissive license)
- Source: https://github.com/libredb/libredb-studio
- Upstream docs: https://github.com/libredb/libredb-studio

## Requirements
- Memory: about 512 MiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: 1.3.0

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| libredb-studio | ghcr.io/libredb/libredb-studio | 1.3.0 | 3000 | data -> /app/data |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| libredb-studio | ADMIN_EMAIL | preset |
| libredb-studio | ADMIN_PASSWORD | generated |
| libredb-studio | HOSTNAME | preset |
| libredb-studio | JWT_SECRET | generated |
| libredb-studio | NEXT_PUBLIC_AUTH_PROVIDER | preset |
| libredb-studio | PORT | preset |
| libredb-studio | STORAGE_PROVIDER | preset |
| libredb-studio | STORAGE_SQLITE_PATH | preset |

## Deploy

### CLI

```bash
levelrail-cli templates install libredb-studio --name my-libredb-studio
```

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain libredb-studio=app.example.com.

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/libredb-studio/install \
  -d '{
    "name": "my-libredb-studio"
  }'
```

Create a token in the dashboard first. Name, env and domains are the request fields.

## First run
1. Sign in with the admin email and the generated password, then add a database connection from the sidebar.

## Questions

### Can I deploy LibreDB Studio 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 LibreDB Studio, 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/libredb/libredb-studio:1.3.0 is what you deploy there.

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