selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

hakatime logo

Self-host hakatime

v1.7.3

Wakatime-compatible time tracking server with dashboard

ReleaseOpen SourceUnlicense
Updatedlast year
LanguageHaskell
Setup difficultyModerate
Stars
688
Port
8080 (HTTP server)
Requires
Libpq, PostgreSQL
Docker
mujx/hakatime
Install with Docker Compose
Overview page showing coding activity summaryProjects page listing tracked projectsProjects page showing GitHub commits breakdown

What is hakatime?

Hakatime is a self-hosted server implementation of Wakatime that collects coding activity heartbeats from IDE plugins and provides a web dashboard for visualization. It supports importing existing Wakatime data, grouping projects with tags, user registration and login, leaderboards across instance users, badge generation for projects, and detailed charts breaking down time by project, language, day of week, hour of day, and file. It can forward heartbeats to other Wakatime-compatible servers like Wakatime.com or Wakapi. The server is written in Haskell (Servant) with a Mithril.js dashboard, uses PostgreSQL for storage, and is deployed via Docker Compose. The project is licensed under Unlicense (public domain).

Should you self-host hakatime?

hakatime scores 50/100 on selfhost.directory (how scoring works) and ranks #76 of 166 in Developer Tools. It has 688 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is Unlicense-licensed and written mostly in Haskell.

Its closest alternative on selfhost.directory is ActivityWatch (80/100, 19 401 stars). It scores higher overall, so compare the two before you pick. See hakatime vs ActivityWatch side by side.

Features

  • Analytics Dashboard
  • API token management
  • Badge generation
  • Charts and visualizations
  • GitHub commit time tracking
  • Heartbeat forwarding
  • Leaderboards
  • Project tagging
  • User registration and login
  • Wakatime-compatible API
  • WakaTime data import

hakatime README

How to install hakatime

Install hakatime with Docker Compose

Docker and Docker Compose
Environment variables
HAKA_DB_HOST, HAKA_DB_PORT, HAKA_DB_NAME, HAKA_DB_PASS, HAKA_DB_USER, HAKA_API_PREFIX, HAKA_BADGE_URL, HAKA_PORT, HAKA_SHIELDS_IO_URL, HAKA_ENABLE_REGISTRATION, HAKA_SESSION_EXPIRY, HAKA_LOG_LEVEL, HAKA_ENV, HAKA_HTTP_LOG, GITHUB_TOKEN, HAKA_REMOTE_WRITE_URL, HAKA_REMOTE_WRITE_TOKEN

docker-compose -f ./docker-compose-deploy.yml up

Requires PostgreSQL 12+ container

How to configure hakatime

  • GITHUB_TOKENGitHub token for retrieving time spent per commit

    GitHub token for retrieving time spent per commit

  • HAKA_API_PREFIXAPI path prefix when behind reverse proxy

    API path prefix when behind reverse proxy

  • HAKA_BADGE_URLExternal endpoint URL for badge generation

    External endpoint URL for badge generation

  • HAKA_DB_HOSTPostgreSQL database host

    PostgreSQL database host

  • HAKA_DB_NAMEPostgreSQL database name

    PostgreSQL database name

  • HAKA_DB_PASSPostgreSQL database password

    PostgreSQL database password

  • HAKA_DB_PORT5432PostgreSQL database port

    PostgreSQL database port

  • HAKA_DB_USERPostgreSQL database user

    PostgreSQL database user

  • HAKA_ENABLE_REGISTRATIONtrueEnable user registration through UI

    Enable user registration through UI

    values: true, false

  • HAKA_ENVdevEnvironment mode (dev uses key=value, production uses JSON)

    Environment mode (dev uses key=value, production uses JSON)

    values: dev, production

  • HAKA_HTTP_LOGtrueLog HTTP requests

    Log HTTP requests

    values: true, false

  • HAKA_LOG_LEVELinfoLogger verbosity level

    Logger verbosity level

  • HAKA_PORT8080HTTP server port

    HTTP server port

  • HAKA_REMOTE_WRITE_TOKENToken for forwarding heartbeats to remote server

    Token for forwarding heartbeats to remote server

  • HAKA_REMOTE_WRITE_URLURL to forward heartbeats to another Wakatime-compatible server

    URL to forward heartbeats to another Wakatime-compatible server

  • HAKA_SESSION_EXPIRY24Hours after which inactive browser sessions expire

    Hours after which inactive browser sessions expire

  • HAKA_SHIELDS_IO_URLhttps://img.shields.ioShields.io URL for badge generation

    Shields.io URL for badge generation

hakatime releases & version history

More in Time Tracking

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…