> For the complete documentation index, see [llms.txt](https://open-2c.gitbook.com/url/front-of-house.gitbook.io/hypercast/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://open-2c.gitbook.com/url/front-of-house.gitbook.io/hypercast/self-hosting.md).

# Self Hosting

Hypercast runs on Cloudflare, so if you don't have an account, set one up first. You'll also need to install their CLI tool `wrangler` andl log in.

### Creating your instance

This is all the code it takes to run a simple instance:

```typescript
import { Operator } from 'hypercast/server'
export { Hypercast } from 'hypercast/server'
export default new Operator()
```

To deploy to Cloudflare, you'll also need a `wrangler.toml` config file.

```toml
name = "my-hypercast"
main = "src/index.ts"

account_id = 'abcdefg1234567'
compatibility_date = "2022-12-03"

[durable_objects]
  bindings = [
    { name = "hypercasts", class_name = "Hypercast" }
  ]

[[migrations]]
  tag = "init_hypercast"
  new_classes = ["Hypercast"]
```

With that, simply run `wrangler publish`.

### Connecting to your instance

To connect a Hypercast client to your server instance, we'll need it's URL.

```typescript
import { Operator, Hypercast } from 'hypercast/client'

const operator = new Operator('https://my-hypercast.org.workers.dev')

// or

const hypercast = new Hypercast(topic, 'https://my-hypercast.org.workers.dev')
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://open-2c.gitbook.com/url/front-of-house.gitbook.io/hypercast/self-hosting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
