Back to articles
Technology Insight

Self-Hosting Leantime on a VPS with Docker: The Ultimate Guide to Ownership-Driven Project and Time Tracking

June 4, 2026

Introduction: The Case for Self-Hosting Your Operational Infrastructure

In the modern corporate ecosystem, efficiency and data sovereignty are two sides of the same coin. Organizations heavily rely on project management and time-tracking tools to optimize workflows, calculate billable hours, and monitor resource allocation. However, relying on proprietary SaaS platforms introduces recurring subscription costs, vendor lock-in, and compliance risks regarding proprietary operational data.

For enterprise leaders, IT managers, and privacy-conscious agencies, self-hosting offers an elegant resolution. By deploying your own infrastructure, you retain absolute ownership over your business metrics and user data. Among the open-source alternatives, Leantime has emerged as a premier choice, combining traditional time tracking with cognitive-accessibility features and goal-oriented project management. This guide provides an exhaustive blueprint for deploying Leantime on a Virtual Private Server (VPS) leveraging the isolation and scalability of Docker.

Why Choose Leantime for Time Tracking and Project Management?

Leantime is not merely a digital punch clock; it is a holistic workflow management system designed with human psychology and modern agile practices in mind. Unlike overly rigid or hyper-simplistic alternatives, Leantime balances robust features with an intuitive user experience. Key organizational benefits include:

  • Comprehensive Time Tracking: Built-in timesheets, granular task-level tracking, and seamless export capabilities for precise invoicing and payroll management.
  • Value-Driven Project Planning: Features integrated tools for defining project goals, target personas, and strategic milestones alongside standard Kanban boards and Gantt charts.
  • AI-Assisted Features: Modern iterations incorporate optional AI utilities to summarize project updates and streamline task creation.
  • Data Independence: Operating on an open-source architecture ensures that your workflows remain functional independent of third-party corporate lifecycles.

Prerequisites and Infrastructure Provisioning

Before initiating the deployment process, ensure your infrastructure meets the fundamental hardware and software baselines necessary for stable containerized execution.

Hardware Requirements

While Leantime is highly optimized, the underlying VPS should be provisioned with sufficient headroom to handle concurrent database transactions and active user sessions:

  • CPU: Minimum 1 Core (2 Cores recommended for production environments with >10 users).
  • Memory: Minimum 2GB RAM to smoothly run Docker, MySQL/MariaDB, and the Leantime application stack.
  • Storage: 20GB+ Solid State Drive (SSD) or NVMe storage to ensure rapid database read/write I/O operations.

Software and Network Prerequisites

Ensure that a clean installation of an enterprise-grade Linux distribution (such as Ubuntu 22.04 LTS or Debian 12) is deployed on the VPS. Additionally, the following parameters must be met:

  1. Domain Name: A fully qualified domain name (FQDN), e.g., tracker.yourcompany.com, pointed to your VPS public IP address via an A record.
  2. Network Ports: Ports 80 (HTTP) and 443 (HTTPS) must be unrestricted in your provider's firewall configuration.
  3. Docker Engine & Compose: Installed and updated to the latest stable release.

Step-by-Step Deployment Architecture using Docker Compose

Using Docker Compose allows us to define the multi-container application architecture in a single, declarative configuration file. This guarantees reproducibility and isolates the Leantime application logic from the database management system.

Step 1: System Preparation and Directory Structuring

Establish a dedicated operational directory to maintain configuration files and mapped persistent volumes. Execute the following commands via your secure SSH terminal:

mkdir -p /opt/leantime && cd /opt/leantime
mkdir -p leantime_data mysql_data
Security Note: Restrict directory permissions to prevent unauthorized local user access to configuration secrets and database files.

Step 2: Constructing the Docker Compose Configuration

Create a file named docker-compose.yml within your operational directory. This configuration orchestrates the Leantime core container alongside a dedicated MariaDB database engine:

version: '3.8'

services:
  leantime_db:
    image: mariadb:10.11
    container_name: leantime_database
    restart: always
    environment:
      MYSQL_DATABASE: leantime
      MYSQL_USER: leantime_user
      MYSQL_PASSWORD: PutSecurePasswordHere
      MYSQL_ROOT_PASSWORD: PutSecureRootPasswordHere
    volumes:
      - ./mysql_data:/var/lib/mysql

  leantime_app:
    image: leantime/leantime:latest
    container_name: leantime_application
    restart: always
    ports:
      - "8080:80"
    environment:
      - LEAN_DB_HOST=leantime_db
      - LEAN_DB_USER=leantime_user
      - LEAN_DB_PASSWORD=PutSecurePasswordHere
      - LEAN_DB_DATABASE=leantime
      - LEAN_APP_URL=[https://tracker.yourcompany.com](https://tracker.yourcompany.com)
    volumes:
      - ./leantime_data:/var/www/html
    depends_on:
      - leantime_db

Step 3: Launching the Application Stack

With the composition file populated with your secure passwords and configured application URL, initiate the stack in detached background mode:

docker compose up -d

Verify container health by executing docker compose ps to confirm both systems are operating normally.

Implementing Reverse Proxy and SSL Encryption

Exposing port 8080 directly to the internet is highly discouraged. To secure enterprise communications and handle cryptographic operations, a reverse proxy such as Nginx or Caddy should be implemented alongside an automated Let's Encrypt SSL lifecycle.

Nginx Configuration Blueprint

Install Nginx on the host system and configure a new server block pointing to your internal Docker service container mapped to port 8080:

server {
    listen 80;
    server_name tracker.yourcompany.com;

    location / {
        proxy_pass [http://127.0.0.1:8080](http://127.0.0.1:8080);
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded-for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Enforce TLS encryption using Certbot to automatically generate and renew SSL certificates:

sudo certbot --nginx -d tracker.yourcompany.com

Initial Onboarding and Strategic Configuration

Navigate to your configured URL in a modern web browser to access the setup wizard. The initial database schema instantiation occurs automatically. You will be prompted to register the global Organization Admin account.

Essential Initial Operations

  1. User Management Setup: Navigate to the user management matrix to invite core team leads and define granular role permissions (Client, Team Member, Project Manager, or Admin).
  2. Client Billing Profiles: Configure distinct client entities if your tracking is primarily geared toward external agency billing or project milestone visibility.
  3. Timesheet Approvals Workflow: Establish structured review cycles to validate logged hours before exporting analytical records.

Maintenance, Data Backups, and Security Lifecycle

A resilient self-hosted infrastructure requires active maintenance paradigms to protect organizational data assets from degradation or corruption.

Automated Backups

Implement a cron utility script to periodically dump the MariaDB data volume and compress the persistent storage directory. At a minimum, a weekly backup rotation should be pushed to an offsite secure storage bucket.

Updating the Platform

Upgrading Leantime to leverage new features and security patches requires zero operational downtime if managed through Docker:

docker compose pull
docker compose up -d --remove-orphans

Conclusion: Embracing Modern Sovereignty

By migrating your time tracking and project planning framework away from generic public SaaS options to a dedicated, self-hosted Leantime framework, you gain immense strategic value. You drastically lower organizational operating costs, minimize compliance vulnerabilities, and deliver a responsive, professional platform tailored entirely to your team's operational rhythm. Take full control of your enterprise productivity matrix today.