Deploy with the CLI
- Install the CapRover CLI on your development machine with
npm install -g caprover. - Set up the server first, create an app in its dashboard, and sign in to the HTTPS dashboard URL:
caprover login
In the root of a Git project, add a captain-definition file. For a repository Dockerfile:
{"schemaVersion":2,"dockerfilePath":"./Dockerfile"}
-
Run
caprover deployfrom that project directory and choose the saved server, app, and branch at the prompts. -
The CLI uploads the committed Git content, starts a build, and reports progress.
-
Uncommitted and Git-ignored files are not included.
-
After the first successful run,
caprover deploy -dreuses the saved choices for that directory. -
For a prebuilt image, use
caprover deploy --imageName IMAGEand provide the app/server information when prompted. -
Keep credentials out of shell history and CI logs; deployment tokens are better for app-scoped automation.
-
See the complete CLI command reference.