Skip to content

Managing a Running Bot

Terminal window
pywa cloud status [--bot <bot-id>]
pywa cloud stop [--bot <bot-id>]
pywa cloud start [--bot <bot-id>]
pywa cloud restart [--bot <bot-id>]

All four default to the linked bot if --bot is omitted, same as logs. None of them rebuild anything — for that, see Deploying a Pywa Bot.

  • status is queried live, every time you run it — nothing is cached or tracked separately. Shows whether the container is running, its Docker-level status (running, exited, restarting, …), how many times it’s restarted since it was deployed, and when it last started.
  • stop stops the container but doesn’t remove it, so start can resume it later without a rebuild.
  • start resumes a stopped container.
  • restart stops and starts it in place. This does not pick up environment variable changes made since the last deploy — those need deploy again, since restart reuses the exact same container Docker already has, with whatever was injected when it was originally built and run.

Crash recovery — what’s automatic, and what isn’t

Section titled “Crash recovery — what’s automatic, and what isn’t”

Every deploy runs the container with Docker’s --restart unless-stopped policy. In practice:

  • If the container’s own process crashes or exits unexpectedly, Docker restarts it on its own — nothing here needs to notice or act.
  • If you pywa cloud stop it deliberately, Docker respects that and leaves it stopped — it won’t fight you by restarting it. Only start (or a fresh deploy) brings it back.
  • If the machine running Docker reboots, the same policy brings the container back up automatically once Docker itself is running again.

What’s genuinely not covered yet: nobody is watching whether a running container is actually serving traffic correctly — “the process is alive” (which status shows you) and “the process is working correctly” aren’t the same thing, and only the first is currently visible. If your bot is running but silently broken (bad credentials, an unhandled exception in a specific handler, etc.), status will still say running. Check Logs if something seems off despite a healthy-looking status.