DevelopersSelf-hosting

Self-hosting

You can download any app from the studio and host it yourself. Before you do, know what a plain web host can run and what it cannot.

What you can download

Open the project in the studio and choose Export:

ChoiceWhat you getWhat it is for
Download project<project>.pwpack: the app’s full source, with its pages, data models, rules, starting records, media and pack choicesA copy you keep, or open again with Open from file on the studio’s project list
Download web app<project>-web.tgz: the built site, the same files visitors loadHosting the app yourself

The studio checks the app before either download. An app with errors is not exported. Fix the errors in the chat first.

Hosting the web app

The web app is a folder of static files. Unpack it and serve the folder from any web host that serves files:

mkdir my-app && tar -xzf my-app-web.tgz -C my-app

Serve index.html for any page address that is not a file, as you would for any single-page app.

What works without PhiWebs

  • the pages, their layout, theme and blocks;
  • images and media that are part of the project;
  • data written into a page itself;
  • outside services the app calls directly, when they need no secret and allow calls from your site’s address.

What needs PhiWebs

A published app gets more than its files. At <app>.phiwebs.app, PhiWebs also serves each app’s own addresses under /_host/. A plain web host has none of them, so these parts do not work there:

Part of the appWhy it stops working
The app’s records (every data model: lists, details, forms that save)They live in the published app’s data store and are served from /_host/records. The web app contains no records, not even the starting ones.
Visitor sign-in, roles and the people listSessions and the people list live in the published app.
Access rulesThey are enforced where the records are served.
Connections that use a secretThe secret is added on the server by the published app. It is never in the download.

To run these parts, your server has to provide the same /_host/ addresses and keep the records, sessions and secrets itself. PhiWebs does not provide software for that.

Moving back to PhiWebs

A .pwpack opens as a new project in the studio with Open from file. Publishing it creates a new app with its own address and its own empty data store. Records from another published app do not come with it, except the starting records written in the project.