Requirements
- Node.js 22 or higher
- Git
gh) or the GitLab CLI (glab) is optional. When your project doesn’t have a Git remote yet, the ship and deploy commands can use either one, if you’re signed in, to create the repository for you. Repository creation is available only when running interactively. The CLI can’t create Bitbucket repositories, so if you use Bitbucket, create the repository yourself and add it as a remote before shipping.
Installation
You may install the CLI using Homebrew:Shell completions
The CLI supports tab completions for Bash, Zsh, and Fish. To generate and install completions for your shell, run:Authentication
Before using the CLI, authenticate with your Laravel Cloud account. You can authenticate through your browser, provide an API token through an environment variable, or save API tokens on your machine.Browser authentication
The most direct way to authenticate is through your browser:~/.config/cloud/config.json.
Token authentication
In CI/CD pipelines and other environments without a browser, provide an API token through theLARAVEL_CLOUD_TOKEN environment variable:
LARAVEL_CLOUD_TOKEN is set, it takes precedence over any tokens saved in ~/.config/cloud/config.json, and the CLI writes nothing to disk. An empty value counts as unset, so you can bypass the variable for a single command without unsetting it:
Saving tokens
On a machine you return to, or when you need tokens for several organizations, you may save tokens to~/.config/cloud/config.json using the auth:token command. You can pass the token using the --token option or pipe it to the command:
--remove option accepts a token in the same way:
--show-sensitive to print them in full.
If you have saved tokens for multiple organizations, the CLI prompts you to select an organization when running commands. In non-interactive environments, set a default organization for your repository using cloud repo:config --organization instead. When LARAVEL_CLOUD_TOKEN is set, the --organization option becomes a check rather than a choice: repo:config fails if the token doesn’t belong to the organization you named.
Quick start
The fastest way to get an application running on Laravel Cloud is theship command. From inside your project directory, run:
ship command detects your repository and prompts for a region and application name. It can also sync your .env variables, create databases or caches, and configure features like the scheduler, Laravel Octane, or WebSockets.
You may skip some of the prompts by passing options to the ship command:
Each application belongs to a repository and a root directory. If an application already exists for the same repository and root directory,
ship offers to deploy it instead. When running non-interactively, ship stops and prints the ID of the existing application, which you may pass to cloud deploy.
Starting a new application
To start a new application from a starter kit, run thenew command:
--no-interaction:
--starter-kit option accepts laravel, laravel-react, laravel-vue, laravel-livewire, laravel-svelte, laravel-rust, laravel-go, agent-kit, nextjs, nuxt, express, go, django, fastapi, rails, or astro. The repository you pass to --repository must not exist yet. The command also accepts the --name, --path, --database, --database-preset, and --cluster options. The Laravel starter kits and agent-kit get a MySQL database by default, or Postgres where MySQL isn’t offered. Pass --database=none to skip it. The laravel-rust and laravel-go kits run on Rust and Go, so like the other kits they get no database unless you pass --database.
Deploying
To deploy your application, run thedeploy command from your project directory:
--no-wait option. The CLI prints the deployment ID so you can check on it later:
deploy non-interactively in a repository that doesn’t have a Laravel Cloud application yet, the CLI runs ship to create one. When running interactively, it asks before doing so.
If the environment’s resources are still provisioning, Laravel Cloud queues the deployment and starts it once they’re ready. The CLI waits for the queued deployment to start and then monitors it as usual.
Pushing environment variables
To set variables from your local.env file on the Cloud environment before the deployment starts, pass the --push-env option. The CLI prompts you to choose which variables to push:
--push-env-keys option instead:
Deployment history
To list an environment’s deployments, view a deployment’s details, or view a deployment’s build and deploy logs:deployment:logs command shows each build and deploy step with its status, duration, and output, so you can see which step caused a failed deployment and why.
Repository configuration
To avoid specifying your application and organization on every command, you can save defaults for your repository:.cloud/config.json file in your project root that stores the application_id and organization_id. Subsequent commands use these defaults automatically.
Managing resources
The CLI provides full CRUD operations for Laravel Cloud resources. The following examples show the most common operations.Applications
Environments
environment:update lets you type to filter the list. A few settings work differently from the rest:
--bucket-keysattaches buckets as comma-separatedKEY_ID:DISKentries. Add:defaultto at most one entry to make it the default disk, such as--bucket-keys=flsk-1:local:default,flsk-2:public. The option replaces every attached bucket, so when buckets are already attached, the command asks for confirmation, or requires--forcewhen run non-interactively. Pass an empty string to detach them all. When you run the command interactively, it asks for each bucket, key, and disk in turn.--build-addonssets the build add-ons to install, as comma-separated slugs such asffmpeg. It replaces the installed add-ons, and an empty string removes them all. The change applies on the next deployment.--aws-role-arnsets the IAM role the application assumes, for environments on a dedicated cluster in organizations that bring their own IAM role. Pass an empty string to remove it.--model-gateway-key-idattaches a Model gateway key.
--force when run non-interactively. Laravel Cloud won’t stop an environment while a deployment is in progress, so wait for the deployment to finish, or cancel it in the dashboard, first. Starting an environment deploys it. Pass --redeploy to deploy the commit of the latest deployment instead of the latest commit on the branch. If the environment’s resources are still provisioning, Laravel Cloud queues the deployment, and the CLI waits for it to start.
To set an environment’s primary domain, pass a verified root domain’s ID or name, or pass --clear to unset it. The domain stays attached either way:
laravel.cloud subdomain, pass only the first part of the domain. For example, --name=my-app gives my-app.laravel.cloud. The previous domain stops working right away, but the new domain takes effect only on the next deployment. Pass --deploy to deploy the environment right away. You can change the domain once every 30 minutes. When running non-interactively, the command requires the --force option:
environment:purge-edge-cache. By default, the command purges everything cached at the edge. To purge a single path, every path under a prefix, or a Cache-Tag value, use the --path, --prefix, or --tag option. Purging by tag requires a dedicated edge network:
Instances
Databases
database-cluster:stop asks for confirmation. Pass --force to skip it. A Serverless Postgres cluster gets a new hostname when it starts, so redeploy the environments that connect to it once it’s running.
To manage individual databases within a cluster:
database-user:create command accepts the --username, --type, and --database options. The --type option accepts read_write or read_only. Repeat --database to give the user access to several databases. The CLI shows the new user’s password only once, so store it right away. JSON output, which CI and other non-interactive runs use by default, masks the password unless you also pass --show-sensitive.
To open a database in your local database client:
Caches
cache:stop asks for confirmation. Pass --force to skip it.
Object storage
Domains
WebSockets
websocket-cluster:stop asks for confirmation. Pass --force to skip it.
To manage WebSocket applications within a cluster:
Background processes
Scheduled commands
Scheduled commands belong to an instance:--schedule option takes a five-field cron expression, evaluated in UTC, or a shorthand such as @daily:
Deployment webhooks
Deployment webhooks send a signedPOST request to your own endpoint when a deployment goes live, succeeds, or fails. To manage an environment’s webhook endpoints:
webhook-endpoint:create command accepts the --url and --event options. Repeat --event to subscribe to several events: deployment.live, deployment.succeeded, deployment.failed, or deployment.post_deploy_failed. Pass --disabled to create the endpoint without sending it anything yet:
--show-sensitive. Commands that take an existing endpoint accept its ID or its URL. The webhook-endpoint:update command accepts --url, --event, and --enabled=true or --enabled=false. Passing --event replaces the endpoint’s current events.
To send a test ping to an endpoint, list its 50 most recent deliveries, or generate a new signing secret:
webhook-endpoint:test command exits with a non-zero status when the ping fails. When you rotate the secret, the old one stops working right away, so the command asks for confirmation. Pass --force to skip it.
resend:attach command creates a new sending key unless you pass --reuse-key-id. To list your sending domains, or the keys an environment can reuse:
Managed queues
Managed queues are a special kind of instance, so these commands accept an instance ID. If you don’t pass one, the CLI prompts you to select a queue:managed-queue:create command accepts the --name, --size, --max-workers, --visibility-timeout, --polling-interval, and --shutdown-timeout options, so you can create a queue non-interactively. The CLI sends the visibility and shutdown timeouts only when you pass them as options or answer their prompts. Otherwise, Laravel Cloud chooses them. Laravel Cloud applies custom timeouts only for organizations with the advanced managed queues entitlement. Pass --fifo to create a FIFO queue. Laravel Cloud appends .fifo to its name.
To list, retry, or delete a managed queue’s failed jobs:
pause, purge, and delete-failed-job commands accept the --force option to skip the confirmation prompt.
Secrets
Secrets are encrypted values shared across your organization. You can attach them to environments:secret:create and secret:update commands read the secret’s value from STDIN when you don’t pass the --value option. Reading from STDIN keeps the value out of your shell history:
Model gateway
The Model gateway lets your applications call models from many AI providers with one key. To manage your organization’s gateway keys:model-gateway-key:create command accepts the --name, --access-level, and --budget options. The --access-level option accepts external, the default, or internal. The --budget option sets the most the key may spend each billing period, in dollars. The CLI shows the new key only once. To use the key locally right away, pass --save-env, and the CLI writes it to your project’s env file as LARAVEL_CLOUD_MODEL_GATEWAY_API_KEY, the same variable Laravel Cloud injects. The CLI warns you if Git doesn’t ignore that file:
environment:update with the --model-gateway-key-id option. The environment receives it as LARAVEL_CLOUD_MODEL_GATEWAY_API_KEY from its next deployment. Pass an empty string to detach it. The model-gateway-key:update command accepts --name, --access-level, --budget, and --no-budget. Revoking a key also detaches it from every environment and can’t be undone.
To list the models you can call, or view a model’s ID and endpoint:
model-gateway-model:list command accepts --provider and --format filters, each comma-separated.
To view your organization’s credits, buy more, or view the requests, tokens, and cost across your keys:
model-gateway:top-up command charges your organization’s card, so it asks for confirmation, or requires --force when run non-interactively. It accepts the --amount option, in dollars. To top up again whenever the balance falls to a set amount, pass --auto-top-up=true and --threshold:
logs and metrics commands cover the past 24 hours by default. Use the --period option to choose 1h, 24h, 7d, or 30d.
Commands
To run a one-off command on an environment:Tinker
Thetinker command opens an interactive PHP REPL connected to your Laravel Cloud environment. It’s available for PHP environments; for other languages, run commands with cloud command:run. You can execute PHP code directly against your running application:
Editor mode
If you prefer to write code in your editor, use the--editor option:
code, subl, vim, and phpstorm. If you don’t give a value, the CLI uses the VISUAL or EDITOR environment variable.
Non-interactive mode
To execute a single snippet of PHP code without entering the interactive session, use the--code option:
Timeout
By default, code execution times out after 60 seconds. You can adjust this with the--timeout option:
Metrics and usage
To view metrics for an environment, database cluster, cache, WebSocket cluster, or WebSocket application:--period option to choose 1h, 6h, 24h, 3d, 7d, or 30d:
--detailed for a full breakdown by application, resource, and add-on. Pass --environment to filter usage by environment, or --period to view a different billing period. The --period option accepts current, previous, 1, 2, or 3:
Utility commands
Open your application in the Laravel Cloud dashboard:browser command, deploy --open, and deploy:monitor open the environment’s primary custom domain once its hostname and SSL certificate are verified, and its laravel.cloud domain until then.
Retrieve Laravel Cloud IP addresses by region:
Agent skills
The CLI can install Laravel Cloud skills for your AI coding agents. The CLI fetches skills from thelaravel/agent-skills repository and installs them into the appropriate directory for each agent.
Global vs. project installation
By default, the CLI installs skills globally when you installed the CLI globally, and to the current project when the CLI is one of the project’s dependencies. You can override this behavior:Specifying agents
To install skills for specific agents without being prompted:Overwriting existing skills
If you have already installed skills, use the--force flag to overwrite them:
Sending feedback
If the CLI, API, or documentation got in your way, such as a wrong result, a confusing error, a gap in the docs, or a missing endpoint, you can tell the Laravel Cloud team directly from your terminal:--type=question. You can also use the --tool option to name the CLI command, API endpoint, or MCP tool the feedback is about, and the --environment option to reference a specific environment by its ID:
JSON output
Many commands support a--json flag for machine-readable output, which is useful for automation and CI/CD pipelines:
STDOUT and errors to STDERR, so you can pipe the output to tools like jq without filtering out error messages.
Sensitive values, such as environment variables, database and cache passwords, bucket secret keys, WebSocket application secrets, and API tokens, are masked by default. To reveal them, pass --show-sensitive:
--json also disables interactive prompts. In non-interactive environments, such as GitHub Actions and other CI services, prompts are disabled and output is formatted as JSON automatically. Destructive commands, such as environment:delete, require the --force option when run without a terminal, so they never run without your explicit approval.
List commands return at most the first 2,000 results. When a list reaches this limit, the CLI prints a warning.
