What you will set up
Kimai is a time tracker for a team or a consultancy. You keep customers, projects and activities, everyone records their hours with a timer or by hand, and Kimai turns the hours into reports, exports in Excel, CSV or PDF, and invoices with your hourly rates and VAT. It handles any currency, Swedish kronor included, and its interface is translated into Swedish.
Kimai is created by Kevin Papst, an independent developer in Vienna, Austria, and developed with its community in the open on GitHub. It is open source under the AGPL-3.0 licence. Kevin Papst also runs a hosted version, Kimai Cloud, and sells plugins. This guide uses the official container image, kimai/kimai2, which the Kimai project publishes itself.
Here Kimai runs as a Compose project under a user of its own called kimai, with MariaDB for its data, behind Caddy from the Docker guide.
The app-specific results below come from the tested Podman guide on a Melonslab server with Debian 13:
- Kimai 2.69.0 started with MariaDB 11.8, with no account until the first admin was created from the command line, and no way for visitors to sign up.
- The interface was shown in with Swedish dates and number formats and Swedish time, and SEK was set as the currency for new customers.
- Two customers, a project with a budget, two activities and an hourly rate of 950 kr were created. Hours were recorded by hand and with the timer.
- An invoice in Swedish was created as a PDF, with 25 % VAT and a total in kronor, and the hours were marked as invoiced. A report was exported as Excel and as PDF.
- Login attempts were limited per visitor address, over IPv4 and IPv6, and the session cookie was sent over HTTPS only.
- A password reset email reached a test mail server, with a working login link. Without email, a reset said an email was sent, and none was.
- In a capture of the server's traffic, Kimai made no outside connections while it started, recorded time, and made invoices and exports. Two admin pages are the exception: System > Plugins fetches Kimai's list of plugins from
www.kimai.org, and System > Doctor asks GitHub for the latest release. - An update from Kimai 2.68.0 to 2.69.0 went through
podman auto-updatein the Podman test. Kimai was restored from a backup into empty volumes, with its invoices, and everything came back by itself after a reboot.
In the Podman test, the pod used about 200 MB of memory, most of it MariaDB.
The Docker version below follows the tested rootless Docker base guide. The app-specific results above come from the tested Podman guide on a Melonslab server; they were not measured under Docker.
Before you start
You need:
- a server set up as in the Docker guide, with Caddy running;
- an A record and an AAAA record for
time.example.compointing at your server.
The examples use time.example.com for Kimai, 203.0.113.10 for your server's IPv4 address, which ip -brief address show eth0 shows, Exempel AB for your own company and Nordljus AB for a customer. Replace them throughout.
1. Create the user
As root:
useradd -m -s /bin/bash kimai
loginctl enable-linger kimai
uid=$(id -u kimai)
Everything up to step 5 runs as kimai.
2. Create the secrets
The passwords are generated with the Compose file in the next step and kept in a 0600 file under the app directory.
The file holds the database password for MariaDB and the DATABASE_URL address Kimai connects to, with the same password in it. Docker reads them from the 0600 file above.
3. Define the Compose project
Create a Compose file in the app's directory. It uses the same images, ports, volumes, environment and restart policy as the Podman guide:
mkdir -p /home/kimai/kimai
cat > /home/kimai/kimai/compose.yaml <<'YAML'
services:
db:
image: docker.io/library/mariadb:11.8
volumes:
- db:/var/lib/mysql
environment:
MARIADB_DATABASE: kimai
MARIADB_USER: kimai
MARIADB_RANDOM_ROOT_PASSWORD: "1"
MARIADB_AUTO_UPGRADE: "1"
env_file: kimai.env
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s
restart: always
app:
image: docker.io/kimai/kimai2:apache
ports:
- "127.0.0.1:8160:8001"
volumes:
- data:/opt/kimai/var
environment:
DEFAULT_URI: https://time.example.com
TRUSTED_PROXIES: 203.0.113.10
TRUSTED_HOSTS: ^(time[.]example[.]com|localhost)$
env_file: kimai.env
restart: always
volumes:
db:
data:
YAML
umask 077
dbpw=$(openssl rand -hex 24)
printf 'MARIADB_PASSWORD=%s\nDATABASE_URL=mysql://kimai:%s@127.0.0.1:3306/kimai?charset=utf8mb4&serverVersion=11.8.0-MariaDB\n' "$dbpw" "$dbpw" > /home/kimai/kimai/kimai.env
unset dbpw
chmod 600 /home/kimai/kimai/kimai.env
chown -R kimai:kimai /home/kimai/kimai
uid=$(id -u kimai)
runuser -u kimai -- env HOME=/home/kimai XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/kimai/kimai && docker compose up -d"
Use the weekly docker-update.service/docker-update.timer from the rootless Docker guide instead of Podman's auto-update timer. It runs docker compose pull and docker compose up -d in the app directory each Sunday. Set it up once for kimai as shown there; it covers every Compose app in that user's home.
The first start downloads about 1.2 GB of images, and Kimai takes a minute to set up its database. It is ready when this prints 200:
uid=$(id -u kimai)
runuser -u kimai -- env HOME=/home/kimai XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash <<'SH'
cd /home/kimai/kimai
docker compose exec -T app curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8001/en/login
SH
4. Create your admin account
Kimai starts without any account, so nobody can log in until you create one. Use Kimai's own command, with your own user name and email address:
docker compose exec --user www-data app /opt/kimai/bin/console kimai:user:create anna anna@example.com ROLE_SUPER_ADMIN
It asks for a password, at least 8 characters long, and prints "Success! Created user: anna". ROLE_SUPER_ADMIN gives the account every right, including the system settings. --user www-data runs the command as the user Kimai's web server runs as, so that it does not leave files in the volume that Kimai cannot read.
5. Put Caddy in front
Go back to root with exit, switch to runuser -u caddy -- /bin/bash, and add this block at the end of ~/Caddyfile:
time.example.com {
reverse_proxy 127.0.0.1:8160
}
Restart Caddy with runuser -u caddy -- env HOME=/home/caddy XDG_RUNTIME_DIR=/run/user/$(id -u caddy) DOCKER_HOST=unix:///run/user/$(id -u caddy)/docker.sock PATH=/usr/bin:/bin bash -lc 'cd /home/caddy/caddy && docker compose restart caddy', open https://time.example.com, and log in with the user name and password from step 4.
There is no sign-up page: you create every account yourself under System > Users. Each user can switch on two-factor authentication under their profile menu, top right, > Two-Factor (2FA).
6. Use Kimai in Swedish
The first time you log in, a short wizard asks for your settings. To use Kimai in choose:
- Language: Svenska;
- Time, date and currency format: Svenska (Sverige), which writes dates as 2026-10-14 and amounts as 1 234,56 kr;
- Timezone: Europe / Stockholm.
The wizard switches to Swedish as soon as you continue. Everyone can change these later under their profile menu > Preferences.
Kimai's default for new users is English and UTC. To make Swedish the default for everyone you create, open System > Settings, and under User set Timezone to Europe / Stockholm, Language to Svenska and Time, date and currency format to Svenska (Sverige), then Save. In the same page is System > Systeminställningar, under Användare, with Spara.
7. Set up your company
The settings page has one form per area, each with its own Save button. Under System > Settings:
- My company: enter your Company name, which Kimai shows at the top left, and set Currency to Swedish krona, SEK.
- Customer: set Country to Sweden, Language to Svenska, and Timezone to Europe / Stockholm.
- Invoices: Invoice number format is
{Y}/{cy,3}by default, the year and a counter per customer and year, such as2026/001. Change it if your numbering differs.
New customers get the currency, country, language and time zone set here. The currency is kept on each customer, so you can bill one customer in euros and the rest in kronor. Kimai writes the names of countries and currencies in the format you chose in step 6, such as "svensk krona" for Swedish.
8. Customers, projects and activities
Hours are recorded on a customer, one of its projects, and an activity. Under Administration:
- Customers > Create. First create your own company,
Exempel AB: Kimai uses a customer as the sender of an invoice. Fill in Name, and under Address your Company name, address, and Country, and under Invoices your VAT-ID, then Save. - Create the customer you bill,
Nordljus AB, the same way. Currency is already SEK. - On the customer's page, choose + next to Prices, enter
950as Price, and Save. This is the hourly rate for all its projects; leave Fixed price off. A price can also be set on a project, an activity or a single user. - Projects > Create, choose the Customer, give it a Name, such as
Ny webbplats, and, if you like, a Budget in kronor, then Save. The project page shows how much of the budget is used. - Activities > Create, such as
UtvecklingandMöte. Without a Project, an activity can be used in every project.
9. Track time
Under Time Tracking > My times:
- The play button at the top starts the timer: choose the customer, project and activity, and Save with Duration / End empty. The button turns into a stop button with the running time; choose it when you are done.
- Create adds hours afterwards: a date, a start time, and a Duration, such as
2:30.
Weekly hours shows a week as a grid to fill in, and Calendar shows your hours as a calendar. Under Reporting, Kimai sums up hours and amounts by user, customer and project.
10. Invoices
An invoice needs a template first. Under Invoices > Invoice template > Create:
- Name, such as
Standard, and Title, the heading of the invoice, such asFaktura. - Invoice issuer: your own company from step 8.
- Terms of payment, such as
Betalning inom 30 dagar., Bank account, such as your bankgiro number, and Payment term in days. - Tax rate:
25for 25 % VAT. - Language: Svenska.
- Invoice template: leave it at Invoice, the default, which makes a PDF. The list has a second Invoice, under HTML, which makes an HTML file instead. Grouping of invoice lines gives one line per entry by default.
Then, under Invoices > Create invoice, choose the Customer, check the Time range, and choose Search. The preview shows the customer, the hours and the total with VAT. Preview shows the invoice itself, and Save creates it: it gets the next number, is stored under Invoice history, where Download gives you the PDF, and its hours are marked as exported, so they are not invoiced twice.
Our test invoice, in had the sender and the customer with their VAT numbers, a due date 30 days ahead, one line per entry at 950,00 kr an hour, the net amount, 25 % VAT and the total in kronor. In Invoice history you mark an invoice as paid, or cancel it.
11. Export a report
Time Tracking > Export gives you the hours for a customer or a period as a file, without making an invoice, for example to send with an invoice from your accounting system. Choose the filters and Search, then CSV, Excel or PDF. The PDF opens in a new tab, with a summary per customer and project and a full list of entries. Mark as exported marks the hours as exported, like an invoice does.
12. Email
Kimai sends email for password resets, from I forgot my password on the login page. This guide does not set up email, and without it:
- a reset request says "An email has been sent with a link to reset your password", and no email is sent;
- after a reset request, Kimai asks that user for a new password at their next login.
Logins with a password keep working, and you can set a new password for anyone under System > Users, in the menu next to the user, > Password.
To send email, point Kimai at your email provider's SMTP server. Kimai takes the server, the account and its password as one address. As kimai, store it as a secret, with your own account, password and server:
The @ in the account name is written %40. Write other characters in the password the same way, such as %2F for / and %3A for :, or choose a password of letters and digits. Then add MAILER_FROM=time@example.com and MAILER_URL=<the address above> to /home/kimai/kimai/kimai.env, which is already used as env_file for the app.
And restart:
uid=$(id -u kimai)
runuser -u kimai -- env HOME=/home/kimai XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/kimai/kimai && docker compose up -d --force-recreate app"
Port 587 uses STARTTLS. For port 465, which uses TLS from the start, begin the address with smtps:// and end it with :465. We tested sending against a test mail server on the same server, without TLS; sending through a real email provider was not tested.
13. Back up
As kimai:
uid=$(id -u kimai)
runuser -u kimai -- env HOME=/home/kimai XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash <<'SH'
cd /home/kimai/kimai
umask 077
mkdir -p ~/backup
docker compose exec -T db sh -c 'mariadb-dump -ukimai -p"$MARIADB_PASSWORD" --single-transaction kimai' > ~/backup/kimai-db.sql
tar -cf /home/kimai/kimai/backup/kimai-data.tar -C /home/kimai/kimai data > ~/backup/kimai-data.tar
SH
The dump holds the customers, projects, hours, users and settings, and runs while Kimai keeps working. The data directory holds the PDF invoices Kimai has made and its secret key. Copy ~/backup to another machine, for example with restic, and store it safely: it holds all your hours and your customers' details.
To restore with empty data directories, as kimai, with the backup in ~/backup:
docker compose down
docker compose down -v
mkdir -p /home/kimai/kimai/data
tar -xf ~/backup/kimai-data.tar -C /home/kimai/kimai/data
uid=$(id -u kimai)
runuser -u kimai -- env HOME=/home/kimai XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/kimai/kimai && docker compose up -d db"
docker compose exec -T db sh -c 'mariadb -ukimai -p"$MARIADB_PASSWORD" kimai' < ~/backup/kimai-db.sql
uid=$(id -u kimai)
runuser -u kimai -- env HOME=/home/kimai XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash -lc "cd /home/kimai/kimai && docker compose up -d app"
Starting only the database first loads the backup before Kimai sets up an empty one. On a new server, follow steps 1 to 3 first, but restore before you create an account in step 4.
14. Update
The weekly docker-update.timer checks once a day for new images of Kimai and MariaDB, and restarts the pod when one has changed. Kimai updates its database when it starts. To update now:
uid=$(id -u kimai)
runuser -u kimai -- env HOME=/home/kimai XDG_RUNTIME_DIR=/run/user/$uid \
DOCKER_HOST=unix:///run/user/$uid/docker.sock PATH=/usr/bin:/bin \
bash <<'SH'
cd /home/kimai/kimai
docker compose pull && docker compose up -d
SH
To decide yourself when to update, replace apache in compose.yaml with a version, such as 2.69.0 from the image's list of tags, which is the same image, remove the weekly update timer, and change the version when you want to update. Either way, keep your backups current, and read the release notes on Kimai's GitHub page before larger updates.
Troubleshooting
"Too many failed login attempts, please try again in 5 minutes." for everyone at once. TRUSTED_PROXIES is missing or names the wrong address, so Kimai sees every visitor as the server. It must be the server's IPv4 address, not 127.0.0.1. Fix it in compose.yaml, then daemon-reload and restart kimai-app.
Every page gives an error 400. The name in the browser's address bar does not match TRUSTED_HOSTS. Check the name in compose.yaml, with each dot written [.].
I forgot my password gives an error 503. TRUSTED_HOSTS is not set; Kimai's log, docker compose logs app, says "Password reset is deactivated". Add the line from step 3.
Kimai asks for a new password after login. Someone requested a password reset for that account. Set a new password, and it does not ask again.