Deployment
Once your Mayari app works locally, the next step is putting it online. This guide covers what a Mayari backend needs to be hosted, then walks through deploying a real project to Render as an example.
How hosting works
Luau backends can't be deployed to typical serverless or platform-as-a-service hosts directly, so Mayari projects are deployed as containers. When you generate a backend project with the CLI, it already includes a Dockerfile that installs the toolchain, installs your dependencies, builds the project, and starts the server.
Because the Dockerfile is already written for you, any host that can build and run a Docker container will work. Some options:
- Render (used in this guide)
- Google Cloud Run
- Cloudflare Containers
- Fly.io
- Your own VPS with Docker installed
Prerequisites
- A Mayari backend project generated with the CLI (so it includes a
Dockerfile). - Your project pushed to a Git provider such as GitHub. Using Git is strongly recommended, because it lets the host rebuild your app automatically.
- A Render account.
This guide deploys the example to-do app.
Deploying to Render
1. Create a Web Service
After creating your Render account, create a new project. Render will then prompt you to create a service. Render offers many service types; for a Mayari backend, choose Web Services.

2. Connect your repository
Render will ask where your source code lives. You have three options:
- Git Provider: connect GitHub, GitLab, or Bitbucket.
- Public Git Repository: paste the URL of a public repo.
- Existing Image: deploy a prebuilt Docker image.

We recommend Git Provider. The Public Git Repository option works if your project is public, but PR previews and auto-deploys are only available for repositories connected through a Git provider (or configured with Blueprints).

Click your preferred provider, authorize Render, and pick your repository from the list.
3. Configure the service
After you select the repository, Render shows a configuration page. Notice that Language is already set to Docker: Render detects the Dockerfile in your repo and fills this in automatically.

Since the Dockerfile already handles the build and start commands, you can leave most settings as they are. Check that the Branch is the one you want to deploy and pick a Region close to your users.
Choosing an instance type
If you scroll down, you can choose the compute for your service. This example uses the free tier.
Free instances sleep
Free instances spin down after periods of inactivity, so the first request after a quiet period will be slower while the service wakes up. Free instances also don't support SSH access, scaling, one-off jobs, or persistent disks.

If the delay is a problem, you can set up a cron job (for example, an external uptime or cron service) that sends a small request to your backend every 14 minutes or so to keep it awake. Check Render's current free-tier terms and usage limits before relying on this.
Environment variables
Further down is the Environment Variables section. If your app reads environment variables, you need to add them here.
By default, Mayari projects add .env, .env.local, and similar files to .gitignore, because they usually contain sensitive values such as API keys. Don't remove them from .gitignore. Since those files never reach your repository, Render can't see them, so copy each variable into Render manually instead.
The to-do app uses a few, for example:

You can add them one at a time with Add Environment Variable, or paste an entire file with Add from .env.
4. Deploy
Click Deploy web service. Render will now build your Docker image, which can take a few minutes. You can follow the progress in the logs.
When the build succeeds, the logs show that your service is live and give you its primary URL:

5. Visit your app
Open the URL Render gave you. Your backend is now online:

You can try the example app from this guide yourself: todo-app-lg5a.onrender.com
TIP
The example runs on Render's free tier, so if nobody has used it recently it may take a moment to wake up on your first visit. See Choosing an instance type for why.
Updating your app
If you connected a Git provider, pushing new commits to the deployed branch will redeploy your app automatically (unless you've disabled auto-deploy).
Troubleshooting
- The build fails: open the build logs. Most failures come from a missing dependency in
ember.tomlor a Dockerfile change. - The app starts but behaves incorrectly: check that every environment variable from your local
.envfiles has been added in Render. - Requests are slow after a quiet period: on the free tier, Render spins your service down after about 15 minutes without incoming requests, and the next request has to wait for it to wake up. Once it's awake, responses return to normal speed. See Choosing an instance type for ways to work around it.