Choosing a deploy method
GitHub and git-push sources support automatic builds. Pre-built images must target
linux/arm64.
Creating a service
For GitHub, start with:Deploy a GitHub repository
repo with your repository. Connect private repositories through GitHub integrations first. See authentication to get $TOKEN.
Locus reads .locusbuild when present, or creates a single web service. The response includes the project, environment, services, and deployments. Set autoDeploy: true on a GitHub service to deploy each push to its configured branch.
For manual service creation or a pre-built image, use POST /v1/services. Request fields are in the API reference.
Service configuration
Your container must listen on port 8080. Locus setsPORT=8080. Configure a health check path that returns HTTP 200.
Keep secrets in environment variables. For custom Dockerfile paths, build arguments, and error monitoring, use the service API reference.
Service URL
The creation response includes your service’surl, for example https://svc-abc123.buildwithlocus.com. Service URLs support HTTPS and WebSockets. You can also attach a custom domain.
Deployment lifecycle
Image deployments skip the build step. Source builds typically take 3–7 minutes, and pre-built images take 1–2 minutes.
Monitor a deployment
Follow progress in the dashboard or fetch a deployment by ID:Check deployment status
GET /v1/services/:id?include=runtime.
To cancel, roll back, restart, or redeploy, see the deployment reference.
Monorepo support
A project can contain multiple services from one repository. Set each service’srootDir to its source directory, such as services/api or services/web. One push deploys all services in the project.
Project configuration (.locusbuild)
Keep service, addon, and variable configuration in a.locusbuild file at the repository root. Locus reads it during from-repo setup and git-push deploys.
See the monorepo guide for the file format and variables for a full-stack example.