Acutis Gate appliance for Linux and macOS
=========================================

What you need
  - Linux: Ubuntu Server 22.04 or 24.04, or Debian 12 (other distributions: install Docker first)
  - or macOS 13 or later on a Mac (a Mac Studio runs large models on its GPU): Homebrew (https://brew.sh)
    and the Ollama app (https://ollama.com/download). The model runs on the Mac's GPU; Gate runs in
    containers with Docker Desktop, OrbStack or Colima (Colima is installed for you if none is running).
  - 8 GB RAM minimum; 16 GB or more for a better local model. 40 GB disk.
  - A DNS name for Gate (default: this server's full name), pointing at this server
  - Your license file from https://app.acutisgo.com (Gate -> License): a 14-day trial or paid seats
  - Internet access during install (Docker images, the local model)

Install (about 10 minutes, most of it downloading)
  tar xzf AcutisGate-Linux-<version>.tar.gz
  cd AcutisGate-Linux-<version>
  Linux:  sudo bash install.sh --name gate.corp.example.com --license ~/acutis-gate-L-XXXXXXXX.license
  macOS:  bash install.sh --name gate.corp.example.com --license ~/acutis-gate-L-XXXXXXXX.license
          (as yourself, not sudo; installs into ~/AcutisGate)

  Other options (sudo bash install.sh --help):
    --cert gate.crt --key gate.key   your own certificate (PEM, full chain). Without it the installer
                                     makes a Gate CA on this box: trust tls/ca.crt on your PCs.
    --model none | qwen2.5:7b        the local chat model (default: picked by RAM)
    --dir /opt/acutis-gate           install folder (macOS default: ~/AcutisGate)

Then, in a browser
  1. https://<gate name>/signup and create the first Gate admin.
  2. Admin -> License: load the license file (if you did not give it to the installer).
  3. Identity -> Active Directory: connect your domain. Admin -> Health check names anything left to fix.
  4. The chat (Open WebUI) is at https://<gate name>:8443. Its first account becomes its admin.

What runs (Docker, restarts on boot)
  caddy        TLS on 443 (Gate) and 8443 (chat); port 80 redirects
  gate         Acutis Gate: sign-in, rules, audit, MCP endpoint /api/v1/gate/mcp
  db           Postgres for Gate
  ollama       the local model (Linux: a container on the CPU; macOS: the Ollama app on the GPU)
  open-webui   the chat

Back up /opt/acutis-gate/gate-appliance/.env and /opt/acutis-gate/gate-appliance/tls
(secrets and certificate). The data lives in Docker volumes named acutis-gate_*.

Upgrade
  Unpack the new package and run its install.sh again. Code is replaced; secrets, the certificate,
  the license and all data are kept.

Remove
  cd /opt/acutis-gate/gate-appliance && sudo docker compose down        (keeps the data)
  sudo docker compose down -v                                          (deletes the data too)
