Deploy it
Hypha’s CLI writes a deployment folder with everything a deployment needs, then builds and starts it. It asks for what it needs and has a flag for every question, so it runs unattended too.
pnpm hypha init # the deployment folder: target, domains, secretspnpm hypha deploy # build and start itinit writes hypha-deploy/, which git ignores: hypha.json (the deployment’s
settings), .env (its secrets), hypha.config.toml (the API’s settings) and, for a
server, the Docker Compose and Caddy files.
Targets
Section titled “Targets”| Target | What you get |
|---|---|
--target vps |
A server you reach over SSH: Postgres, file storage (SeaweedFS), the API, the admin, the storefront and Caddy for HTTPS, in Docker. Images are built on the server, or here with --build-on here and copied over. |
--target cloudflare |
The API, admin and storefront as Workers, Postgres through Hyperdrive (any Postgres you give it by URL), files in R2, set up with one Cloudflare API token. |
--target local |
The server setup on this machine, under *.hypha.localhost. |
Cloudflare
Section titled “Cloudflare”init links to Cloudflare’s token form with the permissions filled in, then checks the
token and finds your account and zone. deploy then:
- prepares the database (migrations, the store, the owner, the default location);
- creates what’s missing: Hyperdrive, the KV namespaces, the R2 bucket and its domain;
- deploys the API Worker, then the admin and storefront Workers bound to it;
- connects the storefront to the API (its publishable key and webhook).
Compiling the API needs the worker-build tool and the WebAssembly target on the machine
that deploys.
After deploying
Section titled “After deploying”pnpm hypha statusshows what’s running, andpnpm hypha logs [service]follows the logs.- Add apps that deploy beside Hypha with
pnpm hypha apps add stripe(ormeilisearch, or any app’s git URL), and spores withpnpm hypha spores add stripe. The next deploy builds them in.
Emails go to the log until you configure a sender: set email.sender to smtp or
resend in hypha.config.toml, with its secret in .env.