Documentation · Self-hosting
Self-hosting
Run the full ZI² Square stack on your own infrastructure. Requires Node 20+, Postgres 15+, S3-compatible object storage, and an SMTP relay.
Architecture
The deployable artifact is a Node Fastify application serving both the REST API at /api/v1/* and a built React SPA from the root. Data lives in Postgres via Prisma. Document binaries live in S3-compatible object storage. Outbound email uses any SMTP relay, such as your own mail server or a sending service.
A desktop variant ships with an embedded SQLite database and a single-process API for single-user offline use. The desktop variant uses the same Prisma schema with a SQLite-flavored adjustment.
Minimum prerequisites
A Linux server (we test on Ubuntu 22.04 and AlmaLinux 9). 4 vCPU and 8 GB RAM is comfortable for a single-tenant deployment of up to ~100 users.
Node.js 20 LTS, pnpm 9, Postgres 15+, an S3-compatible storage bucket, an SMTP relay, and a domain name with TLS (Let's Encrypt is fine).
Database
Provision a Postgres database and grant the application user CREATE privileges. The schema is applied at deploy time via "prisma db push --skip-generate" (no migration files; the schema is the source of truth).
For multi-tenant deployments with dedicated per-tenant databases, the application creates new databases on demand via the platform-admin tenant-provisioning endpoint. The provisioning user must have CREATEDB privilege on the cluster.
Storage
Document Vault uses an S3-compatible bucket. Configure endpoint, region, access key, secret key, and bucket name in the environment file. Bucket-level encryption is recommended in addition to the application-level ZI² Hybrid envelope.
Secrets
On first launch the deploy script generates per-deployment secrets from a cryptographically secure source (signing, tokens, encrypted credential storage, document envelope keys). The exact list and their environment-variable names are documented in the README of the downloaded artifact so they remain in lock-step with the code version.
Persist the generated env file in the location of your choice, your existing secret manager, an encrypted volume, or a dedicated config directory. Rotating any of these requires a coordinated migration of the data they protect; the artifact ships rotation helpers.
Operating the deployment
The supplied deploy.sh script handles build, schema sync, dependency hot-add, a restart through your process manager, and a web server reload. The application exposes a health endpoint at /api/v1/health; logs go to your process manager's log directory.
For mail-flow self-healing (inbound SMTP probe and milter-chain check), the artifact bundles cron scripts intended to be installed in your system's sbin directory and registered with the system scheduler. See the deployment README for the exact install paths and the cron schedule.
License
The self-hostable distribution is offered under a separate license that accompanies the artifact. Contact [email protected] for terms.