Mattermost - Secure Collaboration Platform - in Docker 🌱

What is Mattermost?

Mattermost is a secure collaboration platform for accelerating mission-critical collaborative work. The platform is built to meet the custom needs of technical and operational teams in rigorous and complex environments, including government, defense, and critical infrastructure. Mattermost gives organizations full control over their data with self-hosted and private deployment options and access to the source code. - https://docs.mattermost.com/about/product.html

Installing Docker

  1. Log into the Linux based device
  2. Run the following commands in the terminal
    # install prerequisites
    sudo apt install apt-transport-https ca-certificates git curl software-properties-common gnupg-agent -y
    # add docker gpg key
    curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -
    # add docker software repository
    sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"
    # install docker
    sudo apt install docker-ce docker-compose containerd.io -y
    # enable and start docker service
    sudo systemctl enable docker && sudo systemctl start docker
    # add the current user to the docker group
    sudo usermod -aG docker $USER
    # reauthenticate for the new group membership to take effect
    su - $USER

Running Mattermost

  1. Now that Docker is installed, run the following commands to setup the Mattermost Docker container and run it
    # clone git repo
    git clone https://github.com/mattermost/docker ~/docker/mattermost
    # create working directories
    mkdir ~/docker/mattermost/{config,data,logs,plugins,client/plugins,bleve-indexes} -p
    # create a copy of .env
    cp ~/docker/mattermost/env.example ~/docker/mattermost/.env
    # set owner of working directories
    sudo chown "$USER":"$USER" ~/docker -R
    # allow the container to write to working directories
    sudo chmod a+rwx -R ~/docker/mattermost
    # replace default paths
    sudo sed -i "s|/volumes||" ~/docker/mattermost/.env
    # edit .env
    nano ~/docker/mattermost/.env
  2. Modify at least the following values in .env to suit your needs

    DOMAIN=ubuntuserver.local
    TZ=America/New_York
    POSTGRES_USER=mattermost_rw
    POSTGRES_PASSWORD=Matt3rM0st

  3. Press CTRL+O, Enter, CTRL+X to write the changes to .env
  4. Continue with the following commands
    # cd to matter most directory
    cd ~/docker/mattermost
    # run mattermost container
    sudo docker compose -f docker-compose.yml -f docker-compose.without-nginx.yml up -d
  5. Open a web browser and navigate to http://DNSorIP:8065
  6. Click the View in Browser button
  7. Complete the form to create an account
  8. Enter an Organization Name > Click Continue
  9. Complete the remaining prompts or choose to skip
  10. Welcome to Mattermost running in Docker

Source: https://docs.mattermost.com/install/install-docker.html