Deploying to Render โ
Render can host a Leaf app on its free plan, deploying automatically from your git repository. Leaf CLI prepares everything Render needs; you connect the repository once and every push deploys.
Prerequisites โ
- A Render account
- Your app in a git repository on GitHub or GitLab
Prepare your app โ
From your app's root directory:
php leaf deploy --to renderThis writes two things into your project:
- A production
Dockerfile(shared with the Fly setup, it also builds your JavaScript assets) - A
render.yamlblueprint describing your service: docker runtime, free plan and a health check
Render picks its default region unless you choose one (oregon, virginia, ohio, frankfurt or singapore):
php leaf deploy --to render --region frankfurtCommit and push them:
git add . && git commit -m "add render deployment files" && git pushConnect the repository โ
- Open dashboard.render.com
- Click New โ Blueprint
- Connect your repository
Render reads render.yaml and creates the service. From here on, every push to your default branch deploys automatically.
Production secrets โ
Your .env file is never uploaded. The CLI lists the keys your app needs in production; add them under your service's Environment tab in the Render dashboard. APP_ENV and APP_DEBUG are already set by the blueprint.
About the free plan
Free Render services sleep after 15 minutes without traffic and wake on the next request, which takes a few seconds. That's fine for side projects and demos; upgrade the plan in render.yaml when you need an always-on app.
