Bitflake logo

Self-host Solidtime with Docker Compose

Time tracking that gets out of your way

solidtime

postgres

postgres:18.3-alpine3.23

The steps below take a few minutes end to end.

  1. Docker compose setup and file
    save the generated compose and env files.
  2. Secret generation
    create the random passwords Solidtime needs.
  3. Start Solidtime with Docker Compose
    bring the stack up and check it's healthy.

Requirements

You'll need these installed on the machine you're deploying to:

Docker

Packages Solidtime and everything it depends on into an isolated container, so it runs the same way on your machine as it does everywhere else.

Install guide

Docker Compose

Reads docker-compose.ymland starts everything in it together. Ships with Docker Desktop. On Linux servers it's usually a separate install.

Install guide

1. Docker compose setup and file

Create a folder for Solidtime and save the file below into it as docker-compose.yml. It describes every container the stack needs — Solidtimeitself and any supporting services, such as its database — along with the ports, volumes and environment variables each one uses. You'll also need an empty .env file in the same folder; Docker Compose reads it automatically and uses it to fill in the ${VARIABLE}references you'll see in the file below.

docker-compose.yml

version: "3.9"
services:
  postgres:
    image: postgres:18.3-alpine3.23
    restart: unless-stopped
    network_mode: service:solidtime
    environment:
      POSTGRES_PASSWORD: ${RANDOM_PG_PASSWORD}
      POSTGRES_USER: app
  solidtime:
    image: solidtime/solidtime:latest
    restart: unless-stopped
    ports:
      - 8000:8000
    environment:
      APP_DEBUG: "false"
      APP_ENABLE_REGISTRATION: "true"
      APP_ENV: production
      APP_FORCE_HTTPS: "true"
      APP_KEY: base64:${RANDOM_APP_KEY_RAW}
      APP_KEY_RAW: ${RANDOM_APP_KEY_RAW}
      APP_URL: http://localhost
      AUTO_DB_MIGRATE: "true"
      CONTAINER_MODE: http
      DB_CONNECTION: pgsql
      DB_DATABASE: app
      DB_HOST: localhost
      DB_PASSWORD: ${RANDOM_PG_PASSWORD}
      DB_PORT: "5432"
      DB_SSLMODE: disable
      DB_USERNAME: app
      LOG_CHANNEL: stderr
      MAIL_MAILER: log
      QUEUE_CONNECTION: sync
      SUPER_ADMINS: admin@example.com
      TRUSTED_PROXIES: '*'
    volumes:
      - storage:/var/www/html/storage
      - bootstrap-cache:/var/www/html/bootstrap/cache
      - tmp:/tmp
      - run:/var/run
      - supervisor-log:/var/log/supervisor
      - home:/home/octane
    configs:
      - source: solidtime-frankenphp-worker.php
        target: /var/www/html/public/frankenphp-worker.php
        mode: 420
    command:
      - sh
      - -c
      - |
        mkdir -p storage/framework/sessions storage/framework/views storage/framework/cache/data storage/logs storage/app/public bootstrap/cache
        php artisan passport:keys --force
        until php artisan migrate --force >/dev/null 2>&1; do sleep 2; done
        php artisan tinker --execute='$$u=App\Models\User::firstOrCreate(["email"=>"exampleuser@bitflake.com"],["name"=>"Example User","password"=>\Illuminate\Support\Facades\Hash::make("KeepCalmAndHaveAByte"),"email_verified_at"=>now(),"timezone"=>"Europe/London"]);if($$u->wasRecentlyCreated){$$org=App\Models\Organization::create(["user_id"=>$$u->id,"name"=>"Examples Organization","personal_team"=>false,"currency"=>"USD","number_format"=>"point-comma","currency_format"=>"symbol-before-with-space","date_format"=>"slash-separated-mm-dd-yyyy","interval_format"=>"decimal","time_format"=>"12-hours"]);\Illuminate\Support\Facades\DB::table("members")->insert(["id"=>(string)\Illuminate\Support\Str::uuid(),"organization_id"=>$$org->id,"user_id"=>$$u->id,"role"=>"owner","created_at"=>now(),"updated_at"=>now()]);$$u->current_team_id=$$org->id;$$u->save();}' 2>/dev/null || true
        php artisan storage:link || true
        php artisan optimize:clear
        php artisan optimize
        exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.frankenphp.conf
    healthcheck:
      test:
        - CMD
        - curl
        - -f
        - http://localhost:8000/health-check/up
      interval: 10s
      timeout: 5s
      retries: 5
volumes:
  bootstrap-cache: null
  home: null
  run: null
  storage: null
  supervisor-log: null
  tmp: null
configs:
  solidtime-frankenphp-worker.php:
    content: |
      <?php

      // Set a default for the application base path and public path if they are missing...
      $$_SERVER['APP_BASE_PATH'] = $$_ENV['APP_BASE_PATH'] ?? $$_SERVER['APP_BASE_PATH'] ?? __DIR__.'/..';
      $$_SERVER['APP_PUBLIC_PATH'] = $$_ENV['APP_PUBLIC_PATH'] ?? $$_SERVER['APP_PUBLIC_PATH'] ?? __DIR__;

      require __DIR__.'/../vendor/laravel/octane/bin/frankenphp-worker.php';

Volumes

Solidtime stores its data in named Docker volumes, so it survives container restarts and updates:

  • storage mounted at /var/www/html/storage: Laravel storage (Passport oauth keys, framework cache/sessions/views, logs, app files). Subdirs are recreated by the command's mkdir on boot.
  • bootstrap-cache mounted at /var/www/html/bootstrap/cache: Laravel compiled config/routes/events/services + package manifest, regenerated by `artisan optimize` on boot.
  • tmp mounted at /tmp: System temp dir. supervisord (Python tempfile.gettempdir) and the app need a writable /tmp on the read-only root filesystem.
  • run mounted at /var/run: supervisord's unix socket (/var/run/supervisor.sock) and pidfile.
  • supervisor-log mounted at /var/log/supervisor: supervisord's own log file.
  • home mounted at /home/octane: Home dir for FrankenPHP/Caddy's data & config storage (XDG defaults under $HOME).

2. Secret generation

Solidtime needs a few randomly generated secrets — for example, database passwords or an internal session key — before it can start. These are referenced from docker-compose.ymlabove but don't live in it, so they need to end up in your .env file. Pick one of the two options below.

Generating secrets…

3. Start Solidtime with Docker Compose

From the folder with docker-compose.yml and .env, run:

Terminal

Start Solidtime and all its supporting services in the background.

docker compose up -d

The -d flag runs the stack in the background so it keeps running after you close the terminal. Docker will pull the images the first time, which can take a minute or two.

To check on it afterwards: docker compose ps shows whether containers are healthy, and docker compose logs -f follows their logs if something looks wrong. Once it's running, open http://localhost:8000 in your browser.