Deployment

How to deploy your application from Git

~5 min read

Connect a GitHub, GitLab, or Bitbucket repository to your application. Every push to your chosen branch triggers an automatic deployment.

Before you start

  • Application already created
  • A Git repository (public or private) hosted on GitHub, GitLab, or Bitbucket

Steps

  1. 1

    Open the Git/Deployment tab

    Open your application, then click the "Git" or "Deployment" tab.

  2. 2

    Paste your repository URL

    Enter the SSH URL of your repository (e.g. git@github.com:username/myrepo.git). Use the SSH URL, not the HTTPS URL — DeployFly connects using an SSH deploy key.

  3. 3

    Add the deploy key to your repository

    DeployFly shows a generated SSH public key. Copy it, then go to your repository Settings → Deploy Keys → Add Key. Paste the key and give it a name like "DeployFly".

  4. 4

    Select the deployment branch

    Enter the branch name to deploy from (e.g. main or production). Only pushes to this branch trigger a deployment.

  5. 5

    Add post-deploy commands (optional)

    Enter shell commands to run after each pull, such as composer install, npm run build, or php artisan migrate. These run in the app's document root.

    composer install --no-dev --optimize-autoloader
    php artisan migrate --force
    php artisan config:cache
    php artisan route:cache
  6. 6

    Connect the repository

    Click "Connect Repository". DeployFly clones the repo and runs an initial deployment. Check the deployment log to confirm it succeeded.

  7. 7

    Add the webhook to your repository

    Copy the webhook URL shown in DeployFly. Go to your repository Settings → Webhooks → Add webhook. Paste the URL, select "Just the push event", and save.

Watch out

  • Post-deploy commands run as the www-data user. Make sure files your app writes are in directories writable by www-data.

Tips

  • The deployment log records every git pull, post-deploy command, and exit code. Check it first if a deployment fails.
  • You can manually trigger a deployment from the panel (without pushing) using the "Deploy Now" button.

Related guides