The Deploy on Hangar button turns a public repository into a one-click deploy. Whoever clicks it lands on a page that names the repository, lets them pick a region and starts the deploy in their own account.
It suits open source projects, templates and example apps.
The link
The button is a link to /deploy with the repository's address:
https://tryhangar.io/deploy?repo=https://github.com/owner/name
| Parameter | Required | Meaning |
|---|---|---|
repo | Yes | The public https URL of the repository |
branch | No | The branch to deploy. Defaults to main |
The repository must be public and reachable over plain https. Links that carry credentials, another protocol or a query string are refused.
Add it to a README
[](https://tryhangar.io/deploy?repo=https://github.com/owner/name)
Replace owner/name with your repository.
What happens on click
- The visitor sees the repository and signs in or creates an account. They come straight back to the deploy afterwards.
- They choose a name, a branch and a region.
- Hangar creates a project with one service, builds the repository with the automatic builder and deploys it.
The deploy runs in the visitor's account and counts against their plan, not yours.
Make your repository deploy cleanly
- Keep the app at the root of the repository, or ship a Dockerfile.
- Read configuration from environment variables and document the ones that are required.
- Listen on
0.0.0.0.