Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.compartment.dev/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through deploying your first application with Compartment. It assumes you already have Compartment installed on a server and the compartment CLI available on your machine. If you haven’t installed Compartment yet, start with the installation guide.
1

Log in to Compartment

Authenticate the CLI against your Compartment installation. Run the following command and enter the email address and password for your Compartment admin account when prompted.
compartment login
On success, the CLI prints your email and the organization you’re logged into:
Logged in as you@example.com in your-org
The CLI saves your session locally so you don’t need to log in again for subsequent commands. You can pass --email to skip the email prompt:
compartment login --email you@example.com
2

Initialize your project

From the root of your repository, run compartment init. This creates a compartment.yml file that links your repository to a Compartment project and defines your first service.
compartment init
The CLI prompts you for a project name, suggesting the current directory name as a default. You can also pass --name to skip the prompt:
compartment init --name my-app
The generated compartment.yml looks like this:
name: my-app

services:
  web: .
This defines a single service named web whose source is the repository root (.). Compartment will auto-detect your build toolchain using Railpack. You can edit this file to add more services, set a custom build command, configure readiness checks, and more — see the compartment.yml reference.
3

Deploy your app

Run compartment deploy from the same directory as your compartment.yml. Compartment uploads your project descriptor, builds your services on the platform, and promotes them to live traffic once they pass readiness checks.
compartment deploy
You’ll see build and readiness progress in your terminal. To target a specific environment, use --env:
compartment deploy --env production
To deploy a single service in a multi-service project, use --service:
compartment deploy --service api
When the deployment finishes, the CLI prints a summary including the live URL for your app.
4

Check deployment status

After deploying, use compartment status to inspect the current state of your project’s services and environments.
compartment status
This shows which version is live, the health of each service, and any recent deployment events. You can scope the output to a specific project or environment:
compartment status --project my-app --env production

Next steps

Now that your first app is live, explore what else Compartment can do:

Multi-service apps

Add more services to your compartment.yml and deploy them as a single unit.

Environment variables

Manage plain and secret variables scoped to environments or services.

Zero-downtime deploys

Understand how Compartment promotes candidates and how to roll back.

compartment.yml reference

Configure build strategies, readiness checks, and access modes.