> ## Documentation Index
> Fetch the complete documentation index at: https://home-app.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-hosting

> Upgrading, backing up Home itself, container-path caveats and the security model.

## Upgrading

```bash theme={null}
cd home          # the directory install.sh cloned into
git pull
docker compose up -d --build
```

SQLite migrations apply automatically on boot — downgrades aren't supported,
so back up `data/` before big jumps. `docker compose pull && docker compose
up -d` instead if you run a prebuilt image.

## Backing up Home itself

Everything Home owns is one directory — the `HOME_DATA_DIR` volume:

```bash theme={null}
docker run --rm -v home-data:/data -v $(pwd):/out alpine \
  tar -czf /out/home-backup.tar.gz -C /data .
```

Restore is the reverse: empty the volume and untar back into it. Make sure
`secret.key` is inside the archive (it is, unless you used `HOME_SECRET_KEY`
— in which case keep that value somewhere safe).

## Mounting existing stacks

Home adopts containers by their compose label, but it can only **read** an
existing stack's compose file if the host path is visible inside the
container. If your stacks live at `/etc/dokploy/compose`, `/opt/stacks` or
`/srv/appdata`, mount that directory:

```yaml theme={null}
volumes:
  - /var/run/docker.sock:/var/run/docker.sock
  - home-data:/data
  - /etc/dokploy/compose:/etc/dokploy/compose   # same path inside = zero remapping
```

Mounting at the **same absolute path** means Home reads and runs the file
exactly where Docker expects it. Stacks Home *creates* (inline, template,
git, Minecraft) always work — they live inside `HOME_DATA_DIR`.

## Security model

> [card] The socket is root
>
> `/var/run/docker.sock` is effectively root on the host — that's how Home
> can run compose at all. Anyone who can reach Home's UI can drive Docker.
> Keep it on a network you trust (LAN, Tailscale, or behind SSO).

> [card] Single admin
>
> One account, scrypt-hashed, httpOnly session cookie, login rate
> limiting, passkeys. No multi-user, no roles — by design.

> [card] Secrets encrypted
>
> Integration tokens and webhook secrets are AES-256-GCM encrypted with
> `secret.key`. APIs return hints (`…abcd`), never values.

> [card] CSRF + webhooks
>
> Mutating routes check same-origin. Git webhooks verify HMAC signatures;
> each stack can rotate its secret.

## The `home` CLI

The installer drops a `home` command on the host (`/usr/local/bin`, or
`~/.local/bin`) — a wrapper that docker-execs `node /app/cli/home.mjs`
inside the container, so it runs where the database and native modules
live. It works even when the app is down.

```bash theme={null}
home status              # instance + data-dir summary
home reset-password      # admin password reset (prompt / --password / generated)
home logout              # revoke all sessions
home passkeys clear      # wipe passkeys — recovery when that's what's lost
home mcp-token           # show the MCP bearer token
home reset               # factory reset (deletes home.db, asks to confirm)
```

Single-user by design — one admin account. The CLI's authentication is
filesystem access to `HOME_DATA_DIR`; anyone who can read it already owns
the instance.

## Suggested hardening

1. Serve Home over **Tailscale** (`tailscale serve`) or a reverse proxy with
   TLS rather than a bare LAN IP.
2. Set a strong `HOME_SECRET_KEY` yourself instead of the generated file.
3. Register a **passkey** in Settings → Account once you're on a secure
   context.
4. Use a dedicated `HOME_MCP_TOKEN` per MCP client so you can rotate it
   without touching sessions.


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