# Configuring Kirby

## The `config.php`

General Kirby configuration settings, configuration settings for plugins as well as custom configuration settings go into `/site/config/config.php`. The config file contains a return statement with an array of config options:

```php "/site/config/config.php"
<?php

return [
    'debug'            => true,
    'someOtherSetting' => 'something'
];
```

Make sure to only use a single return statement in your `config.php` file (with all your options defined in that one return array).

<warning>
Since Kirby is not being fully initialized yet when reading the configuration, you cannot use the `$kirby` object or `kirby()` helper in the `config.php`.

If you need to set options dynamically, you can use the <a href="https://getkirby.com/docs/reference/system/options/ready">`ready` option</a> with a callback.
</warning>

### Plugin options

You can also set options for your installed plugins in the `site/config/config.php`:

```php "/site/config/config.php"
<?php

return [
    'author.pluginname' => [
        'option' => 'a custom value',
        'another-option' => [
            'with-a-nested-option' => 'also a custom value'
        ]
    ]
];
```

<info>
Please use the exact syntax as in the example above, i.e. with the `author.pluginname` as a single string. The following example will ***not* work**:

```php "/site/config/config.php"
<?php

return [
    'author' => [
        'pluginname' => [
            'option' => 'a custom value',
            'another-option' => [
                'with-a-nested-option' => 'also a custom value'
            ]
        ]
    ]
];
```
</info>

### Using multiple config files

If you want to keep your `config.php` clean when using more complex options, you can outsource them to individual files that you require in the return array:

```php "/site/config/config.php"
return [
  'debug' => true,
  'hooks' => require_once 'hooks.php'
];
```

```php "/site/config/hooks.php"
return [
  // your hooks
];
```

## Using options

Config options can be used anywhere in Kirby with the `$kirby->option()` method:

```php
$kirby->option('someOtherSetting');
```

Or with the `option` helper:

```php
  option('someOtherSetting');
```

You can use dot notation to access nested config options:

```php "site/config/config.php"

return [
	'my' => [
		'option' => 'foo'
	]
];
```

```php
$kirby->option('my.option')
```

### Fallbacks

You can pass option fallbacks as second parameter in the option methods. This can be useful if a option does not necessarily have to be set in the config file.

```php
$kirby->option('someOtherSetting', 'my fallback');
option('someOtherOption', 'my fallback');

```

### All configuration options

<nav class="auto-fill mb-12 text-sm" style="--min: 20rem; --gap: var(--spacing-1)">
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/api" style="text-decoration: none">
		<strong class="block">api</strong>
		Set options for Kirby's REST API	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/auth" style="text-decoration: none">
		<strong class="block">auth</strong>
		Set options for login via the Panel and the API	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/cache" style="text-decoration: none">
		<strong class="block">cache</strong>
		Enables/disables Kirby's cache and sets cache options	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/content" style="text-decoration: none">
		<strong class="block">content</strong>
		Set how Kirby handles content	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/cookie" style="text-decoration: none">
		<strong class="block">cookie</strong>
		Configure the behavior of HTTP cookies	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/cors" style="text-decoration: none">
		<strong class="block">cors</strong>
		Configure CORS headers for cross-origin requests	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/date" style="text-decoration: none">
		<strong class="block">date</strong>
		Setup date handling	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/debug" style="text-decoration: none">
		<strong class="block">debug</strong>
		Enables/disables PHP errors	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/editor" style="text-decoration: none">
		<strong class="block">editor</strong>
		Sets the editor for the debugger	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/email" style="text-decoration: none">
		<strong class="block">email</strong>
		Set options for Kirby's built-in email class	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/error" style="text-decoration: none">
		<strong class="block">error</strong>
		The name of the error page folder	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/fatal" style="text-decoration: none">
		<strong class="block">fatal</strong>
		Custom fatal view that is shown if there's a PHP error	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/home" style="text-decoration: none">
		<strong class="block">home</strong>
		Set the name of the home page folder	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/hooks" style="text-decoration: none">
		<strong class="block">hooks</strong>
		Hook into Kirby events and execute your functions in the background	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/kirbytext" style="text-decoration: none">
		<strong class="block">kirbytext</strong>
		Configure the behavior of KirbyText and particular tags	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/languages" style="text-decoration: none">
		<strong class="block">languages</strong>
		Enables language definitions via the Panel	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/locale" style="text-decoration: none">
		<strong class="block">locale</strong>
		Sets the global locale setting for PHP	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/markdown" style="text-decoration: none">
		<strong class="block">markdown</strong>
		Options for the Markdown parser	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/panel" style="text-decoration: none">
		<strong class="block">panel</strong>
		Options for the Panel	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/query" style="text-decoration: none">
		<strong class="block">query</strong>
		Options for the Kirby query language	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/ready" style="text-decoration: none">
		<strong class="block">ready</strong>
		Inject last minute configuration options	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/remote" style="text-decoration: none">
		<strong class="block">remote</strong>
		Overrides the defaults for requests to remote servers	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/routes" style="text-decoration: none">
		<strong class="block">routes</strong>
		Additional route setup for Kirby's internal router	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/session" style="text-decoration: none">
		<strong class="block">session</strong>
		Configuration settings for Kirby sessions	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/slugs" style="text-decoration: none">
		<strong class="block">slugs</strong>
		Set language for slug generator	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/smartypants" style="text-decoration: none">
		<strong class="block">smartypants</strong>
		Convert typical text formatting issues into a typographically correct version	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/thumbs" style="text-decoration: none">
		<strong class="block">thumbs</strong>
		Set default configuration for thumbs	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/updates" style="text-decoration: none">
		<strong class="block">updates</strong>
		Fine-tunes the update check	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/url" style="text-decoration: none">
		<strong class="block">url</strong>
		Sets the base URL for the site	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/whoops" style="text-decoration: none">
		<strong class="block">whoops</strong>
		Enables/disables the Whoops debugger	</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/system/options/yaml" style="text-decoration: none">
		<strong class="block">yaml</strong>
		Enables the Symfony YAML parser	</a>
	</nav>


