---
title: "Using Configuration Files"
url: https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/using-configuration-files
language: ruby
docs_index: https://docs.zeroc.com/llms.txt
---

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

# Using Configuration Files

Programming language: Ruby. Other languages: [C++](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/using-configuration-files/cpp.md), [C#](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/using-configuration-files/csharp.md), [Java](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/using-configuration-files/java.md), [MATLAB](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/using-configuration-files/matlab.md), [PHP](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/using-configuration-files/php.md), [Python](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/using-configuration-files/python.md), [Swift](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/using-configuration-files/swift.md).

A configuration file sets the properties of a communicator. Ice reads this file when you pass the command-line arguments of your program to communicator [initialization](https://docs.zeroc.com/ice/3.8/runtime/communicator/ruby.md#creating-a-communicator), or when you create a [property set](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/ruby.md) from these arguments; the sections below describe how you select the file. You can also load a configuration file into an existing property set with its `load` method.

## Selecting a Configuration File

The [Ice.Config](https://docs.zeroc.com/ice/3.8/property-reference/ice-properties/ruby.md#ice.config) property, set on the command line, names the configuration file:

```shell
./server --Ice.Config=/usr/local/filesystem/config
```

Without `Ice.Config`, Ice loads the file named by the `ICE_CONFIG` environment variable:

```shell
export ICE_CONFIG=/usr/local/filesystem/config
./server
```

When the command line sets `Ice.Config` more than once, the last one applies. A bare `--Ice.Config`, `--Ice.Config=1`, or `--Ice.Config=` tells Ice to use `ICE_CONFIG`. `Ice.Config` set in a configuration file loads no other file.

## Multiple Files and Precedence

Both `--Ice.Config` and `ICE_CONFIG` accept a list of file names separated by commas:

```shell
./server --Ice.Config=/usr/local/filesystem/config,./config
```

Ice loads the files from left to right: when both files set the same property, `./config` wins.

When the command line and a configuration file set the same property, the command line wins, wherever the `--Ice.Config` argument appears on the command line. For example, both of the following commands set `Ice.MessageSizeMax` to `4096`, whatever the configuration file sets:

```shell
./server --Ice.Config=/usr/local/filesystem/config --Ice.MessageSizeMax=4096
./server --Ice.MessageSizeMax=4096 --Ice.Config=/usr/local/filesystem/config
```

## See Also

- [Configuration File Syntax](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/configuration-file-syntax.md)
- [The Properties Class](https://docs.zeroc.com/ice/3.8/runtime/properties-and-configuration/properties-class/ruby.md)
