# Self-host Kimai

> A self-hosted time tracking tool for freelancers and teams, with invoicing and reporting.

- Page: https://levelrail.com/templates/kimai/
- JSON: https://levelrail.com/templates/kimai.json
- Category: Productivity
- Licence: AGPL-3.0-or-later (Network copyleft (AGPL) license)
- Source: https://github.com/kimai/kimai
- Upstream docs: https://www.kimai.org/documentation/

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

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| db | mysql | 8 | none | kimai_db_data -> /var/lib/mysql |
| kimai | kimai/kimai2 | apache | 8001 | kimai_data -> /opt/kimai/var |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| db | MYSQL_DATABASE | preset |
| db | MYSQL_PASSWORD | generated |
| db | MYSQL_ROOT_PASSWORD | generated |
| db | MYSQL_USER | preset |
| kimai | ADMINMAIL | preset |
| kimai | ADMINPASS | generated |
| kimai | DATABASE_URL | generated |

## Deploy

### CLI

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

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/kimai/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 Kimai 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 kimai for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image mysql:8, kimai/kimai2:apache is what you deploy there.

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