---
title: "<server> Element"
url: https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/server-descriptor-element
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# \<server> Element

A `server` element defines a server to be deployed on a node. It typically contains at least one [adapter](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/adapter-descriptor-element.md) element, and may supply additional information such as [command-line options](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/using-command-line-options-in-descriptors.md), [environment variables](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/setting-environment-variables-in-descriptors.md), and [configuration properties](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/properties-descriptor-element.md).

This element may only appear as a child of a [node](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/node-descriptor-element.md) element or a [server-template](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/server-template-descriptor-element.md) element.

The following attributes are supported:

| **Attribute** | **Description** | **Required** |
| --- | --- | --- |
| `activation` | Specifies whether the server's [activation](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-server-activation.md) mode. Legal values are `manual`, `on-demand`, `always` and `session`. If not specified, manual activation is used by default. | No |
| `activation-timeout` | Defines the number of seconds a node will wait for the server to [activate](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-server-activation.md). If the timeout expires, the registry answers the locate requests waiting for this server without its endpoints, as described for [IceGrid.Node.WaitTime](https://docs.zeroc.com/ice/3.8/property-reference/icegrid-properties.md#icegrid.node.waittime). If not defined, the default timeout is the value of the [IceGrid.Node.WaitTime](https://docs.zeroc.com/ice/3.8/property-reference/icegrid-properties.md#icegrid.node.waittime) property configured for the server's node. | No |
| `allocatable` | Specifies whether the server can be [allocated](https://docs.zeroc.com/ice/3.8/services/icegrid/resource-allocation-using-icegrid-sessions.md). A server is allocated implicitly when one of its allocatable objects is allocated. The value of this attribute is ignored if the server activation mode is `session`; a server with this activation mode is always allocatable. Otherwise, if not specified and the server activation mode is not `session`, the server is not allocatable. | No |
| `deactivation-timeout` | Defines the number of seconds a node will wait for the server to [deactivate](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-server-activation.md). If the timeout expires, the node terminates the server process. If not defined, the default timeout is the value of the node's configuration property [IceGrid.Node.WaitTime](https://docs.zeroc.com/ice/3.8/property-reference/icegrid-properties.md#icegrid.node.waittime). | No |
| `exe` | The pathname of the server executable. The node resolves a relative path that contains `/`, such as `bin/server`, against the server's working directory: `pwd` when set, otherwise the node's working directory. For a name without `/`, such as `server`, the node searches the `PATH` of the server's environment on Linux and macOS, and the standard Windows search path on Windows. On Windows, the node appends `.exe` to a name without extension, but not to a path: write `bin/server.exe`, not `bin/server`. | Yes |
| `ice-version` | Specifies the Ice version in use by this server. If not defined, IceGrid assumes the server uses the same version that IceGrid itself uses. | No |
| `id` | Specifies the identifier for this server. The identifier must be unique among all servers in the registry. Within the server, child elements can refer to its identifier using the [reserved variable](https://docs.zeroc.com/ice/3.8/services/icegrid/using-descriptor-variables-and-parameters.md) `${server}`. | Yes |
| `pwd` | The default working directory for the server. If not defined, the server is started in the node's current working directory. | No |
| `user` | Specifies the user string from which the node determines the operating system account that runs the server. [Activating Servers with Specific User IDs](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-server-activation.md#activating-servers-with-specific-user-ids) describes how the node maps this value to an account, the user string the node uses when this attribute is not specified, and when the node runs a server as root. | No |

An optional nested [description](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/description-descriptor-element.md) element provides free-form descriptive text.

Here is an example to demonstrate the use of this element:

```xml
<server id="MyServer"
        activation="on-demand"
        activation-timeout="60"
        deactivation-timeout="60"
        exe="/opt/app/bin/myserver"
        pwd="/">
    <option>--Ice.Trace.Network=1</option>
    <env>PATH=/opt/Ice/bin:$PATH</env>
    <property name="ServerId" value="${server}"/>
    <adapter name="Adapter1" .../>
</server>
```

## See Also

- [Adapter Descriptor Element](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/adapter-descriptor-element.md)
- [Properties Descriptor Element](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/properties-descriptor-element.md)
- [Node Descriptor Element](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/node-descriptor-element.md)
- [Server-Template Descriptor Element](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/server-template-descriptor-element.md)
- [Description Descriptor Element](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/description-descriptor-element.md)
- [Using Command Line Options in Descriptors](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/using-command-line-options-in-descriptors.md)
- [Setting Environment Variables in Descriptors](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-xml-reference/setting-environment-variables-in-descriptors.md)
- [IceGrid Server Activation](https://docs.zeroc.com/ice/3.8/services/icegrid/icegrid-server-activation.md)
- [Using Descriptor Variables and Parameters](https://docs.zeroc.com/ice/3.8/services/icegrid/using-descriptor-variables-and-parameters.md)
