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

MinimumRecommended
Operating systemLinux with Docker, or Windows 11 with WSL 2Linux (Ubuntu 24.04 or Debian 12)
CPU4 cores8 or more cores
Memory16 GB32 GB
GPUNone (the AI steps wait)NVIDIA, 12 GB of video memory
Disk40 GB plus your mediaAn SSD for the database and models
DockerDocker Engine 24 and Compose v2The 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:

ModelRuns inUsed forVideo memory
Gemma 4 (e2b, or e4b)modelsDescriptions, titles, reading text in picturesAbout 4 GB (e4b: 7 GB)
EmbeddingGemma 2modelsThe search embeddings of text and picturesAbout 2 GB
d1 2BmodelsSmart tags and NSFW scoresAbout 3.3 GB
Face and text detectorsvisionFaces (real and drawn), where text isUp 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 models volume: 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, not docker-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.