# Config.yaml does not work

**URL:** <https://discourse.getcockpit.com/t/config-yaml-does-not-work/1110>\
**Category:** Support\
**Created:** [December 5, 2019, 10:55am UTC](https://discourse.getcockpit.com/t/config-yaml-does-not-work/1110 "2019-12-05T10:55:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dosi](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/dosi/32/451_2.png) [@dosi](https://discourse.getcockpit.com/u/dosi)\
**Post date:** [December 5, 2019, 10:55am UTC](https://discourse.getcockpit.com/t/config-yaml-does-not-work/1110/1 "2019-12-05T10:55:43Z")

</div>

I used the config.yaml to make settings regarding the mailer and to add additional user groups, but nothing happens. my settings don’t apply to Cockpit.

What did I do wrong?

---

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [December 5, 2019, 3:13pm UTC](https://discourse.getcockpit.com/t/config-yaml-does-not-work/1110/2 "2019-12-05T15:13:22Z")

</div>

Please explain some more, what you have done so far.

A few things, I could imagine:

Did you save the file in `/path/to/cockpit/config/config.yaml`?  
Does the config file end with `.yaml`? - `config.yml` won’t work.  
If there is a file `config.php`, the `config.yaml` will be ignored.

---

<div class="post-metadata">

**Author:** ![dosi](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/dosi/32/451_2.png) [@dosi](https://discourse.getcockpit.com/u/dosi)\
**Post date:** [December 5, 2019, 3:18pm UTC](https://discourse.getcockpit.com/t/config-yaml-does-not-work/1110/3 "2019-12-05T15:18:42Z")

</div>

As there was no config folder, I created one and clicked on the link within cockpit to automatically create the config.yaml

after that I pasted the example markup from the documentation in the editor and made some changes.

this is my config-file now. (mail credentials censored)

```
# Cockpit settings
# cockpit App name
'app.name' => 'HTTP Status Codes',

# cockpit session name
'session.name' => 'mysession',

# app custom security key
'sec-key' => 'nfu89h3849kj ****** f3n§3pi2',

# site url (optional) - helpful if you're behind a reverse proxy
'site_url' => 'https://h **** de.de',

    # define additional groups
'groups' => [
    'redakteur' => [
        '$admin' => false,
        '$vars' => [
            'finder.path' => '/storage/upload'
        ],
        'cockpit' => [
            'backend' => true,
            'finder' => false
        ],
        'collections' => [
            'manage' => true
        ]
        'singletons' => [
            'manage' => true
        ],
    ],
],

    # use smtp to send emails
'mailer' => [
    'from' => 'cockpit@do **** on.de',
    'transport' => 'smtp'
    'host' => '***',
    'user' => '***'
    'password' => '***',
    'port' => 25,
    'auth' => true,
    'encryption' => 'ssl' # '', 'ssl' or 'tls'
],
```

---

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [December 5, 2019, 3:23pm UTC](https://discourse.getcockpit.com/t/config-yaml-does-not-work/1110/4 "2019-12-05T15:23:31Z")

</div>

Rename `config.yaml` to `config.php` and it should work 😉

Cockpit supports a config file in php format

```php
return [
    'app.name' => 'just a test',
    'groups' => [
        // ...
    ],
];

```

or in yaml format

```auto
app.name: just a test

groups:
    redakteur:
        cockpit:
            backend: true

```

---

<div class="post-metadata">

**Author:** ![dosi](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/dosi/32/451_2.png) [@dosi](https://discourse.getcockpit.com/u/dosi)\
**Post date:** [December 5, 2019, 3:30pm UTC](https://discourse.getcockpit.com/t/config-yaml-does-not-work/1110/5 "2019-12-05T15:30:27Z")

</div>

Unfortunately this doesnt work and result in a 500 Server error.

I don’t know what to do. Unfortunately the documentation is very poor.

---

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [December 5, 2019, 3:48pm UTC](https://discourse.getcockpit.com/t/config-yaml-does-not-work/1110/6 "2019-12-05T15:48:09Z")

</div>

Ah, I see. Renaming doesn’t work, if the file **doesn’t contain valid PHP**. The GUI defaults to create a config.yaml file, but the example in the docs is for a php file.

[https://getcockpit.com/documentation/reference/configuration](https://getcockpit.com/documentation/reference/configuration)

Choose a file type first, than write valid yaml or valid php. If you choose a php config file, you have to return an array of settings.

```php
<?php

return [

    # app name
    'app.name' => 'My Project X',
];

```

---

<div class="post-metadata">

**Author:** ![dosi](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/dosi/32/451_2.png) [@dosi](https://discourse.getcockpit.com/u/dosi)\
**Post date:** [December 5, 2019, 4:01pm UTC](https://discourse.getcockpit.com/t/config-yaml-does-not-work/1110/7 "2019-12-05T16:01:34Z")

</div>

this worked.

As I said: the documentation is a bit poor …
