Getting started
Requirements
The hardware and software Hubstruct needs, what each part uses, and what happens when you have less.
Hubstruct runs as a set of Docker containers. Most of them are light; the AI models are what need real hardware, and the GPU most of all. This page covers what to have, and what each part of Hubstruct does with it.
In short
| Minimum | Recommended | |
|---|---|---|
| Operating system | Linux with Docker, or Windows 11 with WSL 2 | Linux (Ubuntu 24.04 or Debian 12) |
| CPU | 4 cores | 8 or more cores |
| Memory | 16 GB | 32 GB |
| GPU | None (the AI steps wait) | NVIDIA, 12 GB of video memory |
| Disk | 40 GB plus your media | An SSD for the database and models |
| Docker | Docker Engine 24 and Compose v2 | The latest of both |
The GPU
The AI steps run on an NVIDIA GPU through the NVIDIA Container Toolkit. Hubstruct is tuned for a card with 12 GB of video memory, such as an RTX 4070 or 3060 12 GB, and fits its models into that:
| Model | Runs in | Used for | Video memory |
|---|---|---|---|
| Gemma 4 (e2b, or e4b) | models | Descriptions, titles, reading text in pictures | About 4 GB (e4b: 7 GB) |
| EmbeddingGemma 2 | models | The search embeddings of text and pictures | About 2 GB |
| d1 2B | models | Smart tags and NSFW scores | About 3.3 GB |
| Face and text detectors | vision | Faces (real and drawn), where text is | Up to 768 MB per model |
The models server starts each model when a step needs it and makes room by stopping an idle one, so there's nothing to switch by hand. With Gemma 4 e2b, all of them fit on a 12 GB card at once; with e4b, it takes turns with d1. Sharing one GPU explains more.
Without a GPU
Hubstruct still runs without one. Uploading, browsing, albums by hand, duplicates and everything that doesn't need a model work normally. The steps that need a model show as waiting on the dashboard and run when a model server becomes reachable. The models server can run on the CPU too (llama-swap's CPU image), but we haven't measured how slow that is yet.
Memory
PostgreSQL, the worker and the API together use 2 to 4 GB in normal use. The rest is for the models when they're loaded on the CPU side, and for your operating system's disk cache, which makes a large database noticeably faster. 16 GB works; 32 GB is comfortable for libraries over 100,000 items.
Disk
Plan for three things:
- The models, about 20 GB, in the
modelsvolume: Gemma, EmbeddingGemma and d1. - The database, roughly 1 GB per 10,000 media. Embeddings and face data are most of it. An SSD makes searching and the album rules faster.
- Your media. Uploads are kept as they are, with a thumbnail and a preview beside each.
S3 storage lives in a folder on the host (./data/storage by default), which you can put on a large, slower disk. See Storage.
CPU
Several steps run on the CPU, with no model: reading file details, making thumbnails, measuring colors and sharpness, and the duplicate check. Each service has a CPU limit (WORKER_CPUS, POSTGRES_CPUS and so on) so a busy one never makes the machine unusable. The defaults suit an 8 to 16 core machine; Scaling explains how to tune them.
Software
- Docker Engine 24+ with Compose v2 (
docker compose, notdocker-compose). - NVIDIA driver 550 or newer, and the NVIDIA Container Toolkit, for the GPU.
- A modern browser: a current Chrome, Edge, Firefox or Safari. The app can be installed as an app on desktop and mobile.
Windows
Hubstruct runs on Windows 11 through Docker Desktop with the WSL 2 backend. GPU access works through WSL with a current NVIDIA driver. Keep the S3 storage folder inside the WSL filesystem, or on a fast local disk: folders shared from Windows into containers are much slower.
The network
Only the app needs to be reachable from your browser, on port 4173 by default. The other services talk to each other on Compose's private network. A few are also published on the machine itself for convenience, such as the API on 3000 and the database on 5432; you can remove those ports if you don't use them. See HTTPS and a domain to put Hubstruct behind a reverse proxy.
Outgoing, Hubstruct needs the internet only to download the images and models on first start, and to reach Google if you use Google sign-in.