User Manual

Self-hosting

There are two options for self-hosting a PlayCanvas application on your own domain.

  1. Embed a PlayCanvas hosted application using an iframe.
  2. Download your application from the Editor and upload the files to your own site.

iframe Embedding

When you publish to playcanvas.com, your application is assigned a URL. To embed your application in another page. You can simply include this URL as the src property of an iframe.

<html>
    <head>
        <title>My Great Game</title>
    </head>
    <body>
        <iframe loading="lazy" src="https://playcanv.as/p/PROJECT_ID/"></iframe>
    </body>
</html>

Self-hosting on your own server

In order to host your application independently of PlayCanvas' servers, do the following:

Publish Button

Publish

Download

Self-hosting on GitHub pages

As a PlayCanvas application is static content, GitHub Pages can be used to host your application using the same steps as Self-hosting on your own server.

You will also need to add an extra file named .nojekyll in the GitHub repo root directory to ensure that all files are copied to the final site. This is because some PlayCanvas published files start with an underscore and will be ignored without this file being added.

GitHub Pages Documentation can be found here about usage of the .nojekyll file.

Running a Downloaded Build

You cannot load your application by opening the index.html file in a browser or from a file:// url. You must use a local webserver to load the index.html file using http:// or https://.

There are many options for running a web server. Here are a few: