There are many flags and commands that can be provided to Geth on startup to influence how your node will behave. It is often convenient to configure these options in a file rather than typing them out on the command line every time you start your node. This can be done using a simple shell script to start Geth.
There are also other configuration options that are not accessible from the command line but can be adjusted by providing Geth with a config file. This gives access to lower level configuration that influences how some of Geth's internal components behave.
## Shell scripts
The benefit of writing a shell script for starting a Geth node is that it is more easily repeatable and you don't have to remember lots of syntax for making a node behave in a certain way. This is especially useful for running multiple nodes with their own specific configurations.
To create a shell script, save the Geth startup commands in a shell file, prepended with `#!/bin/bash`. The contents of the file might look like this:
Save the file as (e.g.) `start-geth.sh`. Then make the file executable using
```sh
chmod +x start-geth.sh
```
Now you can start Geth using this shell script instead of having to create the startup configuration from scratch each time:
```sh
./start-geth.sh
```
## Config files
It is also possible to tweak the deeper configuration via a config file. The config file is more complex than a shell script but it can touch parts of the internal configuration structure of Geth that are not accessible through the command line interface.
The config file should be a `.toml` file. A convenient way to create a config file is to get Geth to create one for you and use it as a template. To do this, use the `dumpconfig` command, saving the result to a `.toml` file. Note that you also need to explicitly provide the `network_id` on the command line for the public testnets such as Sepolia or Geoerli:
```sh
./geth --sepolia dumpconfig > geth-config.toml
```
You can change the values in this file and then pass it to Geth on startup so that the node is configured exactly as you want it. To override an option specified in the configuration file, specify the same option on the command line.
To run Geth with the configuration defined in `geth-config.toml`, pass the config file path to `--config`. The `network_id` is not persisted from the config file; it has to be explicitly defined on the command line on startup, for example:
```sh
geth --sepolia --config geth-config.toml
```
### Config file example
The config file created using `dumpconfig` contains the following information (this example is for the Sepolia testnet - Mainnet and other network configurations will be slightly different):