Skip to Content
TimeWren Docs
Install

From source

Build the TimeWren image yourself from a clone with Docker Compose, or run the development server with Node.js and PostgreSQL.

Choose this method if you want to run modified code or contribute. If you only want to run TimeWren, the prebuilt image in Docker Compose is simpler and needs far less memory.

Build the image yourself

Requirements

  • Docker Engine with Compose v2.24 or newer.
  • About 4 GB of RAM or more for the build; it takes roughly 7 to 11 minutes and around 5 GB at peak.
  • About 10 GB of free disk space.

Steps

  1. Clone the repository and create .env.

    git clone https://github.com/timewren/timewren.git
    cd timewren
    cp .env.example .env
    for v in POSTGRES_PASSWORD BETTER_AUTH_SECRET ENCRYPTION_KEY CRON_SECRET; do
      sed -i "s|^$v=.*|$v=$(openssl rand -hex 32)|" .env
    done
  2. Set NEXT_PUBLIC_APP_URL in .env to the URL people will open.

  3. In docker-compose.yml, comment out the image: line of the app service and uncomment the build: block below it.

  4. Build and start.

    docker compose up -d --build

    The cron service uses the prebuilt image by default. If you change scripts/cron.mjs or want it to run your build, also point the cron service at your image or build it in the same way.

The build arguments NEXT_PUBLIC_DESKTOP_RELEASES_REPO, NEXT_PUBLIC_REALTIME_ENABLED, NEXT_PUBLIC_PLAUSIBLE_SCRIPT_URL, NEXT_PUBLIC_SENTRY_DSN and NEXT_PUBLIC_SENTRY_BROWSER_ENABLED are compiled into the browser bundle, so changing them in .env needs docker compose up -d --build again. The app URL, marketing URL and brand are read at runtime and need no rebuild.

The compose build block sets the build argument BUILD_PROFILE: selfhost. That profile leaves the Cloud marketing site (pricing, blog, landing pages) and the TimeWren website out of the build, so the build is shorter and the image smaller. The cookies, contact, download and account-deletion pages, the instance's own privacy, GDPR, terms and data processing pages, and the app itself are unaffected. The prebuilt image is built this way. To build the full app, including the marketing pages that NEXT_PUBLIC_MARKETING_URL enables, remove the argument or set BUILD_PROFILE: full.

You can also run the checkout's installer, ./scripts/install.sh. In a checkout it builds the image and starts the stack with docker compose up -d --build, on every run. See One-line install.

Run the development server

Requirements

  • Node.js 26 or newer and npm.
  • Docker, for the development PostgreSQL container.

Steps

  1. Clone the repository and install dependencies.

    git clone https://github.com/timewren/timewren.git
    cd timewren
    npm ci
  2. Create .env.local with at least a database URL and an auth secret. The development container from docker-compose.dev.yml listens on port 5432 with database freelance_crm and user and password postgres.

    DATABASE_URL=postgresql://postgres:postgres@localhost:5432/freelance_crm
    BETTER_AUTH_SECRET=replace-with-a-long-random-string
    NEXT_PUBLIC_APP_URL=http://localhost:3000
    CRON_SECRET=replace-with-another-random-string
  3. Start PostgreSQL, apply migrations and start the server.

    npm run docker:up
    npm run db:migrate
    npm run dev
  4. Open http://localhost:3000.

npm run dev:setup starts PostgreSQL, migrates, seeds demo data and starts the dev server in the background. Other useful commands:

CommandWhat it does
npm run docker:downStops the development PostgreSQL container.
npm run db:seedSeeds the database with test data.
npm run db:studioOpens Drizzle Studio.
npm run buildProduction build.
npm testUnit tests (Vitest, no database needed).
npm run lintBiome linter.

Without NEXT_PUBLIC_MARKETING_URL, the marketing pages of the timewren brand are switched off and / redirects to the dashboard.

Next steps

On this page