> ## Documentation Index
> Fetch the complete documentation index at: https://prefect-bd373955-codex-docket-background-task-ha.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

#  

# `prefect server`

```command theme={null}
prefect server [OPTIONS] COMMAND [ARGS]...
```

<Info>
  Start a Prefect server instance and interact with the database.
</Info>

## `prefect server database`

```command theme={null}
prefect server database [OPTIONS] COMMAND [ARGS]...
```

<Info>
  Interact with the database.
</Info>

### `prefect server database reset`

```command theme={null}
prefect server database reset [OPTIONS]
```

<Info>
  Drop and recreate all Prefect database tables.
</Info>

<AccordionGroup>
  <Accordion title="Options" defaultOpen>
    <ResponseField name="--yes">
      Skip confirmation.
    </ResponseField>
  </Accordion>
</AccordionGroup>

### `prefect server database upgrade`

```command theme={null}
prefect server database upgrade [OPTIONS]
```

<Info>
  Upgrade the Prefect database.
</Info>

<AccordionGroup>
  <Accordion title="Options" defaultOpen>
    <ResponseField name="--yes">
      Skip confirmation.
    </ResponseField>

    <ResponseField name="--revision">
      Alembic revision (default: head).
    </ResponseField>

    <ResponseField name="--dry-run">
      Show migrations without applying.
    </ResponseField>
  </Accordion>
</AccordionGroup>

### `prefect server database downgrade`

```command theme={null}
prefect server database downgrade [OPTIONS]
```

<Info>
  Downgrade the Prefect database.
</Info>

<AccordionGroup>
  <Accordion title="Options" defaultOpen>
    <ResponseField name="--yes">
      Skip confirmation.
    </ResponseField>

    <ResponseField name="--revision">
      Alembic revision (default: -1).
    </ResponseField>

    <ResponseField name="--dry-run">
      Show migrations without applying.
    </ResponseField>
  </Accordion>
</AccordionGroup>

### `prefect server database revision`

```command theme={null}
prefect server database revision [OPTIONS]
```

<Info>
  Create a new migration for the Prefect database.
</Info>

<AccordionGroup>
  <Accordion title="Options" defaultOpen>
    <ResponseField name="--message">
      Migration message.
    </ResponseField>

    <ResponseField name="--autogenerate">
      Auto-generate from models.
    </ResponseField>
  </Accordion>
</AccordionGroup>

### `prefect server database stamp`

```command theme={null}
prefect server database stamp [OPTIONS] REVISION
```

<Info>
  Stamp the revision table with the given revision; don't run any migrations.
</Info>

<AccordionGroup>
  <Accordion title="Arguments" defaultOpen>
    <ResponseField name="REVISION" type="string" required />
  </Accordion>
</AccordionGroup>

## `prefect server services`

```command theme={null}
prefect server services [OPTIONS] COMMAND [ARGS]...
```

<Info>
  Interact with server loop services.
</Info>

### `prefect server services ls`

```command theme={null}
prefect server services ls [OPTIONS]
```

<Info>
  List all available services and their status.
</Info>

<AccordionGroup>
  <Accordion title="Options" defaultOpen>
    <ResponseField name="--output">
      Specify an output format. Currently supports: json
    </ResponseField>
  </Accordion>
</AccordionGroup>

### `prefect server services list`

```command theme={null}
prefect server services list [OPTIONS]
```

<Info>
  List all available services and their status.
</Info>

<AccordionGroup>
  <Accordion title="Options" defaultOpen>
    <ResponseField name="--output">
      Specify an output format. Currently supports: json
    </ResponseField>
  </Accordion>
</AccordionGroup>

### `prefect server services start`

```command theme={null}
prefect server services start [OPTIONS]
```

<Info>
  Start all enabled Prefect services in one process.
</Info>

<AccordionGroup>
  <Accordion title="Options" defaultOpen>
    <ResponseField name="--background">
      Run the services in the background.
    </ResponseField>
  </Accordion>
</AccordionGroup>

### `prefect server services enable`

```command theme={null}
prefect server services enable [OPTIONS]
```

<Info>
  Start all enabled Prefect services in one process.
</Info>

<AccordionGroup>
  <Accordion title="Options" defaultOpen>
    <ResponseField name="--background">
      Run the services in the background.
    </ResponseField>
  </Accordion>
</AccordionGroup>

### `prefect server services stop`

```command theme={null}
prefect server services stop [OPTIONS]
```

<Info>
  Stop any background Prefect services that were started.
</Info>

### `prefect server services disable`

```command theme={null}
prefect server services disable [OPTIONS]
```

<Info>
  Stop any background Prefect services that were started.
</Info>

### `prefect server services manager`

```command theme={null}
prefect server services manager [OPTIONS]
```

<Info>
  Internal entrypoint for background services.
</Info>

## `prefect server start`

```command theme={null}
prefect server start [OPTIONS]
```

<Info>
  Start a Prefect server instance.
</Info>

<AccordionGroup>
  <Accordion title="Options" defaultOpen>
    <ResponseField name="--host">
      Server host address. \[from PREFECT\_SERVER\_API\_HOST]
    </ResponseField>

    <ResponseField name="--port">
      Server port. \[from PREFECT\_SERVER\_API\_PORT]
    </ResponseField>

    <ResponseField name="--keep-alive-timeout">
      Keep-alive timeout seconds. \[from PREFECT\_SERVER\_API\_KEEPALIVE\_TIMEOUT]
    </ResponseField>

    <ResponseField name="--log-level">
      Server logging level. \[from PREFECT\_SERVER\_LOGGING\_LEVEL]
    </ResponseField>

    <ResponseField name="--scheduler">
      Enable scheduler. \[from PREFECT\_SERVER\_SERVICES\_SCHEDULER\_ENABLED]
    </ResponseField>

    <ResponseField name="--analytics-on">
      Toggle analytics. \[from PREFECT\_SERVER\_ANALYTICS\_ENABLED]
    </ResponseField>

    <ResponseField name="--late-runs">
      Enable late runs. \[from PREFECT\_SERVER\_SERVICES\_LATE\_RUNS\_ENABLED]
    </ResponseField>

    <ResponseField name="--ui">
      Enable the UI. \[from PREFECT\_SERVER\_UI\_ENABLED]
    </ResponseField>

    <ResponseField name="--no-services">
      Only run the webserver API and UI.
    </ResponseField>

    <ResponseField name="--background">
      Run in the background.
    </ResponseField>

    <ResponseField name="--workers">
      Number of worker processes.
    </ResponseField>
  </Accordion>
</AccordionGroup>

## `prefect server status`

```command theme={null}
prefect server status [OPTIONS]
```

<Info>
  Check the status of the Prefect server.
</Info>

<AccordionGroup>
  <Accordion title="Options" defaultOpen>
    <ResponseField name="--wait">
      Wait for the server to become available before returning.
    </ResponseField>

    <ResponseField name="--timeout">
      Maximum number of seconds to wait when using --wait. A value of 0 means wait indefinitely.
    </ResponseField>

    <ResponseField name="--output">
      Specify an output format. Currently supports: json
    </ResponseField>
  </Accordion>
</AccordionGroup>

## `prefect server stop`

```command theme={null}
prefect server stop [OPTIONS]
```

<Info>
  Stop a Prefect server instance running in the background.
</Info>
