Skip to main content
Geth can be configured with command-line flags or a TOML configuration file. The two approaches can be combined: the file sets defaults that individual flags can override.

Configuration file

Pass a TOML configuration file with --config:

Generating a config file

The easiest way to produce a valid starting configuration is to export the current defaults with dumpconfig:
The output is valid TOML that can be edited and passed back with --config.

Example TOML snippet


Flag reference


Common configuration patterns

1

Generate a baseline config

Export the current defaults so you have a complete starting point:
2

Edit the config file

Open the file and adjust the sections relevant to your deployment. At minimum you will probably want to set DataDir, the HTTP/WS endpoints, and the SyncMode.
3

Start Geth with the config

Flags passed on the command line override values in the file.