## Hooks and Routes

You can register <a href="https://getkirby.com/docs/reference/plugins/extensions/hooks">hooks</a> or <a href="https://getkirby.com/docs/guide/routing">routes</a> in your `config.php` if you don't want to create a plugin for them.

```php "/site/config/config.php"
<?php

return [
  'hooks' => [
    // the hooks definition goes here…
  ],
  'routes' => [
    // the routes definition goes here…
  ]
];
```

### All hooks

<nav class="auto-fill mb-12 text-sm" style="--min: 20rem; --gap: var(--spacing-1)">
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/file-changename-after" style="text-decoration: none">
		<strong class="block">file.changeName:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/file-changename-before" style="text-decoration: none">
		<strong class="block">file.changeName:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/file-changesort-after" style="text-decoration: none">
		<strong class="block">file.changeSort:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/file-changesort-before" style="text-decoration: none">
		<strong class="block">file.changeSort:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/file-create-after" style="text-decoration: none">
		<strong class="block">file.create:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/file-create-before" style="text-decoration: none">
		<strong class="block">file.create:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/file-delete-after" style="text-decoration: none">
		<strong class="block">file.delete:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/file-delete-before" style="text-decoration: none">
		<strong class="block">file.delete:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/file-replace-after" style="text-decoration: none">
		<strong class="block">file.replace:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/file-replace-before" style="text-decoration: none">
		<strong class="block">file.replace:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/file-update-after" style="text-decoration: none">
		<strong class="block">file.update:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/file-update-before" style="text-decoration: none">
		<strong class="block">file.update:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/kirbytags-after" style="text-decoration: none">
		<strong class="block">kirbytags:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/kirbytags-before" style="text-decoration: none">
		<strong class="block">kirbytags:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/kirbytext-after" style="text-decoration: none">
		<strong class="block">kirbytext:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/kirbytext-before" style="text-decoration: none">
		<strong class="block">kirbytext:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/language-create-after" style="text-decoration: none">
		<strong class="block">language.create:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/language-create-before" style="text-decoration: none">
		<strong class="block">language.create:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/language-delete-after" style="text-decoration: none">
		<strong class="block">language.delete:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/language-delete-before" style="text-decoration: none">
		<strong class="block">language.delete:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/language-update-after" style="text-decoration: none">
		<strong class="block">language.update:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/language-update-before" style="text-decoration: none">
		<strong class="block">language.update:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-changenum-after" style="text-decoration: none">
		<strong class="block">page.changeNum:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-changenum-before" style="text-decoration: none">
		<strong class="block">page.changeNum:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-changeslug-after" style="text-decoration: none">
		<strong class="block">page.changeSlug:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-changeslug-before" style="text-decoration: none">
		<strong class="block">page.changeSlug:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-changestatus-after" style="text-decoration: none">
		<strong class="block">page.changeStatus:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-changestatus-before" style="text-decoration: none">
		<strong class="block">page.changeStatus:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-changetemplate-after" style="text-decoration: none">
		<strong class="block">page.changeTemplate:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-changetemplate-before" style="text-decoration: none">
		<strong class="block">page.changeTemplate:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-changetitle-after" style="text-decoration: none">
		<strong class="block">page.changeTitle:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-changetitle-before" style="text-decoration: none">
		<strong class="block">page.changeTitle:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-create-after" style="text-decoration: none">
		<strong class="block">page.create:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-create-before" style="text-decoration: none">
		<strong class="block">page.create:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-delete-after" style="text-decoration: none">
		<strong class="block">page.delete:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-delete-before" style="text-decoration: none">
		<strong class="block">page.delete:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-duplicate-after" style="text-decoration: none">
		<strong class="block">page.duplicate:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-duplicate-before" style="text-decoration: none">
		<strong class="block">page.duplicate:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-render-after" style="text-decoration: none">
		<strong class="block">page.render:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-render-before" style="text-decoration: none">
		<strong class="block">page.render:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-update-after" style="text-decoration: none">
		<strong class="block">page.update:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/page-update-before" style="text-decoration: none">
		<strong class="block">page.update:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/panel-route-after" style="text-decoration: none">
		<strong class="block">panel.route:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/panel-route-before" style="text-decoration: none">
		<strong class="block">panel.route:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/route-after" style="text-decoration: none">
		<strong class="block">route:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/route-before" style="text-decoration: none">
		<strong class="block">route:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/site-changetitle-after" style="text-decoration: none">
		<strong class="block">site.changeTitle:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/site-changetitle-before" style="text-decoration: none">
		<strong class="block">site.changeTitle:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/site-update-after" style="text-decoration: none">
		<strong class="block">site.update:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/site-update-before" style="text-decoration: none">
		<strong class="block">site.update:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/system-exception" style="text-decoration: none">
		<strong class="block">system.exception</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/system-loadplugins-after" style="text-decoration: none">
		<strong class="block">system.loadPlugins:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-changeemail-after" style="text-decoration: none">
		<strong class="block">user.changeEmail:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-changeemail-before" style="text-decoration: none">
		<strong class="block">user.changeEmail:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-changelanguage-after" style="text-decoration: none">
		<strong class="block">user.changeLanguage:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-changelanguage-before" style="text-decoration: none">
		<strong class="block">user.changeLanguage:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-changename-after" style="text-decoration: none">
		<strong class="block">user.changeName:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-changename-before" style="text-decoration: none">
		<strong class="block">user.changeName:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-changepassword-after" style="text-decoration: none">
		<strong class="block">user.changePassword:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-changepassword-before" style="text-decoration: none">
		<strong class="block">user.changePassword:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-changerole-after" style="text-decoration: none">
		<strong class="block">user.changeRole:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-changerole-before" style="text-decoration: none">
		<strong class="block">user.changeRole:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-create-after" style="text-decoration: none">
		<strong class="block">user.create:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-create-before" style="text-decoration: none">
		<strong class="block">user.create:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-delete-after" style="text-decoration: none">
		<strong class="block">user.delete:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-delete-before" style="text-decoration: none">
		<strong class="block">user.delete:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-login-after" style="text-decoration: none">
		<strong class="block">user.login:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-login-before" style="text-decoration: none">
		<strong class="block">user.login:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-logout-after" style="text-decoration: none">
		<strong class="block">user.logout:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-logout-before" style="text-decoration: none">
		<strong class="block">user.logout:before</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-update-after" style="text-decoration: none">
		<strong class="block">user.update:after</strong>
			</a>
		<a class="block p-3 bg-light" href="https://getkirby.com/docs/reference/plugins/hooks/user-update-before" style="text-decoration: none">
		<strong class="block">user.update:before</strong>
			</a>
	</nav>

