---
title: "Deploy Kimai | Open Source Toggl & Harvest Alternative"
description: "Self Host Kimai, the #1 open-source time tracker - reports, invoices, etc."
category: "Other"
url: https://railway.com/deploy/kimai
---

# Deploy Kimai | Open Source Toggl & Harvest Alternative

Self Host Kimai, the #1 open-source time tracker - reports, invoices, etc.

**[Deploy Kimai | Open Source Toggl & Harvest Alternative on Railway](https://railway.com/template/kimai)**

- **Creator:** Heimdall
- **Category:** Other
- **Total deploys:** 6

## Template content

### Kimai https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/kimai.svg

- **Image:** kimai/kimai2:apache
- **Start command:** `/bin/bash -c 'a2dismod mpm_event 2>/dev/null; a2enmod mpm_prefork 2>/dev/null; exec /entrypoint.sh'`
- **Public domain:** Yes

### MySQL https://devicons.railway.app/i/mysql.svg

- **Image:** mysql:9.4
- **Start command:** `docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0 --innodb-buffer-pool-size=1G`

## Documentation

![Kimai logo](https://raw.githubusercontent.com/kimai/images/main/repository-header.png)

# Deploy and Host Kimai on Railway

[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/kimai?referralCode=QXdhdr)

Kimai is the #1 open-source time-tracking application — a self-hostable alternative to Toggl, Harvest, Clockify and Hubstaff that lets freelancers, agencies, and teams record timesheets, generate reports, send invoices, and manage projects from a single web app. Self-host Kimai on Railway in one click and run your billable-hours stack on infrastructure you own, with HTTPS, a managed MySQL database, and a persistent volume for logs and uploads.

This Railway template deploys the official `kimai/kimai2:apache` image (Kimai 2.56.0, PHP 8.3 on Apache) wired to a Railway-managed MySQL service. It pre-applies the `php:*-apache` MPM-prefork workaround required to run Apache on Railway, generates a strong `APP_SECRET` and admin password, and mounts a volume at `/opt/kimai/var` so plugins, sessions, and the install marker survive redeploys.

## Getting Started with Kimai on Railway

After the deployment turns green, open the Railway-generated URL and you will land on Kimai's login page at `/en/login`. Sign in with the email set in `ADMINMAIL` and the password Railway generated for `ADMINPASS` — both are visible in the Kimai service Variables tab. From the dashboard, create your first customer, add a project under it, define a few activities (e.g. *Development*, *Design Review*), and start the timer from the top bar. Visit *System → Mail* and point `MAILER_URL` at your SMTP provider so password resets and invoice exports work.

![Kimai dashboard screenshot](https://res.cloudinary.com/asset-cloudinary/image/upload/v1777573859/a2c86668-7fd6-4f7c-85b7-5f190b9ebe88.png)

## About Hosting Kimai

Kimai is a Symfony-based time-tracking platform actively maintained by Kevin Papst since 2014. It is GPL-3.0 licensed, supports unlimited users and customers in the self-hosted edition, and ships a full REST API plus a marketplace of community plugins.

Key features of self-hosted Kimai:

- Multi-user, multi-team, multi-customer time tracking with per-project activities
- Invoice generation with customisable templates (PDF/HTML), tax rates, and recurring invoices
- 30+ built-in reports — by user, customer, project, activity, tag, billable/non-billable
- REST API and webhooks for integrations with Slack, Trello, accounting systems
- Plugin marketplace with paid and free add-ons (LDAP/SSO, additional exports, custom fields)
- Two-factor authentication, role-based permissions, audit log, and per-user rates

Architecture: a single Apache + PHP-FPM container talking to a managed MySQL service over Railway's private network.

## Why Deploy Kimai on Railway

- One-click deploy — no Dockerfile required
- HTTPS, custom domain, and managed MySQL provisioned automatically
- Volume keeps logs, sessions, and installed plugins across redeploys
- Predictable monthly cost — only the resources Kimai actually uses
- Update Kimai by bumping `kimai/kimai2:apache` to a pinned tag in one place
- Your billable-hours data stays on infrastructure you control

## Common Use Cases

- Freelancers tracking billable hours across multiple clients and exporting monthly invoices
- Agencies and consultancies running team-wide time tracking with per-project budgets
- Replacing Toggl Track or Harvest with a self-hosted alternative — no per-seat fees
- Internal time-allocation reporting for grant funded projects, R&amp;D tax credits, or client billing audits

## Dependencies for Kimai on Railway

This Railway template provisions two services:

- **Kimai** — `kimai/kimai2:apache` (Symfony app, PHP 8.3, Apache HTTP server)
- **MySQL** — Railway-managed MySQL (Bitnami template) with a 5 GB volume at `/var/lib/mysql`

### Environment Variables Reference

| Variable | Description |
|---|---|
| `DATABASE_URL` | Doctrine DSN for the MySQL service |
| `APP_SECRET` | Symfony cookie/session signing key |
| `APP_ENV` | `prod` for production builds |
| `PORT` | Routing-signal for Railway edge (apache Listen is hardcoded to 8001) |
| `TRUSTED_PROXIES` | Railway CGNAT range so Symfony trusts X-Forwarded-* headers |
| `ADMINMAIL` / `ADMINPASS` | Bootstrap admin user created on first install |
| `MAILER_FROM` / `MAILER_URL` | Outbound email sender + transport DSN |
| `RAILWAY_RUN_UID` | Force container to run as root for chown of /opt/kimai/var |
| `memory_limit` | PHP `memory_limit` injected into php.ini at startup |

### Deployment Dependencies for Kimai on Railway

- Runtime: PHP 8.3 + Apache 2.4 (inside Docker image)
- GitHub: https://github.com/kimai/kimai
- Docker Hub: https://hub.docker.com/r/kimai/kimai2
- Docs: https://www.kimai.org/documentation/

## Hardware Requirements for Self-Hosting Kimai

| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPU |
| RAM | 512 MB (Kimai) + 256 MB (MySQL) | 1 GB (Kimai) + 512 MB (MySQL) |
| Storage | 2 GB volume | 10 GB volume |
| Runtime | PHP 8.3 + MySQL 8 | PHP 8.3 + MySQL 8 |

Kimai itself is light. Memory pressure scales with the number of concurrent users and the size of generated PDF invoices. MySQL grows with timesheet history — plan ~1 KB per timesheet entry.

## Self-Hosting Kimai

The fastest way to self-host Kimai on Railway is the one-click template above. To run it locally for evaluation:

```
docker run -it --rm \
  -e DATABASE_URL='mysql://kimai:kimai@db:3306/kimai?charset=utf8mb4&amp;serverVersion=8.0' \
  -e APP_SECRET=changeme-32-char-string \
  -e ADMINMAIL=admin@example.com \
  -e ADMINPASS=changeme \
  -e TRUSTED_PROXIES=127.0.0.1 \
  -p 8001:8001 \
  -v kimai-data:/opt/kimai/var \
  kimai/kimai2:apache
```

To pin to a specific Kimai release on Railway, change the image tag in the Kimai service settings:

```
kimai/kimai2:apache-2.56.0
```

Then redeploy the service from the Railway UI.

## How Much Does Kimai Cost to Self-Host?

Kimai is GPL-3.0 open source — the software itself is free, with no per-user or per-customer licensing. On Railway you pay only for the compute, network, and volume the Kimai + MySQL services actually use; a small team typically fits within the hobby tier. The optional Kimai Cloud SaaS starts at €5/user/month and exists for users who do not want to operate the stack themselves — self-hosting on Railway sidesteps that fee.

## Kimai vs Toggl Track vs Clockify

| Feature | Kimai (self-host) | Toggl Track | Clockify |
|---|---|---|---|
| License | GPL-3.0 open source | Closed source SaaS | Closed source SaaS |
| Self-hostable | Yes | No | No |
| Invoicing | Built-in | Higher tier only | Higher tier only |
| Plugin marketplace | Yes | Limited | Limited |
| Per-user cost | $0 | $9–$18/user/month | $0–$12.99/user/month |

Kimai is the right choice when data residency, total cost of ownership, or invoicing-out-of-the-box matter more than a polished hosted UX.

## FAQ

**What is Kimai?**
Kimai is the #1 open-source self-hosted time-tracking application — used by freelancers, agencies, and companies to log billable hours, generate reports, and produce invoices.

**What does this Railway template deploy?**
Two services: a Kimai app container running `kimai/kimai2:apache` with a persistent volume at `/opt/kimai/var`, and a Railway-managed MySQL instance for timesheet storage.

**Why does the Kimai service need a startCommand workaround on Railway?**
The official Kimai Apache image is built on `php:8.3-apache-bookworm`, which loads both `mpm_event` and `mpm_prefork` on Railway and crash-loops with `AH00534: More than one MPM loaded`. The template's startCommand runs `a2dismod mpm_event &amp;&amp; a2enmod mpm_prefork` before the entrypoint to keep Apache happy.

**How do I configure SMTP so Kimai can send password-reset emails?**
Set `MAILER_URL` to a Symfony Mailer DSN, e.g. `smtp://user:pass@smtp.example.com:587?encryption=tls`. SendGrid, Postmark, Mailgun, and Amazon SES are all supported via their native DSN schemes.

**Can I migrate from Toggl Track or Clockify to self-hosted Kimai?**
Yes. Kimai supports CSV imports of timesheets through `bin/console kimai:import:timesheet` and offers a REST API for bulk loading customers, projects, and users. The repository's `var/import/` directory has example mappings.

**How do I install Kimai plugins on Railway?**
Drop the plugin into `/opt/kimai/var/plugins/` (the Railway volume), then redeploy. Plugins persist across deploys because the volume is mounted at `/opt/kimai/var`.

**How do I update Kimai to a new version?**
Change the image tag (e.g. from `:apache-2.56.0` to `:apache-2.57.0`) in the Kimai service settings on Railway and redeploy. The entrypoint runs `kimai:install` on every startup, which is idempotent and applies any pending Doctrine migrations to the existing MySQL database.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/kimai
