Deploy Kimai | Open Source Toggl & Harvest Alternative
Self Host Kimai, the #1 open-source time tracker - reports, invoices, etc.
Kimai
Just deployed
/opt/kimai/var
MySQL
Just deployed
/var/lib/mysql

Deploy and Host Kimai on Railway
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.

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:apacheto 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&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&serverVersion=8.0' \
-e APP_SECRET=changeme-32-char-string \
-e [email protected] \
-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 && 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:[email protected]: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.
Template Content
Kimai
kimai/kimai2:apacheADMINMAIL
Bootstrap admin email (first deploy only)
ADMINPASS
Bootstrap admin password (first deploy only)
MySQL
mysql:9.4