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
-
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 -
Set
NEXT_PUBLIC_APP_URLin.envto the URL people will open. -
In
docker-compose.yml, comment out theimage:line of theappservice and uncomment thebuild:block below it. -
Build and start.
docker compose up -d --buildThe
cronservice uses the prebuilt image by default. If you changescripts/cron.mjsor want it to run your build, also point thecronservice 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
-
Clone the repository and install dependencies.
git clone https://github.com/timewren/timewren.git cd timewren npm ci -
Create
.env.localwith at least a database URL and an auth secret. The development container fromdocker-compose.dev.ymllistens on port 5432 with databasefreelance_crmand user and passwordpostgres.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 -
Start PostgreSQL, apply migrations and start the server.
npm run docker:up npm run db:migrate npm run dev -
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:
| Command | What it does |
|---|---|
npm run docker:down | Stops the development PostgreSQL container. |
npm run db:seed | Seeds the database with test data. |
npm run db:studio | Opens Drizzle Studio. |
npm run build | Production build. |
npm test | Unit tests (Vitest, no database needed). |
npm run lint | Biome linter. |
Without NEXT_PUBLIC_MARKETING_URL, the marketing pages of the timewren brand are switched off and / redirects to the dashboard.
Next steps
Kubernetes
Install TimeWren on Kubernetes with the Helm chart: optional bundled PostgreSQL and Valkey, a persistent volume, Ingress and one CronJob per scheduled endpoint.
Environment variables
Complete reference of every TimeWren environment variable: defaults, which ones are required, which are baked in at build time, and what each one does.