Mattermost: Advanced Mattermost administration with mmctl
This documentation is part of the Getting started guide. You can view the complete guide here: How to get started with Mattermost.
👋 Welcome to the Stackhero documentation!
Stackhero offers a ready-to-use Mattermost cloud solution that provides a host of benefits, including:
- Unlimited users and channels.
- Unlimited and dedicated SMTP email server included.
- Customisable domain name secured with HTTPS (for example, https://chat.your-company.com).
- Effortless updates with just a click.
- Optimal performance and robust security powered by a private and dedicated VM.
- Available in 🇪🇺 Europe and 🇺🇸 USA.
Save time and simplify your life: it only takes 5 minutes to try Stackhero's Mattermost cloud hosting solution!
For those who want to dive deeper, the mmctl CLI provides powerful tools to manage and configure your Mattermost instance. You can find more details in the official documentation: https://docs.mattermost.com/manage/mmctl-command-line-tool.html.
Using the CLI mmctl with Mattermost
You have the option to install mmctl on your computer or run it using Docker. We recommend using Docker. To launch a container with an interactive bash shell, you can run:
docker run -it mattermost/mattermost-team-edition:latest /bin/bash
To log in, establish a connection with your server by running:
mmctl auth login -n stackhero https://<XXXXXX>.stackhero-network.com
You will be prompted to enter your Mattermost credentials. Once logged in, you can perform various administrative tasks with the mmctl CLI.
If you use two-factor authentication and encounter the error "could not initiate client: Invalid MFA token", include your MFA token (the 6-digit code from your MFA app) by running:
mmctl auth login -n stackhero --mfa-token <XXXXXX> https://<XXXXXX>.stackhero-network.com
After successfully authenticating, you might list all Mattermost users with the following command:
mmctl user list
Deleting a Mattermost user using mmctl
Be cautious: this action will permanently delete the user and all associated data, and recovery is not possible.
While you can disable a user from the Mattermost System Console, deletion must be performed using the mmctl CLI. To delete a user, run:
mmctl user delete [email protected]
If you encounter the error "Permanent user deletion feature is not enabled. Please contact your System Administrator", enable user deletion via API support with:
mmctl config set ServiceSettings.EnableAPIUserDeletion true
Deleting a Mattermost channel using mmctl
You can delete a channel using the mmctl CLI.
Be cautious: this action will permanently delete the channel and all its data, and recovery is not possible.
To delete a channel, replace <TEAM> and <CHANNEL> with your specific values and execute:
mmctl channel delete <TEAM>:<CHANNEL>
If you encounter the error Permanent channel deletion feature is not enabled. Please contact your System Administrator., enable this feature by running:
mmctl config set ServiceSettings.EnableAPIChannelDeletion true