# Can't create new user with mmctl

**URL:** <https://forum.mattermost.com/t/cant-create-new-user-with-mmctl/12580>\
**Category:** Command Line Interface\
**Created:** [November 22, 2021, 7:32am UTC](https://forum.mattermost.com/t/cant-create-new-user-with-mmctl/12580 "2021-11-22T07:32:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![az-bp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/az-bp/32/5225_2.png) [@az-bp](https://forum.mattermost.com/u/az-bp)\
**Post date:** [November 22, 2021, 7:32am UTC](https://forum.mattermost.com/t/cant-create-new-user-with-mmctl/12580/1 "2021-11-22T07:32:53Z")

</div>

Hello, after upgrading mattermost to version 6.1.0 I have a problem while trying to create new user using “mmctl user create” command.  
I used to create new users with “mattermost user create”.  
Now when I run this command

> /opt/mattermost/bin/mmctl user create --email [newusername@example.com](mailto:newusername@example.com) --username newusername --password ‘newpassword’ --firstname User --lastname Test

I get the following error:

> Error: cannot read user credentials, maybe you need to use login first: stat /root/.config/mmctl/config: no such file or directory

Mattermost is run by user mattermost. If I run “su mattermost” and then run the same mmctl command, I get:

> Error: cannot read user credentials, maybe you need to use login first: stat /home/mattermost/.config/mmctl/config: no such file or directory

How can I solve this problem?  
Do I have to change mattermost user’s home directory to /opt/mattermost/ or /opt/mattermost/bin/ ?

---

<div class="post-metadata">

**Author:** ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)\
**Post date:** [November 22, 2021, 1:36pm UTC](https://forum.mattermost.com/t/cant-create-new-user-with-mmctl/12580/2 "2021-11-22T13:36:26Z")

</div>

@mgdelacroix@streamer45 Would you be able to help take a look at this?

---

<div class="post-metadata">

**Author:** ![streamer45](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/streamer45/32/4133_2.png) [@streamer45](https://forum.mattermost.com/u/streamer45)\
**Post date:** [November 22, 2021, 5:07pm UTC](https://forum.mattermost.com/t/cant-create-new-user-with-mmctl/12580/3 "2021-11-22T17:07:41Z")

</div>

It appears that the expected config file is not found. Starting on version 6.0 `mmctl` is using `$XDG_CONFIG_HOME/mmctl/config` as default config file path. @isacikgoz is there any breaking to the config format or is it sufficient to either copy or pass the previous file through the `--config-path` command line option?

---

<div class="post-metadata">

**Author:** ![az-bp](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/az-bp/32/5225_2.png) [@az-bp](https://forum.mattermost.com/u/az-bp)\
**Post date:** [November 22, 2021, 5:44pm UTC](https://forum.mattermost.com/t/cant-create-new-user-with-mmctl/12580/4 "2021-11-22T17:44:28Z")

</div>

Hi, [streamer45](https://forum.mattermost.com/u/streamer45).  
Thanks for responding!  
I’ve managed to create new user by:

1. enabling local mode by setting

> “EnableLocalMode”: true

in /opt/mattermost/config/config.json  
2) using the following command

> ./mmctl user create --local --email [mail@example.com](mailto:mail@example.com) --username test1 --password ‘password’ --firstname username --lastname test --config /opt/mattermost/config/config.json

---

<div class="post-metadata">

**Author:** ![isacikgoz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/isacikgoz/32/4554_2.png) [@isacikgoz](https://forum.mattermost.com/u/isacikgoz)\
**Post date:** [November 22, 2021, 7:39pm UTC](https://forum.mattermost.com/t/cant-create-new-user-with-mmctl/12580/5 "2021-11-22T19:39:08Z")

</div>

Hey @az-bp As far as I’m seeing you are using mattermost config file as mmctl config file. They are two different files. You can either set another file or let the tool create a config file to the default config directory. In your case the tool cannot find the XDG\_CONFIG\_HOME directory for both users. You should set an existing path to save your config file.