## Base URL setup

By default, Kirby detects the base URL of your installation from the server configuration. This base URL is then used to generate all resource URLs and links on your site and in the Panel.

If your URLs are incorrect, this may be because of a reverse proxy that sits in between the client and Kirby. For security reasons, the reverse proxy configuration is only respected if you explicitly configure a fixed base URL or a set of possible base URLs with the `url` option:

```php
<?php

return [
  'url' => [
    'https://example.com',
    'https://staging.example.com',
    'http://example.test'
  ]
];
```

You can read more in the <a href="https://getkirby.com/docs/reference/system/options/url">reference</a>.

## Multi-environment setup

You can set different options based on the domain by adding additional config files containing the domain.

### Example setup

```filesystem
/site/config/config.localhost.php
/site/config/config.staging.yourdomain.com.php
/site/config/config.yourdomain.com.php
/site/config/config.www.yourdomain.com.php
```

By setting different options in those config files, you get a very flexible system that can be deployed to different servers and react to the current environment accordingly.

<info>
Note that the settings in the standard `config.php` file are always used. If you need different settings in another environment, you will have to override those settings in the domain specific configuration file (or only set those options in your domain specific config file).

General settings for all environments should be included in the standard `config.php` file to avoid code duplication.
</info>

### CLI configuration

If you are using Kirby with a command-line interface (or CLI for short), for example with the <a href="https://getkirby.com/plugins/getkirby/cli">Kirby CLI</a> or with a custom script, you can define specific config overrides in a separate file:

```filesystem
/site/config/config.cli.php
```

The CLI-specific config file works like a host-specific config file in that it can override anything you put into your standard `config.php`.

### Deployment configuration

There is another optional config file that overrides any option value, no matter if it was set in `config.php` or a host-specific config file:

```filesystem
/site/config/env.php
```

You can use this file for dynamic option values that are set during a deployment, e.g. a specific fixed `url` value for that server, randomly generated deployment IDs or sensitive data like API keys.

<info>
The `env.php` file is loaded before any host-specific config files. If `env.php` sets or overrides the `url` option, it will control which host-specific config file gets loaded. However in the end result, the options defined in `env.php` will always override any other configuration file.
</info>


## Panel configuration

The Panel has **<a href="https://getkirby.com/docs/reference/system/options/panel">additional configuration options</a>** to include custom CSS and JS files, to move it to a different subfolder or to switch it off entirely.