This image provides the Mattermost (Team Edition)
chat application server as a Docker image.
Since version 3.8 Mattermost supports setting configuration values via
environment variables. As this perfectly matches with common container
practices and allows to remove the logic to write a configuration file from
environment variables during startup, the former environment variables and their
resolution have been removed. This increases maintainability of this image and
keeps it tighter to Mattermost itself.
This means that you need to redefine any environment variable that you used
before the 3.8 release of this image. See
CHANGELOG.md for a reference
regarding some important variables.
The quickest way to get started is using docker-compose.
file, adjust as needed and start the project's containers:
You can generate the random strings for salts – though this isn't needed for testing purposes – with:
pwgen -s1 32
With the provided example configuration, open http://localhost:8080 in a
browser and create your administrator account.
You should now have the Mattermost application up and ready for testing. If you want to use this image in production, please read on.
Configuration file and environment variables
This image comes with the default configuration file
which you may replace by mounting your customized one into
It is however recommended to override setting with environment variables.
Please refer to
regarding naming of environment variables and available configuration options.
For the defaults see the config file linked above.
MAKE SURE THAT ANY OF YOUR DEPLOYMENTS IS CONFIGURED WITH UNIQUE VALUES PER
INSTANCE FOR EACH OF THESE SETTINGS:
(noted by their environment variable name here)
Furthermore you need to set
You may set
true for a verbose bootstrapping and to set
Mattermost's debug level to
File Assets Store
Mattermost stores data in the file system for assets like file uploads and avatars.
The image defines a volume
for that location at
Mattermost uses a database backend to store most of its data.
You can configure this image to use MariaDB/MySQL or Postgres.
The simplest configuration uses a container dedicated as database backend, like
in the example
As the service names (
mysql) will be used as hostnames, these
will be probed and any configuration values will be derived from it, using
default values. Just make sure that
DB_PASS in the
mattermost service and
MYSQL_ROOT_PASSWORD in the database service are
You can also define the database configuration as URL with the
MM_SQLSETTINGS_DATASOURCE and an according
Granular settings variables
MM_SQLSETTINGS_DATASOURCE variable can be assembled from these
MM_SQLSETTINGS_DRIVERNAME(determines postgres / mysql defaults)
DB_ENCODING(default: none /
- must not contain
- must not contain
Using the cli tools
You can use the cli tools,
e.g. to invite a user:
docker exec -t <container_name_or_id> platform user invite email@example.com central_committee
Building the image
The source repository contains a
Makefile that can be used to build the image