2020-04-07 18:55:19 +00:00
---
layout: docs
2022-03-15 23:13:58 +00:00
page_title: Configuration
2020-04-07 18:55:19 +00:00
description: >-
2022-03-15 23:13:58 +00:00
The agent has various configuration options that can be specified via the
command-line or via configuration files. All of the configuration options are
completely optional. Defaults are specified with their descriptions.
2020-04-07 18:55:19 +00:00
---
2022-03-15 23:13:58 +00:00
# Configuration
2020-04-07 18:55:19 +00:00
2022-03-15 23:13:58 +00:00
The agent has various configuration options that can be specified via
the command-line or via configuration files. All of the configuration
options are completely optional. Defaults are specified with their
descriptions.
2020-04-07 18:55:19 +00:00
2022-03-15 23:13:58 +00:00
Configuration precedence is evaluated in the following order:
2020-04-07 18:55:19 +00:00
2022-01-11 01:30:50 +00:00
1. [Command line arguments](/docs/agent/config/cli-flags)
2. [Configuration files](/docs/agent/config/config-files)
2020-04-07 18:55:19 +00:00
2022-03-15 23:13:58 +00:00
When loading configuration, the Consul agent loads the configuration from files and
directories in lexical order. For example, configuration file
`basic_config.json` will be processed before `extra_config.json`. Configuration
can be in either [HCL](https://github.com/hashicorp/hcl#syntax) or JSON format.
Available in Consul 1.0 and later, the HCL support now requires an `.hcl` or
`.json` extension on all configuration files in order to specify their format.
Configuration specified later will be merged into configuration specified
earlier. In most cases, "merge" means that the later version will override the
earlier. In some cases, such as event handlers, merging appends the handlers to
the existing configuration. The exact merging behavior is specified for each
option below.
The Consul agent also supports reloading configuration when it receives the
SIGHUP signal. Not all changes are respected, but those that are
documented below in the
[Reloadable Configuration](#reloadable-configuration) section. The
[reload command](/commands/reload) can also be used to trigger a
configuration reload.
You can test the following configuration options by following the
[Getting Started](https://learn.hashicorp.com/tutorials/consul/get-started-install?utm_source=consul.io&utm_medium=docs)
tutorials to install a local agent.
## Ports Used
Consul requires up to 6 different ports to work properly, some on
TCP, UDP, or both protocols.
Review the [required ports](/docs/install/ports) table for a list of
required ports and their default settings.
## Reloadable Configuration
Reloading configuration does not reload all configuration items. The
items which are reloaded include:
- ACL Tokens
2022-01-11 01:30:50 +00:00
- [Configuration Entry Bootstrap](/docs/agent/config/config-files#config_entries_bootstrap)
2022-03-15 23:13:58 +00:00
- Checks
2022-01-11 01:30:50 +00:00
- [Discard Check Output](/docs/agent/config/config-files#discard_check_output)
2022-03-15 23:13:58 +00:00
- HTTP Client Address
- Log level
2022-01-11 01:30:50 +00:00
- [Metric Prefix Filter](/docs/agent/config/config-files#telemetry-prefix_filter)
- [Node Metadata](/docs/agent/config/config-files#node_meta)
2022-03-15 23:13:58 +00:00
- Some Raft options (since Consul 1.10.0)
2022-01-11 01:30:50 +00:00
- [`raft_snapshot_threshold`](/docs/agent/config/config-files#_raft_snapshot_threshold)
- [`raft_snapshot_interval`](/docs/agent/config/config-files#_raft_snapshot_interval)
- [`raft_trailing_logs`](/docs/agent/config/config-files#_raft_trailing_logs)
2022-03-15 23:13:58 +00:00
- These can be important in certain outage situations so being able to control
them without a restart provides a recovery path that doesn't involve
downtime. They generally shouldn't be changed otherwise.
2022-01-11 01:30:50 +00:00
- [RPC rate limiting](/docs/agent/config/config-files#limits)
- [HTTP Maximum Connections per Client](/docs/agent/config/config-files#http_max_conns_per_client)
2022-03-15 23:13:58 +00:00
- Services
- TLS Configuration
- Please be aware that this is currently limited to reload a configuration that is already TLS enabled. You cannot enable or disable TLS only with reloading.
2022-04-04 16:01:38 +00:00
- To avoid a potential security issue, the following TLS configuration parameters do not automatically reload when [-auto-reload-config](#_auto_reload_config) is enabled:
- [encrypt_verify_incoming](#encrypt_verify_incoming)
- [verify_incoming](#verify_incoming)
- [verify_incoming_rpc](#verify_incoming_rpc)
- [verify_incoming_https](#verify_incoming_https)
- [verify_outgoing](#verify_outgoing)
- [verify_server_hostname](#verify_server_hostname)
- [ca_file](#ca_file)
- [ca_path](#ca_path)
If any of those configurations are changed while [-auto-reload-config](#_auto_reload_config) is enabled,
Consul will issue the following warning, `Static Runtime config has changed and need a manual config reload to be applied`.
You must manually issue the `consul reload` command or send a `SIGHUP` to the Consul process to reload the new values.
2022-03-15 23:13:58 +00:00
- Watches
<!-- list of reference-style links -->
[go-sockaddr]: https://godoc.org/github.com/hashicorp/go-sockaddr/template