PORT 8080 requirement
Creating a service
Option A: from-repo (recommended)
Option A: from-repo (recommended)
If you have a GitHub repo, use Response includes the created project, environment, services, and deployment IDs.Private repos: The user must first connect their GitHub account via the Locus dashboard at https://buildwithlocus.com/integrations. Do not send users to the raw GitHub App URL — always direct them to the integrations page.
POST /v1/projects/from-repo to create everything in one call — project, environment, services, and initial deployments. It auto-detects a .locusbuild file for multi-service repos, or creates a single web service with sensible defaults.Option B: Pre-built image (fastest)
Option B: Pre-built image (fastest)
Provide a pre-built Docker image URI. Skips the build step entirely — goes straight from Architecture: Pre-built images must be built for
queued to deploying.linux/arm64. Use docker build --platform linux/arm64 if building on a non-ARM machine. Images built from source (GitHub or git push) are handled automatically.Option C: GitHub repo (manual setup)
Option C: GitHub repo (manual setup)
Create a service with a GitHub source. Use this when you need more control than With
from-repo provides.autoDeploy: true, Locus triggers a new deployment on every push to the configured branch.Choosing a deploy method
One project per codebase
Each distinct codebase or application must get its own project and environment. Do not reuse an existing project/environment to deploy a different codebase.- Deploying
github.com/alice/app-one? Create a new project for it. - Deploying
github.com/bob/app-twonext? Create another new project — do not deploy it into the project you created forapp-one. - A project that previously failed? You may retry in the same project. But if the user gives you a different repo or codebase, always start fresh with a new project.
Service configuration
Runtime fields
Service fields
Build config fields
buildConfig fields are only available via the direct POST /v1/services API. They cannot be set in a .locusbuild file — .locusbuild uses auto-detection for builds. buildArgs are only applied during fresh builds (new deployments from source), not on redeploys.Service URL
The service creation response includes aurl field — the live auto-subdomain URL once deployed:
wss://), and all HTTP methods. No extra configuration needed for WebSocket connections — the edge router forwards Upgrade and Connection headers with a 24-hour connection timeout.
Check service runtime status
runtime_instances:
runtime_instances is cached with a 30-second TTL. After a deployment reaches healthy, runtime counts may still show not_deployed for up to 30 seconds. Use deployment status as the primary readiness signal.Deployment lifecycle
Every deployment moves through a sequence of statuses:
Image deployments skip the
building step entirely.
A deployment in
queued for 2-5 minutes is normal — the build phase starts in the background. Don’t assume something is broken until at least 7-8 minutes have elapsed.Monitor a deployment
Poll every 60 seconds until the status is terminal (healthy, failed, cancelled, or rolled_back).
Deployment details
durationMs— milliseconds from creation to completion (null if still running)lastLogs[]— last 20 log lines from the build or runtime phase (on failed deployments)metadata.phaseTimestamps— workflow timing breakdown:
Monorepo support
For projects with multiple services in a single repo, set arootDir on each service to point to its subdirectory. A single git push uploads the entire repo once and triggers a deployment for each service.
Project configuration (.locusbuild)
A.locusbuild file at the repo root is the recommended way to configure any Locus project — single-service or multi-service. It defines services, addons, environment variables, and build settings in a version-controlled file that Locus auto-detects when using from-repo.
See the SKILL.md monorepo companion guide for the full .locusbuild file format, setup, and examples.
Troubleshooting
Deployment stuck in queued
Deployment stuck in queued
- Deployments in
queuedfor 2-5 minutes is normal — the build is starting up - If stuck for more than 10 minutes, check the deployment logs for errors
- Verify the service configuration is valid (source type, image URI, etc.)
Health check failing
Health check failing
- Ensure your app exposes a health check endpoint returning HTTP 200
- Verify your app listens on port 8080 (the platform auto-injects
PORT=8080) - Alpine images may need
wgetinstalled:apk add --no-cache wget - Check container logs for startup errors (crash loops, missing deps)
Build failing
Build failing
- Check build logs for the specific error
- Verify your Dockerfile is valid (or that auto-detection supports your framework)
- Ensure all build dependencies are available in the build context
- For GitHub sources, confirm Locus has access to the repository