Bring your own app from Git

Last verified

Picked Anything from git? Your site is ready for your own code, from GitHub, GitLab or any other Git host. We install nothing in it: you connect a repository and every deploy builds and publishes it.

What the site runs

Anything from git runs on our PHP stack: nginx and PHP-FPM, with Composer. Until your first deploy it shows a page saying Your site is ready. It suits plain PHP, Symfony, CodeIgniter, Slim, or any app whose pages are files in a public/ folder.

  • For a Laravel app, the Laravel entry is the better pick: Laravel: your first steps.
  • For a Node.js server (Express, Next.js, Nuxt and the like), pick Any Node.js app instead: this site would build your front end, but nothing would start a Node.js server. See Node.js apps.
  • For files only, a static site is simpler.

Connect your repository

  1. Open Sites → your site → Deploys. On a new site the Deploy from your repository panel is already open.
  2. Connect your Git host and pick the repository, or paste its URL. Deploy from Git walks through both, including private repositories.
  3. We look inside the repository (on GitHub, GitLab and connected Git hosts) and show it under Repository layout, starting with We found:, for example PHP app at the top level, web root public/. Build: composer install.
  4. If that is right, press ✓ Deploy this way. Progress shows at the top of the tab.

How we read your repository

We decide what your repository is from the files at its top level:

  • WordPress site: wp-config.php, wp-config-sample.php, wp-load.php or a wp-content/ folder.
  • Laravel app: artisan and composer.json.
  • Symfony app: bin/console and composer.json.
  • PHP app: composer.json, index.php or public/index.php.
  • Node.js app: package.json and no index.html.
  • Static site: index.html or public/index.html (with or without a package.json).
  • Docker project: only Docker files. We do not run Docker, so there is nothing to deploy; put the app itself (composer.json, package.json or index.html) in the repository.

The web root is the folder visitors are served from. On this site it is public/.

When the repository does not fit

The Repository layout panel tells you before anything is deployed:

  • This repository cannot be deployed here as it is. Two layouts cannot be published yet: an app kept in a subfolder (such as app/ or src/), and a PHP app whose pages are not in public/. Move the app to the top of the repository, and the files visitors load (index.php) into public/.
  • This is a Node.js app, and … runs PHP (or another mismatch). The panel lists your options. To go ahead, tick Deploy anyway — I mean to put this repository on … and press Deploy anyway.

What a deploy runs

Each deploy builds in a fresh build container, then publishes to your site:

  1. Install and Build, only when your repository has a package.json: npm ci, then your build script.
  2. Tests, if you set a test command. A failing test stops the deploy and your site stays as it was.
  3. On your site: composer install --no-dev when there is a composer.json.

Change the install, build and test commands under Build steps: Build steps.

A database

This site has no database to start with. To add one, open the site's Databases tab, choose an Engine and press Create database. Your app receives the connection as DB_* environment variables; How your app reads this on the same tab lists them.

Stuck? Contact support — replies within one business day.