Requirements

PHP Git Deploy runs on ordinary shared hosting, but the host has to allow a few things. Once the app is installed, its Diagnostics page checks the main server capabilities and says what each failed check affects. The rest you can check in your hosting control panel or with your host before you start.

Required

  • Linux or BSD hosting. Windows servers are not supported.
  • PHP 8.3 or newer, with the phar, ctype and mbstring extensions enabled.
  • proc_open() allowed in PHP. Every Git command runs through it, so without it nothing can deploy.
  • Git installed on the server.
  • An Apache-compatible web server that reads .htaccess files and has mod_rewrite.
  • symlink() allowed in PHP, so the app can point your site's document root at a deployed folder.
  • A domain or subdomain of its own, such as deploy.example.com, with HTTPS enabled. The app runs at the root of that address and redirects plain HTTP to HTTPS.
  • PHP allowed to write to the app's folder, where it creates its .htaccess file, its storage folder and, when updating, a new copy of itself.
  • Access to the sites you deploy. See Where your sites live below.
  • Enough disk space for the app, your repositories and anything your post-deploy commands build.

Where your sites live

The app keeps a copy of each repository in its own storage folder and points each site's document root at it with a symlink. So the app has to reach beyond its own subdomain:

  • The sites it deploys have to be in the same hosting account as the app, so its PHP can create symlinks in their folders.
  • The web server has to be allowed to follow those symlinks into the app's folder: Apache's FollowSymLinks, or SymLinksIfOwnerMatch with both folders owned by the same user.
  • PHP must not be confined to a single site's folder, for example by an open_basedir limit on the app or on the sites it deploys.

Many hosts give one account a main domain plus subdomains or extra domains in a shared space, and that works well: one installation can deploy all of them. The same goes for your own VPS, where one installation can serve every site that runs under the same user. If your host isolates each domain in its own account, install the app inside the same account as the sites it should deploy.

Needed for some features

  • Deploys triggered by a GitHub push: PHP-FPM, or command-line PHP 8.3 or newer on the server with phar, ctype and proc_open(). Either lets these deploys run in the background. Without them, push-triggered deploys can't run, but deploys you start from the app still work.
  • Private repositories over SSH: an SSH client on the server, plus ssh-keygen so the app can create deploy keys.
  • Update checks and installing updates from the app: PHP able to open HTTPS addresses, with allow_url_fopen on, the openssl extension and up-to-date certificates.
  • Post-deploy commands: bash, plus Composer, Node.js, npm, pnpm or Yarn if your commands call them.

Uploading

Use SFTP, or FTP in binary mode. FTP in text (ASCII) mode corrupts the app.

Not needed

You don't need to sign in to your server over SSH or use a command line, and you don't need root access, Docker or a VPS. If you can upload files and your host checks the boxes above, you can deploy from Git.