| 1 | # Netdata Agent Configuration |
| 2 | |
| 3 | :::info |
| 4 | |
| 5 | You can configure Netdata Agents on the fly using Netdata Cloud. Check the [Dynamic Configuration Manager](/docs/netdata-agent/configuration/dynamic-configuration.md) documentation for details. |
| 6 | |
| 7 | ::: |
| 8 | |
| 9 | You configure your Netdata Agent using the main configuration file `netdata.conf`. This guide shows you how to locate, edit, and manage this configuration file. |
| 10 | |
| 11 | ## Locate Your Config Directory |
| 12 | |
| 13 | First, you need to find where your configuration files are stored. On most Linux systems, you'll find your **Netdata config directory** at `/etc/netdata/`. This directory contains: |
| 14 | |
| 15 | - Several configuration files with the `.conf` extension |
| 16 | - A few directories for specific configurations |
| 17 | - A shell script named `edit-config` for safely editing files |
| 18 | |
| 19 | :::tip |
| 20 | |
| 21 | Some operating systems use `/opt/netdata/etc/netdata/` as the config directory. |
| 22 | If you're **not sure where yours is located**, navigate to `http://NODE:19999/netdata.conf` in your browser (replace `NODE` with your node's IP address or hostname) and find the `# config directory =` setting. The value listed shows your system's config directory. |
| 23 | |
| 24 | ::: |
| 25 | |
| 26 | :::note |
| 27 | |
| 28 | All of Netdata's documentation **assumes your config directory is at** `/etc/netdata`, and that you run any scripts from inside that directory. |
| 29 | |
| 30 | ::: |
| 31 | |
| 32 | ## Edit Configuration Files |
| 33 | |
| 34 | <details> |
| 35 | <summary><strong>Method 1: Using `edit-config` (Recommended)</strong></summary> |
| 36 | |
| 37 | You should use the `edit-config` script for making configuration changes. This script lives inside your config directory and helps you manage and safely edit configuration files. |
| 38 | |
| 39 | To edit `netdata.conf`: |
| 40 | |
| 41 | 1. Navigate to your config directory and run the edit script: |
| 42 | |
| 43 | ```bash |
| 44 | cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata |
| 45 | sudo ./edit-config netdata.conf |
| 46 | ``` |
| 47 | |
| 48 | 2. Your default editor will open with the configuration file |
| 49 | 3. Make your changes and save the file |
| 50 | |
| 51 | </details> |
| 52 | |
| 53 | <details> |
| 54 | <summary><strong>Method 2: Download Current Configuration</strong></summary> |
| 55 | |
| 56 | If you want to work with the exact configuration currently running on your Agent, you can download it directly. |
| 57 | |
| 58 | You can download the running version of `netdata.conf` from your running Netdata Agent at this URL: |
| 59 | |
| 60 | ```url |
| 61 | http://agent-ip:19999/netdata.conf |
| 62 | ``` |
| 63 | |
| 64 | To download and replace your current configuration file: |
| 65 | |
| 66 | ```bash |
| 67 | cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata |
| 68 | curl -ksSLo /tmp/netdata.conf.new http://localhost:19999/netdata.conf && sudo mv -i /tmp/netdata.conf.new netdata.conf |
| 69 | ``` |
| 70 | |
| 71 | This method is useful when you want to: |
| 72 | |
| 73 | - Backup your current running configuration |
| 74 | - Start with the default settings that are currently active |
| 75 | - Replicate configuration across multiple agents |
| 76 | |
| 77 | </details> |