The deploy settings file

git, deploy, deploy file, composer, rsync, node.js, python · 0 found this helpful

Every repository needs a deploy file at its top level before it can deploy. The panel makes one for you, so you don't write it by hand.

The Deploy file drawer with the site, what to run, and the Download button

Make the file

  1. Open Account → Hosting → your site → Git and SSH.
  2. Open the repository's menu and choose Deploy file.
  3. Under Copy to, pick the site.
  4. Under Then, pick what to run:
Choice What happens Suits
Copy files Copies the repository into the site's folder Static sites, PHP sites, WordPress themes
Run Composer Installs PHP packages, then copies Laravel and other Composer projects
Restart the app Copies, then restarts the app Node.js and Python apps
  1. Tick Remove files on the site that aren't in the repository if the repository holds the whole site. Leave it off if the site also has files you add by hand.
  2. Click Download.
  3. Put the downloaded file at the top of your repository. Keep its name exactly as it downloads, including the dot at the start. Commit and push.
git add .
git commit -m "Add deploy file"
git push

What the file keeps

Deploys never replace or delete these on the site. A copy in your repository is skipped:

  • .env and .user.ini
  • wp-content/uploads and storage
  • tmp and error_log

Deploys never delete these, even with Remove files on the site that aren't in the repository on. A copy committed in your repository does replace the site's copy:

  • .htaccess
  • .well-known and cgi-bin

Git's own files and the deploy file itself are never copied to the site.

When the repository already has a deploy file

The drawer compares your choices with the file in the repository and shows what would change. Nothing changes until you download the new file and commit it.

For a repository you push to directly, Save on the server writes the file into the server's copy, but only when it has none. Commit it there over SSH before you deploy. Repositories cloned from GitHub or GitLab don't offer Save on the server, because the server's copy only pulls. Download the file and commit it in the original repository instead.

Restore points

When you tick Note the latest restore point before each deploy, each deploy in the history shows the newest backup of that site. If a deploy goes wrong, that tells you which backup to restore. See Backups overview.

If something goes wrong

Problem Fix
The repository still shows Set up deploys The file isn't at the top level, was renamed, or isn't committed yet
A deploy fails at the Composer step Open Log. Memory errors mean the install is too big for your plan. See Use Composer
Files you uploaded by hand disappeared Remove files on the site that aren't in the repository was on. Restore them from a backup and turn it off

Was this helpful?

Still stuck? Ask us and we'll walk you through it.