In short
The phis server, also called the Core, is the central service of a phis installation. It owns the PostgreSQL
schema phis, the Site configuration, drafts and publication state, global users and Site sessions, Media
Spaces, translations and the installed Add-ons. It is for operators who run phis and for developers who
build Sites and Add-ons on it.
How it fits
A Site is a separate Next.js application built from npm packages, including @phis/ui and its Modules. It
reaches the Core from its own server, through same-origin route handlers that phis init generates. The
browser never calls the Core directly. The Core stores everything in PostgreSQL, is installed as a Debian
package that runs under systemd, and is managed with the phis CLI. Add-ons extend the Core, as Modules
extend a Site.
What matters
Sites authenticate with a token. Server-side reads and the proxies carry the Site token in the
Authorization: Bearer header (or x-phis-token). api.internalToken has internal scope.
No cross-origin access. No route sends Access-Control-Allow-* headers, so browser traffic stays
same-origin to the Site.
Configuration is layered. The code default is overridden by config/phis-config.json, then by
config/phis-runtime.json, which holds local values and secrets. The server caches the result for up to
four hours, so restart it after hand edits.
The root is PHIS_ROOT. Without it the server uses /srv/phis/stages/prod in production. Each stage runs
as phis@<stage>.service behind a reverse proxy, bound to 127.0.0.1.
Add-ons are installed, not compiled in. phis addon install puts the artifact under
<PHIS_ROOT>/addons. Only the CLI installs or globally enables Add-on code; a Site enables an installed
Add-on for itself.
Node.js 24.21.0 or later is required. Earlier releases run out of memory under load. The project is
pre-v1: any release may change a contract or a stored shape, so upgrade the packages together.
Example
export PHIS_ROOT=/srv/phis/stages/prod
phis config validate
phis schema apply
systemctl enable --now phis@prod.service