Auto-deploy on push
Make Alaf Server rebuild and ship your app automatically every time you push to GitHub — from the dashboard or the terminal.
Once your app is deployed, you don't want to click "Deploy" by hand every time you change something. Auto-deploy fixes that: you push your code to GitHub as usual, and Alaf Server rebuilds and ships it for you. Think of it like a doorbell — every time you push, GitHub rings the bell, and Alaf Server answers by shipping the new version.
That doorbell has a name: a webhook. A webhook is just a little message GitHub sends to Alaf Server the instant you push, saying "new code is here" — so Alaf Server can start building without you lifting a finger.
What you need first
- A project that's already linked to a GitHub repository (see Deploy from GitHub).
- A way for GitHub to reach Alaf Server. That's either Alaf Server on a public web address, or a verified domain on the project for direct delivery. More on this below — Alaf Server tells you which one applies.
Turn it on from the dashboard
Open the project's Source tab
Go to your project and open the Source tab. Under Source Repository you'll find the deploy triggers for this repo.
Screenshot
Flip on Auto Deploy
Find the Auto Deploy card and switch its toggle on. When it's on, the card reads Enabled and "Pushes trigger deployments automatically". When it's off, it reads Disabled and "Deployments must be started manually".
That's the whole thing — from now on, every git push to your deploy branch rebuilds and ships automatically.
Screenshot
If Alaf Server asks for a webhook endpoint
Sometimes Alaf Server can't be reached from the public internet on its own (for example, you're running it on your laptop or a private network). When that's the case, you'll see an Enable auto-deploy notice telling you to set a webhook endpoint.
The fix is the Webhook Endpoint card. Pick one of your project's verified domains from the "Select domain..." menu. GitHub will then deliver push events straight to that domain. To stop using it later, open the same menu and choose Clear selection.
Don't see the Webhook Endpoint card?
This card only appears once the project has at least one verified domain. If you have none yet, you'll see just the Enable auto-deploy notice — attach and verify a domain first (see Custom domains), then come back and the card will be here. The menu only ever lists domains that belong to this project and are verified.
Screenshot
Check the status
The Webhook card shows whether GitHub is actually reaching Alaf Server: Active (or Direct, when it's going through your chosen domain) means events are getting through; Inactive means the webhook isn't set up or isn't responding yet. After your next push, this is the card to glance at.
Prefer the terminal?
Everything above works from the CLI too. You'll need the project's ID — run alaf server project list to find it.
# Turn auto-deploy on
alaf server project git auto-deploy <project-id> --enable
# Turn it off again
alaf server project git auto-deploy <project-id> --disable
# Deliver webhooks to a verified project domain (for private instances)
alaf server project git webhook-domain <project-id> deploy.yourapp.com
# Stop using that domain
alaf server project git webhook-domain <project-id> --clearHow the webhook gets wired (the short version)
You don't have to think about this, but here's what happens under the hood so nothing feels like magic. Alaf Server picks the simplest delivery route that works for your setup:
- Public Alaf Server — if your Alaf Server API has a public web address, turning on Auto Deploy registers a webhook on your repo that points at
…/api/webhooks/github. GitHub calls it on every push. - Verified domain — if you set a Webhook Endpoint, GitHub delivers instead to
https://<your-domain>/_alaf server/hooks/github, which routes to Alaf Server. This is the option for private or laptop installs. - Alaf Server Cloud — with the Alaf Server GitHub App installed, push events arrive through the app automatically; there's no per-repo webhook to manage.
In every case, Alaf Server starts a fresh build from the commit you just pushed — the same build you'd get by clicking Deploy.
If something goes wrong
The Auto Deploy toggle won't turn on
You'll see an Enable auto-deploy notice, and the error reads "Set a webhook domain or expose this Alaf Server API on a public URL to enable auto-deploy." GitHub has no way to reach Alaf Server yet. Either put Alaf Server on a public address, or set a Webhook Endpoint domain on the Source tab (see step 3).
“Domain must be verified before it can receive webhooks”
The domain you picked isn't verified yet, so Alaf Server won't route webhooks to it. Verify the domain first (Custom domains), then select it again.
“Could not create webhook”
This means Alaf Server couldn't add the webhook to your repository — usually because your GitHub connection doesn't have admin access to that repo. Reconnect GitHub and make sure the repository is included with full access, then toggle Auto Deploy again.
I pushed, but nothing deployed
Check the Webhook status card on the Source tab. If it says Inactive, delivery isn't reaching Alaf Server — revisit the webhook endpoint above. Also confirm you pushed to the project's deploy branch; pushes to other branches are ignored.