Deploy from Git

Put your code live from GitHub, GitLab or Bitbucket.

ServerNest is in development. This guide describes the current preview, and details may change.
  1. Open your app's Deploy from Git page and enter the repository and branch.
  2. ServerNest makes a key on your server and shows the public half.
  3. Add it as a deploy key on GitHub or GitLab, or an access key on Bitbucket. Leave write access off.
  4. Test the connection, add any build commands, then choose Deploy now.
The Deploy from Git page, showing the connected repository, its deploy key and the Deploy now button.
Example from the dashboard. Names and addresses are made up.

Good to know

  • Build commands run as the app's own user, never as root, and are stopped after 15 minutes.
  • The last 5 releases are kept, so you can roll back with one click.
  • Automatic deploys when you push are off until you turn them on. Then add a webhook on the repository, with the secret shown once.
  • Shared paths, such as .env or storage/, are kept across releases.
  • Only owners and admins can change build commands. Developers can deploy and roll back.
  • Using your own GitLab server? Enter its address when you connect. It must be reachable on the internet with HTTPS.

Check each release

  • Before going live: build commands run in the new release. If one fails, the site keeps the release before.
  • After going live: commands that run once the new release is live, for example to clear a cache. If one fails, the release stays live and the log shows why.
  • Health check page: after the switch, ServerNest opens a page you choose. If it doesn't answer with a success code, the release before goes back live. Use a page that fails when your app is broken, such as Laravel's /up.
  • Results on commits: add a token and ServerNest marks each deployed commit as passed or failed on GitHub, GitLab or Bitbucket.

Safety

  • Don't print passwords in build commands, because the output is saved in the deploy log.

← All guides