Skip to main content

CLI Commands

Install the CapRover CLI on your computer:

npm install -g caprover
CommandPurpose
caprover serversetupInitialize server and root domain
caprover loginSave a server login
caprover listList saved servers
caprover deployDeploy a branch, archive, or image
caprover logoutRemove a saved login
caprover apiCall the API

Deploy options​

Source (choose one):

  • -b, --branch: Committed Git branch
  • -t, --tarFile: Local archive, including generated files
  • -i, --imageName: Existing Docker image

Destination and authentication:

  • -u, --caproverUrl: Server URL
  • -a, --caproverApp: App name
  • --appToken or CAPROVER_APP_TOKEN: App-scoped deployment token
  • -d, --default: Reuse saved choices

Additional options: -n, --caproverName, -p, --caproverPassword, and -c, --configFile.

Example: Deploy an archive

caprover deploy -u https://captain.apps.example.com -a my-app \
--appToken "$CAPROVER_APP_TOKEN" -t ./deploy.tar
  • Git branch deployments exclude uncommitted and ignored files.
  • Check caprover deploy --help for your installed version.
  • Protect server credentials and keep them out of committed files.
  • See CLI Deployment for the walkthrough.