# Self-host QuestDB

> A fast time series database with SQL, a web console, the PostgreSQL wire protocol on 8812 and InfluxDB line protocol ingestion on 9009. The console and the PostgreSQL port share one generated password. Only the console is offered a domain.

- Page: https://levelrail.com/templates/questdb/
- JSON: https://levelrail.com/templates/questdb.json
- Category: Database Tools
- Licence: Apache-2.0 (Permissive license)
- Source: https://github.com/questdb/questdb
- Upstream docs: https://questdb.com/docs/

## Requirements
- Memory: about 1 GiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 10.1.0

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| questdb | questdb/questdb | 10.1.0 | 9000, 8812, 9009 | questdb_data -> /var/lib/questdb |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| questdb | QDB_HTTP_PASSWORD | generated |
| questdb | QDB_HTTP_USER | preset |
| questdb | QDB_PG_PASSWORD | generated |
| questdb | QDB_PG_USER | preset |
| questdb | QDB_TELEMETRY_ENABLED | preset |

## Deploy

### CLI

```bash
levelrail-cli templates install questdb --name my-questdb
```

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain questdb=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/questdb/install \
  -d '{
    "name": "my-questdb"
  }'
```

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

## First run
1. Open the console. Queries ask for the user below and the generated password from the app secrets.

## Questions

### Can I deploy QuestDB 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 QuestDB, 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 questdb/questdb:10.1.0 is what you deploy there.

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