> For the complete documentation index, see [llms.txt](https://help.diarkis.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.diarkis.io/en/diarkis-modules/p2p/setup-server.md).

# Set Up P2P Module on Server

## Overview <a href="#setting-up-diarkis-room" id="setting-up-diarkis-room"></a>

The P2P module can be set up on a UDP server.

> ⚠ Currently, Diarkis P2P supports only UDP/RUDP.

## Setup

To enable Diarkis P2P, add `"enableP2P": true` to the UDP configuration file.

```json
  "enableP2P": true
```

The configuration file for the UDP server is the argument passed to `diarkisexec.SetupDiarkisUDPServer(path)` within the main function that launches the UDP server.

```go
	// In the example below, configs/udp/main.json is the configuration file.
	diarkisexec.SetupDiarkisUDPServer("/configs/udp/main.json")
```

For more details, please refer to the [diarkisexec API Reference](https://docs.diarkis.io/docs/server/current/diarkis/diarkisexec/index.html).

It is recommended to initially use the server template for easily setting up the server. Refer to [Diarkis Server Template](/en/getting-started/diarkis-server-template.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 dynamically by asking a question.

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

```
GET https://help.diarkis.io/en/diarkis-modules/p2p/setup-server.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.
