> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/gateway/getting-started/devolutions-cloud/devolutions-gateway-farms/devolutions-gateway-farms-configuration.md).

# Devolutions Gateway farms configuration

This topic will cover how to configure a Devolutions Gateway farm through the web interface for Devolutions Cloud.

{% hint style="warning" %}
The [PAM service](https://docs.devolutions.net/pam/pam-with-devolutions-cloud/pam-service/) must be installed for Devolutions Gateway farms to work properly.
{% endhint %}

### Configuration

1. In the web interface for Devolutions Cloud, make sure you are connected to the right workspace.
2. Go to ***Administration*** – ***Devolutions Gateway***.
3. Click ***Add*** and click ***Gateway farm***.
4. In the ***General*** tab, provide a name and description for the farm. You can also choose to set this farm as the default.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Only one default setting is allowed at a time, whether it is a gateway or a farm. If a farm is created and set as default while another gateway is the default, the farm becomes the new default. The same applies if a default gateway is moved into a farm, the farm becomes the new default.</p></div>
5. In the ***Members*** tab, click ***Select Farm Members*** to open a dialogue for selecting the gateways to include in the farm.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>A gateway can belong to only one farm at a time. If it is included in a new farm, it will be moved from the current farm.</p></div>
6. In the ***Vaults*** tab, select the vaults that are going to be a part of the farm.
7. In the ***Groups*** tab, select which groups to add to the farm.
8. In the ***Users*** tab, select which users to add to the farm.
9. The ***Farm information*** tab contains information about the farm ID.
10. Click ***Add*** to save the farm.

#### Moving a gateway into a farm

To move a gateway into a farm, there are two ways:

* Use the selection dialogue during the initial configuration; or
* Directly ***Edit*** a gateway and choose the farm in the ***General*** tab.

#### Removing a farm/gateway

To remove a farm, you can choose to delete the gateways within it or only delete the farm. If you delete only the farm, the gateways within it become independent gateways.

### Load balancing

#### Weight

In the ***Members*** tab of the farm's ***Edit*** dialogue, gateways appear in a table with two editable values. The first value is their relative weight. This weight affects load distribution, higher weight increases the chances of a gateway receiving the next session. If all gateways within the farm have the same weight, they have an equal chance of receiving sessions.

**Weight calculations example 1:**

Gateway1 weight = 100 Gateway2 weight = 200 Gateway3 weight = 300 Total weight = 600

Gateway1 probability = 100/600 = 16.66% Gateway2 probability = 200/600 = 33.33% Gateway3 probability = 300/600 = 50%

{% hint style="info" %}
The actual weight values do not matter, only their ratios. So, 1-2-3 is equivalent to 1000-2000-3000.
{% endhint %}

**Weight calculations example 2:**

Gateway1 weight = 1 Gateway2 weight = 2 (UNAVAILABLE) Gateway3 weight = 3 Total weight = 4

In this example, since Gateway2 is unavailable, it is not considered for session distribution.

Gateway1 probability = 25% Gateway3 probability = 75%

{% hint style="info" %}
These are probabilities, not certainties. For example, with 4 sessions, Gateway1 might receive 2 or 3 sessions, despite the 25% probability. Over time, probabilities tend to balance out according to the law of large numbers.
{% endhint %}

#### Drain <a href="#drain" id="drain"></a>

The ***Drain*** button is in the column with the same name. Clicking it makes a gateway unavailable for new sessions. Active sessions continue until completion. It is useful for planned maintenance or updates.

#### After configuration <a href="#after-configuration" id="after-configuration"></a>

Selecting a farm for a session is similar to choosing a regular gateway (under ***Properties*** – ***VPN/SSH/Gateway*** in the Devolutions Cloud web interface). Farms are listed along with individual gateways. A gateway within a farm cannot be selected outside the farm.

The ***Check Health*** button is available for farms. A positive response means at least one gateway in the farm is available. A negative response means no gateways in the farm are available.

Go to ***Reports*** – ***Activity logs*** – ***Log entry*** – ***Details*** to see exactly which ***Gateway*** and ***Gateway farm*** were used for the session.


---

# 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://docs.devolutions.net/gateway/getting-started/devolutions-cloud/devolutions-gateway-farms/devolutions-gateway-farms-configuration.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.
