We're Hiring!

Mattermost Discussion Forums

Mmctl: create the first user

Hello there,

I’m scripting the deployment of new Mattermost instances (mattermost_ynh/install at master · YunoHost-Apps/mattermost_ynh · GitHub), and I’m trying to create the first user of the server.

So I do

bin/mmctl user create --email $email --username=$admin --password '$password' --locale $language --system-admin

But it fails with:

Error: cannot read user credentials, maybe you need to use login first

The thing is, I can’t authenticate, as I didn’t create any user yet.

Is it possible to create the first user of the system using mmctl?
(And otherwise, is it wise to open an issue for this?)

Hey @kemenaran

The first user that you sign up with in the system will always be a system admin. So you can use the UI and sign up as usual for that.

Alternatively, you can use mmctl in --local mode (mmctl Command Line Tool — Mattermost documentation) to perform operations without logging in.

I seems the local mode is exactly what I need. I’ll try that right away. Thanks for the advice!