> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shipways.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Running commands

> Running something against a site without reaching for SSH.

A site's **Commands** tab runs a shell command against the live release and
streams the output back. `php artisan migrate`, `php artisan cache:clear`, a
one-off script.

## Where it runs

In the **live release**, in the application directory, as the **site's own
account** — exactly like a [deploy script](/sites/deploy-script). A command
cannot reach the machine beyond the site it was run against.

The same `SHIPWAYS_*` variables are in the environment, so `$SHIPWAYS_PHP` gets
this site's PHP version rather than the machine's CLI default.

## It is bounded

A command is stopped after **120 seconds** by default.

That is short on purpose: this is somebody waiting on a page, and a command
that never returns would hold the server's queue lane for as long as the agent
allows. Anything longer belongs in a [deploy script](/sites/deploy-script) or a
[scheduled job](/processes/scheduled-jobs).

Self-hosted installations can change the limit with `SHIPWAYS_COMMAND_TIMEOUT`.

## Permission

Running a command needs permission to **change the site**, because a command
can do anything the deploy script could.

It is not the same as [opening a shell on the server](/organizations#roles),
which is root on the machine. This is the site's account and nothing more.

## History

Every command is kept with who ran it and what it printed. That is the point of
using this rather than SSH: the next person wondering what happened to
production has somewhere to look.
