Self-Hosting Leantime on Docker VPS: Ultimate Project and Time Management Guide
Introduction: The Cost of Disconnected Productivity Tools
In the modern corporate landscape, managing projects, tracking time, and maintaining operational momentum often requires a complex web of SaaS subscriptions. Businesses routinely jump between Jira for development, Asana for marketing, and Toggl for time tracking. This fragmented approach not only drains financial resources but also creates dangerous data silos. For enterprise leaders and IT managers, data sovereignty, security, and cost control have become top priorities.
Enter Leantime, an open-source, lean project management system designed specifically for non-project managers and innovators. By combining task management, time tracking, and strategic planning into a single intuitive interface, Leantime addresses the core pain points of business execution. When self-hosted via Docker on a Virtual Private Server (VPS), Leantime transforms from a standard tool into an enterprise-grade, cost-effective productivity powerhouse. This guide provides a definitive roadmap for setting up and deploying Leantime on your own infrastructure.
---Why Choose Leantime Over Mainstream SaaS Alternatives?
Before diving into the technical deployment, it is vital to understand the strategic advantages of choosing Leantime over traditional project management tools. Mainstream solutions often suffer from "feature bloat," overwhelming team members and hindering adoption rates. Leantime focuses on the human element of productivity, integrating cognitive science and lean principles to keep teams engaged.
Key Business Benefits
- Complete Data Ownership: Hosting Leantime on your personal or corporate VPS ensures that proprietary business strategies, project timelines, and client data remain exclusively under your control. This is critical for compliance with strict global data privacy regulations.
- Substantial Cost Efficiency: Traditional SaaS models charge per seat, causing expenses to skyrocket as your organization expands. Self-hosting eliminates these variable costs, allowing you to scale your user base indefinitely for the flat rate of your VPS infrastructure.
- AI-Powered Insights: Unlike basic open-source alternatives, Leantime integrates modern AI features designed to assist with task breakdown, risk assessment, and personalized productivity coaching.
- All-in-One Architecture: It seamlessly unifies milestones, kanban boards, timesheets, retrospectives, and whiteboards into a singular, cohesive ecosystem.
Prerequisites and Infrastructure Planning
To ensure a flawless deployment capable of handling consistent daily usage, your underlying infrastructure must meet specific baseline requirements. Below is the recommended technical profile for your VPS environment:
| Resource Component | Minimum Requirement | Recommended Specification |
|---|---|---|
| Processor (CPU) | 1 Core (64-bit) | 2 Cores or higher |
| Memory (RAM) | 2 GB | 4 GB (Highly recommended for smooth Docker operations) |
| Storage | 20 GB SSD/NVMe | 50 GB+ NVMe (To accommodate file attachments and database growth) |
| Operating System | Ubuntu 22.04 LTS | Ubuntu 24.04 LTS or Debian 12 |
In addition to the server hardware, you will require a fully qualified domain name (FQDN) such as projects.yourcompany.com pointed at your VPS IP address, alongside standard SSH access with root or sudo privileges.
Step-by-Step Deployment Guide via Docker Compose
Deploying Leantime via Docker represents the gold standard for modern infrastructure setup. Docker isolates the application environment, preventing dependency conflicts with the underlying host operating system and ensuring effortless updates in the future.
Step 1: System Optimization and Docker Installation
First, connect to your VPS instance via SSH and execute a comprehensive update of your system packages. Following the update, install the necessary prerequisites alongside the core Docker engine and Docker Compose plugin.
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl git apt-transport-https ca-certificates gnupg lsb-release
# Install Docker Engine
curl -fsSL [https://get.docker.com](https://get.docker.com) -o get-docker.sh
sudo sh get-docker.shVerify the successful installation of Docker by checking the active system versions:
docker --version
docker compose versionStep 2: Constructing the Application Directory and Environment Configuration
Create a dedicated directory on your filesystem to contain your Leantime infrastructure. This organizes your volume mappings and configurations efficiently.
mkdir -p ~/leantime-stack
cd ~/leantime-stackWithin this directory, create an environment variable file named .env. This file securely isolates confidential parameters such as database credentials and application keys from the main infrastructure script. Use the configuration template below:
Security Warning: Always replace placeholder values like LEAN_SECURE_PASSWORD with complex, randomly generated alphanumeric strings to protect your production database.# Database Parameters
DB_PASSWORD=LEAN_SECURE_PASSWORD
DB_DATABASE=leantime_db
DB_USER=leantime_user
# Leantime Application Configurations
LEAN_APP_URL=[https://projects.yourcompany.com](https://projects.yourcompany.com)
LEAN_PORT=8080
LEAN_DB_HOST=leantime-dbStep 3: Writing the Docker Compose Manifest
Create a file named docker-compose.yml. This orchestrates two coordinated containers: a secure MySQL database backend and the official Leantime web application frontend.
version: '3.8'
services:
leantime-db:
image: mysql:8.0
container_name: leantime_database
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
volumes:
- db_data:/var/lib/mysql
leantime-app:
image: leantime/leantime:latest
container_name: leantime_application
restart: always
ports:
- "${LEAN_PORT}:80"
depends_on:
- leantime-db
environment:
- LEAN_DB_HOST=${LEAN_DB_HOST}
- LEAN_DB_USER=${DB_USER}
- LEAN_DB_PASSWORD=${DB_PASSWORD}
- LEAN_DB_DATABASE=${DB_DATABASE}
- LEAN_PORT=80
- LEAN_APP_URL=${LEAN_APP_URL}
volumes:
- app_data:/var/www/html/userfiles
volumes:
db_data:
app_data:Step 4: Launching the Services
With your environment variables and compose manifests fully prepared, trigger the container deployment process. The following command instructs Docker to download the official images and spin up the services in detached (background) mode:
docker compose up -dConfirm that both containers are running flawlessly by analyzing the active process list: docker compose ps.
Securing Leantime with an Nginx Reverse Proxy and Let's Encrypt
Running a corporate application over an unencrypted HTTP port is an existential security hazard. To safeguard user credentials, operational data, and timesheets, implementing an Nginx reverse proxy coupled with automated Let's Encrypt SSL/TLS certificates is mandatory.
Step 1: Install Nginx and Certbot
sudo apt install -y nginx certbot python3-certbot-nginxStep 2: Establish the Nginx Server Configuration
Create an Nginx configuration block targeting your specific domain path: sudo nano /etc/nginx/sites-available/leantime. Insert the reverse proxy instructions detailed below:
server {
listen 80;
server_name projects.yourcompany.com;
location / {
proxy_pass http://localhost: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;
}
}Link the newly engineered configuration to the active directory and restart Nginx to apply changes:
sudo ln -s /etc/nginx/sites-available/leantime /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginxStep 3: Provision the SSL Certificate
Execute Certbot to automatically provision, install, and configure an enterprise-grade Let's Encrypt SSL certificate:
sudo certbot --nginx -d projects.yourcompany.comFollow the interactive command-line prompts to enable automatic HTTPS redirection. Your connection is now fully encrypted via industry-standard TLS.
---Post-Deployment Initialization and Team Onboarding
Open your preferred web browser and navigate directly to your domain configuration (e.g., [https://projects.yourcompany.com](https://projects.yourcompany.com)). The system will present you with Leantime’s elegant, user-friendly installation wizard.
- Account Setup: Configure the master administrator profile by inputting your corporate email address and establishing a resilient password.
- Company Creation: Input your corporate metadata or department nomenclature to structure the initial tenant space.
- Workspace Definition: Set up your introductory workspaces, selecting between classic Kanban methodologies, Lean Canvas frameworks, or standard Gantt milestone structures.
Once within the administrative dashboard, navigate directly to the User Management control panel to invite your team members, allocate role-based access permissions, and initiate time tracking modules across operational sprint pipelines.
---Conclusion: Strategic Scaling and Maintenance
By self-hosting Leantime on a Docker-equipped VPS, your organization has successfully established an agile, secure, and infinitely scalable project ecosystem without the recurring financial burden of SaaS licenses. Maintenance is incredibly straightforward: to update the core platform to capture future feature iterations, merely run docker compose pull followed by docker compose up -d within your stack directory.
Embracing open-source infrastructure architecture represents a critical maturation point for modern enterprises. Your project data, operational timelines, and financial capital now remain firmly under your direct authority, laying a robust foundation for long-term productivity and growth.
