In short
This guide takes a fresh Linux host from the phis Debian package to a running Core with one Site. It is for
operators setting up phis for the first time. Every step uses the phis command; the full walkthrough also
covers installing from source and from a package tarball.
How it fits
You install the Core, which is the phis server, as a Debian package that runs under systemd, with PostgreSQL
behind it. You then create a Site in the Core and scaffold its Next.js application from npm packages,
including @phis/ui. Modules are added to the Site afterwards, and Add-ons to the Core. A reverse proxy in
front of both serves the browser traffic.
What matters
Prerequisites. Node.js 24.21.0 or later, PostgreSQL with the pg_trgm extension, a reverse proxy
(nginx or Apache) and a system account for the services.
Platforms. The package is published for Debian 13 (trixie) and Ubuntu 24.04 (noble), on amd64 and
arm64. Debian 12 is not served.
Stage layout. The package creates the phis user and the stage /srv/phis/stages/prod. The service is
phis@prod.service and listens on http://127.0.0.1:5301.
Secrets stay private. config/phis-runtime.json holds secrets and is mode 0600, so run the CLI as the
service account or as root.
Restart after changes. The server caches its configuration for up to four hours. Restart it after
commands that change phis-runtime.json, such as phis operator add and phis site add.
Updates. After a server upgrade, run phis schema apply again.
Example
- 1.
Install the package: sudo apt install phis
- 2.
Create the database: phis db bootstrap --admin-uri postgres://<admin>@<host>:5432/postgres --name prod
- 3.
Create the schema: phis schema apply
- 4.
Start the server: systemctl enable --now phis@prod.service
- 5.
Add the first operator: phis operator add --email ops@example.com --password '<password>' --name 'Operations'
- 6.
Create a Site: phis site add --key acme --name 'ACME' --hostname www.acme.example --public-base-url https://www.acme.example --source-locale en --default-locale en --available-locales en,de --support-email support@acme.example
- 7.
Give it an administrator: phis site admin --site acme --email admin@acme.example --password '<password>'
- 8.
Scaffold the Site: phis init acme --path /opt/phis/sources/acme --api-base-url http://127.0.0.1:5301
- 9.
Build a release: phis update acme --path /opt/phis/sources/acme