Self-hosting a Ionic-Stencil PWA

Self-hosting an Ionic-Stencil PWA is basically the same as self-hosting any normal website. Run npm run build and copy the content of the www folder to the server. You don’t necessarily need a Node server. E.g. if you have an apache or nginx server, you can use that directly.

One thing to look out for in case you use hash-less routing is to configure the server to return the application’s host page ( index.html ) when asked for a file that it does not have, see here (this link is from the Angular documentation, but this applies to all single page apps with hash-less routing).

Also note that PWAs have to be served over https.

1 Like