# Self-host DbGate

> A web database client for SQL and NoSQL databases with a generated login and a data volume. Sign in as admin with the generated password, then add connections to other services here.

- Page: https://levelrail.com/templates/dbgate/
- JSON: https://levelrail.com/templates/dbgate.json
- Category: Database Tools
- Licence: GPL-3.0-only (Copyleft license)
- Source: https://github.com/dbgate/dbgate
- Upstream docs: https://docs.dbgate.io/

## Requirements
- Memory: about 256 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 7.3.4-alpine

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| dbgate | dbgate/dbgate | 7.3.4-alpine | 3000 | dbgate_data -> /root/.dbgate |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| dbgate | LOGIN | preset |
| dbgate | PASSWORD | generated |

## Deploy

### CLI

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

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/dbgate/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. Sign in as admin with the generated password from the app secrets, then add a connection to a database in this project.

## Questions

### Can I deploy DbGate 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 DbGate, 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 dbgate/dbgate:7.3.4-alpine is what you deploy there.

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