# Operations

Lifecycle commands for a running sfp server. Every command takes `--tenant`. Add `--ssh-connection` and `--identity-file` when running remotely from your workstation, or omit them when running directly on the server.

***

## Registry credentials

**Export `DOCKER_REGISTRY` + `DOCKER_REGISTRY_TOKEN` to env before every `start` / `stop`** — they are not read from the tenant `.env` that init wrote, only from environment variables. New shell session = re-export.

```bash
export DOCKER_REGISTRY="source.flxbl.io"
export DOCKER_REGISTRY_TOKEN="your-source-flxbl-pat"
```

***

## Commands

| Goal                               | Command                                                          |
| ---------------------------------- | ---------------------------------------------------------------- |
| Start the server                   | `sfp server start --tenant <t> --base-dir /opt/sfp-server`       |
| Stop the server                    | `sfp server stop --tenant <t>`                                   |
| Check health                       | `curl https://sfp.yourcompany.com/health`                        |
| Tail combined server + worker logs | `sfp server logs --tenant <t>`                                   |
| Tail one service                   | `sfp server logs --tenant <t> --service app --tail 200 --follow` |

### `logs` flags

| Flag                             | Default                          | Purpose                        |
| -------------------------------- | -------------------------------- | ------------------------------ |
| `--service <app\|worker\|caddy>` | combined `server hatchet-worker` | Restrict to one service        |
| `--follow`, `-f`                 | off                              | `docker compose logs --follow` |
| `--tail <n>`                     | `100`                            | Lines retrieved per service    |

***

## Updating

For image bumps, drains, and migrations, see [Updating sfp server](/flxbl/sfp-server/setting-up/updating-sfp-server.md).

***

## Getting help

| Channel | Where                                                                                                                                                       |
| ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Logs    | See commands above                                                                                                                                          |
| Health  | See [Step 3](/flxbl/sfp-server/setting-up/setting-up-sfp-server.md#step-3-initialize-and-start-from-your-local-machine) for `/health` shape + 503 semantics |
| Support | Your sfp support channel                                                                                                                                    |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flxbl.io/flxbl/sfp-server/setting-up/setting-up-sfp-server/operations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
