# Self-host InfluxDB

> An open-source time-series database for metrics, events, and IoT analytics.

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

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

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| influxdb | influxdb | 2.7-alpine | 8086 | influxdb_data -> /var/lib/influxdb2; influxdb_config -> /etc/influxdb2 |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| influxdb | INFLUXDB_INIT_ADMIN_TOKEN | generated |
| influxdb | INFLUXDB_INIT_BUCKET | preset |
| influxdb | INFLUXDB_INIT_MODE | preset |
| influxdb | INFLUXDB_INIT_ORG | preset |
| influxdb | INFLUXDB_INIT_PASSWORD | generated |
| influxdb | INFLUXDB_INIT_USERNAME | generated |

## Deploy

### CLI

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

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/influxdb/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy InfluxDB on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id influxdb for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image influxdb:2.7-alpine is what you deploy there.

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