Kimai logo

Kimai

Open-source time-tracking application for freelancers and teams

Alternative to: toggl, clockify, harvest


Kimai is a professional, open-source time-tracking application for freelancers, teams, and organizations. It lets you track work time, manage projects and customers, generate reports, and create invoices, with multi-user support, granular permissions, and a plugin system for extending functionality.

Kimai Docker Compose example

Self-host Kimai on your own server, homelab, or VPS starting from this Docker Compose example. It runs Kimai in Docker containers using the official kimai/kimai2:apache, mysql:8 images, with persistent volumes and automatic restarts preconfigured. Review the environment variables and adjust them to your setup, save the file as compose.yml (or docker-compose.yml), and start the stack with docker compose up -d.

services:
  kimai:
    image: kimai/kimai2:apache
    depends_on:
      sqldb:
        condition: service_healthy
    volumes:
      - data:/opt/kimai/var
    restart: unless-stopped
    environment:
      # Email address of the initial administrator account, created on first start.
      ADMINMAIL: "admin@kimai.local"
      # Password for the initial administrator account. Change before exposing Kimai.
      ADMINPASS: "changeme"
      # Doctrine database connection string. Host and credentials must match the sqldb
      # service below; serverVersion pins the dialect for the bundled MySQL 8 image.
      DATABASE_URL: "mysql://kimai:kimai@sqldb:3306/kimai?charset=utf8mb4&serverVersion=8.0"
      # Comma-separated hostnames Kimai answers to. Set this to your public domain
      # (use a leading dot, e.g. ".example.com", to allow all subdomains).
      TRUSTED_HOSTS: "localhost,127.0.0.1"

  sqldb:
    image: mysql:8
    volumes:
      - db_data:/var/lib/mysql
    command: --default-storage-engine innodb
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: "kimai"
      MYSQL_USER: "kimai"
      # Password for the Kimai database user (only reachable inside the compose network).
      MYSQL_PASSWORD: "kimai"
      # Root password for MySQL (only reachable inside the compose network).
      MYSQL_ROOT_PASSWORD: "changeme-root"
    healthcheck:
      test: mysqladmin -p$$MYSQL_ROOT_PASSWORD ping -h localhost
      interval: 20s
      start_period: 30s
      timeout: 10s
      retries: 5

volumes:
  data:
  db_data:

Values set to changeme are required — replace them with your own values before starting Kimai.

Prefer a managed setup? WinterFlow installs, configures, and updates Kimai for you using this same Docker Compose configuration.