> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# start

> Start the HTTP server with optional HTTPS support.

[securityconfig]: /docs/server-sdks/reference/python/agents/configuration/security-config

Start the HTTP server. Blocks until the server is stopped. Raises
`RuntimeError` if FastAPI or uvicorn are not available.

When `ssl_cert` and `ssl_key` are provided, the server starts with HTTPS.
Otherwise, SSL configuration is loaded from the
[`SecurityConfig`][securityconfig]
environment variables.

## **Parameters**

**`host`** `str` — default: 0.0.0.0

Host address to bind to.

---

**`port`** `int | None` — default: None

Port to bind to. Defaults to the `port` set in the constructor.

---

**`ssl_cert`** `str | None` — default: None

Path to an SSL certificate file. Overrides environment-based SSL
configuration.

---

**`ssl_key`** `str | None` — default: None

Path to an SSL key file. Overrides environment-based SSL configuration.

---

## **Returns**

`None` -- This method blocks and does not return until the server is stopped.

## **Example**

```python {9}
from signalwire import WebService

web = WebService(
    port=8002,
    directories={"/recordings": "./recordings"},
    basic_auth=("admin", "secret"),
    enable_directory_browsing=True
)
web.start(host="0.0.0.0", port=8002)
```

### With HTTPS

```python {7}
from signalwire import WebService

web = WebService(
    port=443,
    directories={"/assets": "./public"}
)
web.start(ssl_cert="cert.pem", ssl_key="key.pem")
```