How to deploy a site from Git and publish a staging copy

How-to Websites and PHP gitdeploymentstaginghttpstoken

Deploy from an HTTPS repository with a token, create staging.<domain>, test, and publish the files to production without touching the database.

Deploy from Git

  1. Open Websites, Git and pick the site.
  2. Enter the repository's HTTPS URL and the branch. SSH and git:// URLs are not accepted.
  3. For a private repository, add an access token; it is stored encrypted.
  4. Deploy. The panel clones into a work directory outside the web root and publishes to the site's document root without the .git directory. Submodules are not followed.

Use staging

  1. Create the staging site. It is an ordinary site named staging.<domain>, marked noindex in all three web servers.
  2. Point the staging copy of your application at another database. Creating staging does not clone the database, so until you do this staging writes to production's.
  3. Test your change on staging.<domain>.
  4. Publish: the files of staging are copied onto the live site, deleting live files that no longer exist in staging.
Warning: publishing copies files only. It never touches the database, so migrations and content must be handled separately.

Troubleshooting

  • The repository does not show up: check the URL is HTTPS, the branch exists, the token has read access and the site's document root is right.

Last updated: 2026-10-10