DocsGet started
Install OwnWing
OwnWing is one Docker Compose stack driven by the ./ownwing script: Caddy (the only open door,
HTTPS for every app), OwnWing ID, Files, and, if you want them, Photos, Notes, Calendar and Reminders, and Contacts, plus any extensions you add.
The same steps work on a laptop, a Linux server and a NAS; what changes is the domain, the
certificates and where the data lives.
What you need
| Docker | Docker Engine (Linux, most NAS systems) or Docker Desktop (Mac). Your user must be able to run docker (on Linux: the docker group) |
| Docker Compose | the docker compose plugin, 2.24 or newer (the CLI refuses older ones) |
| Tools | bash, git; jq to add extensions; sqlite3 or python3 for ./ownwing backup |
| Disk | about 10 GB for the images, plus your photos and files |
| Memory | Photos up to 6 GB and its models up to 10 GB (PHOTOS_MEMORY, PHOTOS_ML_MEMORY), Files up to 2 GB. Leave Photos out on a small machine |
| Ports | 80 and 443, free for Caddy (or two others: below) |
The images build from source on the first ./ownwing up, which takes a while. Photos’ models run on
OpenVINO, made for x86-64 (Intel and AMD) machines.
Run ./ownwing doctor at any time: it checks Docker, Compose, the tools, the ports, the free disk
and whether the names resolve.
With a coding agent
The quickest way: npx ownwing install, then /ownwing init in your agent. It reads the machine,
asks the questions below in plain words, runs the same three steps for you and explains what’s
left (the account link, certificates, DNS). See Set up with a coding agent.
This page is what it does underneath, and how to do it by hand.
The three steps
git clone <repo-url> ownwing && cd ownwing
./ownwing init
./ownwing up
init asks a few questions and writes .env from .env.example:
- the domain: every app lives at
<name>.<domain>(id.,photos.,files., one per extension); - where the apps’ data lives (
OWNWING_DATA, default./data); - where people’s files live (
OWNWING_USERS, default./users); - your username: the account you’ll create at first start (2 to 24 of
a-z,0-9and-, starting with a letter; default: your login name, adjusted to fit); - which apps to run: Photos, Notes, Calendar (with Reminders) and Contacts (OwnWing ID, Files and Caddy always run). Extensions come later, with
./ownwing ext add(Build an OwnWing extension).
It then makes every secret (in <data>/secrets/, readable only by you) and OwnWing ID’s signing
key. You can run it again at any time: your answers become the defaults and secrets are never
replaced. Without a terminal, or with --yes, it asks nothing and takes the flags, then the
environment, then the current .env, then the defaults:
./ownwing init --yes --domain example.com --data /srv/ownwing/data --users /srv/ownwing/users \
--owner alice --apps photos --acme-email [email protected]
./ownwing init --help lists every flag: --domain, --data, --users, --owner, --apps
(photos, notes, calendar, contacts, or none), --http-port, --https-port, --bind, --acme-email, --gpu,
--yes.
up builds what’s missing, starts the stack, waits until every service is healthy and prints the
addresses. The first time, it also prints a one-time setup link for OwnWing ID (valid for 15
minutes). Open it, choose the username you gave init and a passcode, and you are the owner. Your
photos and documents are already waiting in <users>/<username>/. Lost the link?
./ownwing setup-link makes a new one.
On a laptop
The defaults are made for this: the domain ownwing.localhost needs no DNS, because browsers send
every *.localhost name to 127.0.0.1. Open https://id.ownwing.localhost after ./ownwing up.
- Keep it to this machine with
--bind 127.0.0.1(OWNWING_BIND). - Trust the local CA so the browser stops warning:
./ownwing ca. - On a Mac or any filesystem other than Btrfs,
initsetsPHOTOS_ALLOW_NON_BTRFS=1for you (see Photos and Btrfs). - Command-line tools (
curl) may not resolve*.localhost; browsers do. Forcurl, add--resolve id.ownwing.localhost:443:127.0.0.1.
*.localhost always means “this device”, so a phone can’t use it: for the iPhone app, use a real
domain as below.
On a Linux server or a NAS
- Choose a domain. One you own (
example.com), or a name only your network knows (home.example.comserved by your router or a DNS server such as Pi-hole). Every app is a subdomain:id.example.com,photos.example.com,files.example.com, and one per extension (links.example.com). - Point the names at the server. A wildcard record
*.example.com→ the server’s address is simplest. Without wildcards, add one record per app (./ownwing statusprints them all). - Choose the certificates.
- Internal CA (the default): Caddy signs certificates for every host with its own root. Works
on a private network with no internet access. Each device must trust the root once:
./ownwing ca. - Let’s Encrypt:
--acme-email [email protected](OWNWING_ACME_EMAIL). The domain must be public and reach this machine on ports 80 and 443 from the internet.
- Internal CA (the default): Caddy signs certificates for every host with its own root. Works
on a private network with no internet access. Each device must trust the root once:
- Choose where data lives:
--dataon fast storage (an SSD: databases, thumbnails),--userson the big disk (photos and documents). Both should be absolute paths;initmakes them so. ./ownwing init, then./ownwing up.
On a NAS, use folders on its data volume (for example /srv/ownwing/data and /srv/ownwing/users,
or your NAS’s shared folders) rather than the system disk, and run ./ownwing over SSH as the user
who should own the files.
Ports
Caddy is the only service that publishes ports: OWNWING_HTTP_PORT (80) and OWNWING_HTTPS_PORT
(443), on OWNWING_BIND (all addresses by default). When something else already holds 80 or 443,
pick others (--http-port 8080 --https-port 8443): every address then carries the port
(https://id.example.com:8443). Let’s Encrypt still needs ports 80 and 443 from the internet (a router can forward them to yours).
Change the HTTPS port before the first up if you can: OwnWing ID records the core apps’ addresses
when it first starts, so after a later change, update each app’s address in OwnWing ID › Apps too.
Behind a proxy you already run
If Nginx Proxy Manager, Traefik or another proxy already owns 80 and 443, you have two routes.
-
Caddy on other ports, as above: your proxy forwards to Caddy, or people use the port.
-
No Caddy: your proxy talks to the apps directly. Name its Docker network in
.env:OWNWING_PROXY_NETWORK=nginx-proxy-manager_default # `docker network ls` shows it OWNWING_PROXY_HOST=nginx-proxy-manager # its container: the only one whose X-Real-IP is believed./ownwing upthen addscompose.proxy.yaml: Caddy stays off, and OwnWing ID and the apps join that network asid:3000,photos:8080andfiles:8080. Point a proxy host at each, with your proxy’s own certificates. It must passX-Real-IP, websockets, and large, unbuffered uploads with long timeouts (Photos and Files: no body limit, no buffering, an hour); theCaddyfileshows what each app needs. OwnWing ID › Apps › Add a site gives the nginx snippet that puts a site with no sign-in of its own behind OwnWing ID.
Photos
Photos and Btrfs
Photos refuses a library that isn’t on Btrfs: it’s a guard against a drive that failed to mount and
left an empty folder behind. On ext4, APFS or anything else, init sets PHOTOS_ALLOW_NON_BTRFS=1.
The models
Photos works without them, minus search, faces, places and the map. They are not in the images; put
them in <data>/photos/models (or PHOTOS_MODELS) as
apps/photos/docs/operations.md (§ ML models) describes, then
./ownwing up.
An Intel GPU
Photos can use an Intel GPU (/dev/dri) for video transcoding and the models:
./ownwing init --gpu
./ownwing up
--gpu sets OWNWING_GPU=1 and fills in PHOTOS_RENDER_GID and PHOTOS_VIDEO_GID (the host’s
render and video groups); the CLI then adds compose.gpu.yaml to the stack. Without a GPU,
everything runs on the CPU, except Files’ ask your files and summaries: their language model runs
only on the GPU (its files go in the models folder too: operations.md § ML models). Files’ other AI
features (search by meaning, text in scans, document types, duplicates, tips) use Photos’ models
on either.
Where your data lives
<OWNWING_DATA>/ the apps' own state (back it up: ./ownwing backup)
secrets/ every secret and OwnWing ID's signing key (mode 600)
id/ OwnWing ID: people, passkeys, apps, the audit log
photos/data/, photos/models/ Photos' catalogues and thumbnails; its models
files/ Files' databases
caddy/ certificates and the local CA; caddy/sites/ for extra sites
extensions/<id>/ each extension's own data
<OWNWING_USERS>/<username>/ each person's files: Photos/, an extension's own folder, …
<OWNWING_USERS>/.ownwing/photos Photos' trash and kept originals (PHOTOS_APPDATA)
People’s files are plain folders: other tools (a network share, a backup program, a terminal) can use them too, and Photos and Files see the changes.
User and group
Every container runs as OWNWING_UID:OWNWING_GID, Caddy included, so everything under
both folders belongs to that one user and backups never need root. init sets them to the user who
runs it. To have the files owned by another account (the one your NAS shares use), set
OWNWING_UID and OWNWING_GID in .env before ./ownwing up; when you run the CLI as root with
another user set, it hands the folders it creates to that user. One exception: an extension that
runs as root (its compose file asks, and ext add shows it) leaves root-owned folders in its own data.
The people’s folder must exist before up (it is never created on the fly, so a disk that didn’t
mount can’t turn into an empty folder): init creates it on a new install.
People
The owner invites everyone else from OwnWing ID › People › Add a person: a name, a username,
the kind of account and which apps they may use. OwnWing ID gives you an invite link to send them;
they open it, choose a passcode and can add quick sign-in (Face ID, Touch ID, Windows Hello or a fingerprint). Each person gets their own folder
under <users>/<username>/, their own photo library and their own space in each extension that keeps one.
Several installs on one machine
Containers, networks and images are named after COMPOSE_PROJECT_NAME, and no service has a fixed
container name, so a second checkout with another project name, other ports and other folders runs
beside the first (for example a test install bound to 127.0.0.1).
Next
- Configuration: every setting in
.env - Backup and restore
- The iPhone app
- Extensions
- Troubleshooting