> ## Documentation Index
> Fetch the complete documentation index at: https://www.vitalog.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Run Vitalog's API, web app and PostgreSQL with Docker Compose.

Vitalog runs as three services: a Hono API, a Next.js web app and PostgreSQL 17. Docker Compose builds the API and web images from this repository. The API applies Drizzle migrations before starting.

## Prepare the checkout

```sh theme={"system"}
git clone https://github.com/avgeek-oss/vitalog.git
cd vitalog
cp .env.example .env
```

Use a repository account with access if the repository is private. Install Docker with Compose before starting.

## Configure the installation

Edit `.env` with your own values:

* `AUTH_KEY`: a high-entropy primary Bearer key with at least 32 random bytes.
* `POSTGRES_PASSWORD`: the database password used by Compose.
* `ROOT_EMAIL` and `ROOT_PASSWORD`: the root credentials for dashboard sign-in, key generation and OAuth consent. Use at least 15 non-padding password characters. The password must differ from `AUTH_KEY`.
* `DEFAULT_TIMEZONE`: the IANA timezone used for dates and daily summaries.

For a loopback preview, retain `PUBLIC_BASE_URL=http://127.0.0.1:3000`, `API_BASE_URL=http://127.0.0.1:3000` and `UI_BASE_URL=http://127.0.0.1:3001`. Never commit `.env`.

```sh theme={"system"}
docker compose up --build -d
docker compose ps
```

Open `http://127.0.0.1:3001/login`. The API listens on loopback port 3000 and the UI on loopback port 3001. Compose keeps PostgreSQL on its private network and stores its data in a named volume.

## Add public HTTPS origins

Use separate UI and API origins behind your TLS ingress:

```dotenv theme={"system"}
UI_BASE_URL=https://vitalog.example.com
API_BASE_URL=https://vitalog-api.example.com
PUBLIC_BASE_URL=https://vitalog-api.example.com
ALLOWED_HOSTS=vitalog-api.example.com
```

The API must know its exact public origin for OAuth resource and issuer validation. Compose sets `API_INTERNAL_BASE_URL=http://api:3000` for private server reads. Use [Configuration](/configuration) to configure trusted proxies and allowed browser-client origins for your ingress.

For a Towbar deployment, use the [checked-in PostgreSQL, API and web manifests](/towbar).

## Develop locally

The repository requires Node.js 24.16 and npm 11.13. Start PostgreSQL and provide `DATABASE_URL` in `.env`, then run:

```sh theme={"system"}
npm ci
npm run db:migrate
npm run dev
```

In a second terminal, run `npm run dev:web`. The API and web app read the root `.env`. Apply forward migrations with `npm run db:migrate`; do not use schema push for production upgrades.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.