> For the complete documentation index, see [llms.txt](https://docs.cybus.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cybus.io/data-flows/service-commissioning-files/resources/cybus-server.md).

# Cybus::Server

Offer Connectware data to OPC UA and HTTP clients through a server that Connectware runs for your service.

The **Cybus::Server** resource runs a server that external applications or devices connect to, to read data from Connectware or to write data into it. [Cybus::Node](https://docs.cybus.io/data-flows/service-commissioning-files/resources/cybus-node.md) resources provide the data points of the server, in a hierarchical tree. This gives the data the same structure for every server protocol.

By default, Connectware already includes an internal MQTT broker, [CybusMQ](https://docs.cybus.io/broker/cybusmq.md), which exposes all data through the internal MQTT API. MQTT clients reach the data there without a server resource. A server adds access over another standard protocol, such as OPC UA or HTTP/REST.

## Server Types

The resource type selects the protocol of the server. Each type adds its own properties to the properties on this page.

| Resource Type          | Server                                                                     | Protocol-Specific Properties                                                                      |
| ---------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `Cybus::Server::Opcua` | [OPC UA Server](https://docs.cybus.io/connectors/servers/opc-ua-server.md) | [OPC UA Server Properties](https://docs.cybus.io/connectors/servers/opc-ua-server/opcuaserver.md) |
| `Cybus::Server::Http`  | [HTTP Server](https://docs.cybus.io/connectors/servers/http-server.md)     | [HTTP Server Properties](https://docs.cybus.io/connectors/servers/http-server/httpserver.md)      |

## Server Properties

| Property                    | Type   | Required | Default   |
| --------------------------- | ------ | -------- | --------- |
| [targetState](#targetstate) | `enum` | Optional | `enabled` |

### targetState

The desired state of the server after Connectware starts.

* **Optional**
* Type: `enum`
  * `enabled`: The server starts automatically.
  * `disabled`: The server stays stopped.
* Default: `enabled`

## Example

{% code lineNumbers="true" %}

```yaml
opcuaServer:
  type: Cybus::Server::Opcua # listens on port 4841 by default

httpServer:
  type: Cybus::Server::Http
  properties:
    basePath: /line1 # serves its nodes below /data/line1
```

{% endcode %}

For complete examples with nodes, see [OPC UA Server](https://docs.cybus.io/connectors/servers/opc-ua-server.md) and [HTTP Server](https://docs.cybus.io/connectors/servers/http-server.md).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cybus.io/data-flows/service-commissioning-files/resources/cybus-server.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
