Deploy the server

The server is one Docker container. It serves the parent web app, the API for the kid Macs and the Mac app updates. It keeps all data in one folder.

1. Create the files

On the Linux host, make a folder for Guardian:

mkdir -p ~/guardian && cd ~/guardian

Create compose.yaml:

services:
  guardian:
    image: ghcr.io/tubededentifrice/parental-control:latest
    restart: unless-stopped
    env_file: .env
    ports:
      - "127.0.0.1:8787:8787"
    volumes:
      - ./data:/data

If the reverse proxy is on a different host, change the port line to "8787:8787".

Create .env:

PUBLIC_URL=https://guardian.example.org
TZ=Europe/Paris
LLM_BASE_URL=https://api.openai.com/v1
LLM_API_KEY=
LLM_MODEL=gpt-6-luna
VariableValue
PUBLIC_URLThe HTTPS address of the server. No trailing slash.
TZYour time zone. Schedules and daily limits use it. You can change it later in Settings.
LLM_BASE_URLOptional. An OpenAI-compatible endpoint.
LLM_API_KEYOptional. The key for that endpoint.
LLM_MODELOptional. The model name.
LLM_REASONING_EFFORTOptional. low makes decisions faster with reasoning models.
LOG_LEVELOptional. info (default) or debug.

Passkeys and push notifications are bound to the host name of PUBLIC_URL. If you change it later, each parent must add a new passkey and turn on notifications again.

2. Start the server

docker compose up -d
curl -s localhost:8787/healthz

The answer is {"ok":true}. At the first start, the server creates the database and the push keys in data/.

3. Set up the reverse proxy

The proxy must:

  • Pass Host, X-Forwarded-For and X-Forwarded-Proto.
  • Not buffer the event streams (/api/live and /api/device/v1/stream).
  • Keep these streams open for at least 90 seconds without data.
  • Not ask for a login (for example Cloudflare Access). The Mac app cannot pass it. Guardian has its own passkey login.

Caddy:

guardian.example.org {
	reverse_proxy 127.0.0.1:8787
}

nginx, in the server { … } block of the host, with TLS:

location / {
    proxy_pass http://127.0.0.1:8787;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
    proxy_read_timeout 120s;
}

Check from another computer:

curl -s https://guardian.example.org/healthz

The AI decides rule

The server asks the LLM only for groups with the AI decides rule, for example YouTube. The LLM gets the page details, the age of the kid, your instructions and the history of the day. It does not get the name or the birthdate of the kid.

Without the LLM_* variables, these pages get a challenge, and Settings shows “AI not set up”.

Write your rules for the AI in Settings > Instructions for the AI, and in each kid profile. Example: “Science, engineering and learning videos are fine. Block attention-grabbing entertainment such as pranks and challenge videos.”

Build the image yourself

To build from the source in place of the published image:

git clone https://github.com/tubededentifrice/guardian.git
cd guardian
cp deploy/.env.example deploy/.env   # then edit it
docker compose -f deploy/docker-compose.yml up -d --build

The data is then in deploy/data/, and the service name is parental-control.

Next: add the parents.