> 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/dm/setup-server.md).

# Set Up DM Module on Server

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

The DM module must be set up on all Diarkis servers used, including HTTP, UDP, and TCP.

Setup is easily completed by exposing built-in commands to the client.

## Setup <a href="#birutoinkomandowokuraiantonisuru" id="birutoinkomandowokuraiantonisuru"></a>

To expose built-in commands to the client, you can easily set it up by using the `diarkisexec` package.

Add the following code to the main function of your server. Below is a sample setup for a UDP server. The `setup` function of `diarkisexec` must be executed before calling `diarkisexec.StartDiarkis()`.

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

```go
package main

import "github.com/Diarkis/diarkis/diarkisexec"

func main() {
	logConfigPath := "/configs/shared/log.json"
	meshConfigPath := "/configs/shared/mesh.json"

	diarkisexec.SetupDiarkis(logConfigPath, meshConfigPath, &diarkisexec.Modules{
		DM:         &diarkisexec.Options{ConfigPath: "/configs/shared/dm.json", ExposeCommands: true},
	})
	diarkisexec.SetupDiarkisUDPServer("/configs/udp/main.json")
	diarkisexec.StartDiarkis()
}
```

Since you can easily set up a server using a server template, we recommend you start by using this. 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 by asking a question.

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

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