Installing Mattermost on CentOS 7


  • Service Provider

    Mattermost is a Slack competitor written in Google's new(ish) Go Language (GoLang.) Mattermost is fully free and open source. The biggest deal about Mattermost is that it is Slack compatible, so those Slack tools that you want to use will work with it.

    We get started with a normal, plain CentOS 7 minimal install. I'll make mine from a template.

    0_1460471965138_Screenshot from 2016-04-06 12:55:54.png

    yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
    yum install postgresql94-server postgresql94-contrib wget
    /usr/pgsql-9.4/bin/postgresql94-setup initdb
    systemctl enable postgresql-9.4.service
    systemctl start postgresql-9.4.service
    

    Now we need to work as the database user...

    sudo -i -u postgres
    psql
    CREATE DATABASE mattermost;
    CREATE USER mmuser WITH PASSWORD 'noonewilleverguess';
    GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;
    \q
    exit
    

    Back as root, again. Uncomment the listen_addresses line.

    vi /var/lib/pgsql/9.4/data/postgresql.conf
    

    And in this file, we need to allow md5 instead of peer for the local connection at the bottom.
    vi /var/lib/pgsql/9.4/data/pg_hba.conf

    And now we need to reload the database and test:

    systemctl reload postgresql-9.4.service
    

    Here is the test...

    psql --host=127.0.0.1 --dbname=mattermost --username=mmuser --password
    

    If we get an error here, stop, nothing will work if this fails. Comment and we will troubleshoot. A success message looks like mattermost=> and you \q to quit.

    cd /tmp
    wget
    tar -xvzf mattermost.tar.gz
    mv mattermost /opt/
    mkdir -p /opt/mattermost/data
    useradd -r mattermost -U
    chown -R mattermost:mattermost /opt/mattermost
    chmod -R g+w /opt/mattermost
    cd /opt/mattermost/config
    vi config.json
    

    In this file you need to replace DriverName": "mysql" with DriverName": "postgres"

    And then replace "DataSource":"mmuser:[email protected](dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8" with "DataSource": "postgres://mmuser:[email protected]:5432/mattermost?sslmode=disable&connect_timeout=10"

    And then to test it out...

    cd /opt/mattermost/bin
    ./platform
    

    That's it. You should be able to log into the web interface from a web browser.


  • Service Provider

    sc to come



  • Why would you choose not to use their Docker install? This is an honest question, not a criticism.


  • Service Provider

    @Kelly said:

    Why would you choose not to use their Docker install? This is an honest question, not a criticism.

    Don't have Docker set up currently.


  • Service Provider

    Why was postgres used? Nothing wrong with it of course, but not typically used on RHEL based stuff for the masses



  • Hm. Interesting. I'd like to set this up on a test machine right now. Maybe I will tonight.


  • Service Provider

    @JaredBusch said:

    Why was postgres used? Nothing wrong with it of course, but not typically used on RHEL based stuff for the masses

    both my preferred, so I didn't fight it, and the recommended one from the Mattermost project. They support MySQL, of course, but they push PostgreSQL as their preferred so I went with that.


  • Service Provider

    @scottalanmiller said:

    @JaredBusch said:

    Why was postgres used? Nothing wrong with it of course, but not typically used on RHEL based stuff for the masses

    both my preferred, so I didn't fight it, and the recommended one from the Mattermost project. They support MySQL, of course, but they push PostgreSQL as their preferred so I went with that.

    Interesting that they chose it is all.



  • @scottalanmiller said:

    psql --host=127.0.0.1 --dbname=mattermost --username=mmuser --password

    As a test:

    psql --host=127.0.0.1 --dbname=mattermost --username=administrator --password

    This is the user I created for these steps:

    sudo -i -u postgres
    psql
    CREATE DATABASE mattermost;
    CREATE USER mmuser WITH PASSWORD 'noonewilleverguess';
    GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;
    \q
    exit

    Error:

    [[email protected] ~]# psql --host=127.0.0.1 --dbname=mattermost --username=administrator --password
    Password for user administrator:
    psql: FATAL: Ident authentication failed for user "administrator"


  • Service Provider

    @JaredBusch said:

    @scottalanmiller said:

    @JaredBusch said:

    Why was postgres used? Nothing wrong with it of course, but not typically used on RHEL based stuff for the masses

    both my preferred, so I didn't fight it, and the recommended one from the Mattermost project. They support MySQL, of course, but they push PostgreSQL as their preferred so I went with that.

    Interesting that they chose it is all.

    Yes, widely supported but rarely the primary choice. It might be tied to Go for all that I know. Ruby, for example, as a culture leans to PostgreSQL not MySQL whereas PHP leans the other way. Don't know anything about the Go culture so just speculating.


  • Service Provider

    @wirestyle22 said:

    @scottalanmiller said:

    psql --host=127.0.0.1 --dbname=mattermost --username=mmuser --password

    As a test:

    psql --host=127.0.0.1 --dbname=mattermost --username=administrator --password

    This is the user I created for these steps:

    sudo -i -u postgres
    psql
    CREATE DATABASE mattermost;
    CREATE USER mmuser WITH PASSWORD 'noonewilleverguess';
    GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;
    \q
    exit

    Error:

    [[email protected] ~]# psql --host=127.0.0.1 --dbname=mattermost --username=administrator --password
    Password for user administrator:
    psql: FATAL: Ident authentication failed for user "administrator"

    Did you change the "peer" to "md5" in the config file?



  • @scottalanmiller said:

    @wirestyle22 said:

    @scottalanmiller said:

    psql --host=127.0.0.1 --dbname=mattermost --username=mmuser --password

    As a test:

    psql --host=127.0.0.1 --dbname=mattermost --username=administrator --password

    This is the user I created for these steps:

    sudo -i -u postgres
    psql
    CREATE DATABASE mattermost;
    CREATE USER mmuser WITH PASSWORD 'noonewilleverguess';
    GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;
    \q
    exit

    Error:

    [[email protected] ~]# psql --host=127.0.0.1 --dbname=mattermost --username=administrator --password
    Password for user administrator:
    psql: FATAL: Ident authentication failed for user "administrator"

    Did you change the "peer" to "md5" in the config file?

    Yes I did. I even went back, copy and pasted everything directly from the guide: mmuser noonewilleverguess etc and it still did the same thing.

    Just to verify
    0_1460657433761_mattermost.jpg



  • @scottalanmiller said:

    @JaredBusch said:

    Why was postgres used? Nothing wrong with it of course, but not typically used on RHEL based stuff for the masses

    both my preferred, so I didn't fight it, and the recommended one from the Mattermost project. They support MySQL, of course, but they push PostgreSQL as their preferred so I went with that.

    Oddly the Docker container uses MySQL. I'm playing with it right now to learn both Mattermost and Docker.



  • @Kelly said:

    @scottalanmiller said:

    @JaredBusch said:

    Why was postgres used? Nothing wrong with it of course, but not typically used on RHEL based stuff for the masses

    both my preferred, so I didn't fight it, and the recommended one from the Mattermost project. They support MySQL, of course, but they push PostgreSQL as their preferred so I went with that.

    Oddly the Docker container uses MySQL. I'm playing with it right now to learn both Mattermost and Docker.

    That interesting. I need to play with Docker too.



  • @wirestyle22 I have the same problem



  • @scottalanmiller I have the same problem. Confused



  • For those who were still having problems getting Mattermost running on CentOS 7, I was also having the same problems and couldn't get beyond the postgres install. I found another guide and with a few tweaks, I was able to get this running.

    https://www.howtoforge.com/tutorial/install-mattermost-with-postgresql-and-nginx-on-centos7/

    The change that was required from this guide was in the "Download and Extract Mattermost"

    Instead of...
    [[email protected] ~]# wget -q "https://github.com/mattermost/platform/releases/download/v2.0.0/mattermost.tar.gz" -O mattermost.tar.gz

    Use this...
    wget https://releases.mattermost.com/3.3.0/mattermost-team-3.3.0-linux-amd64.tar.gz

    Then in the next block, instead of...
    tar -xvzf mattermost.tar.gz

    Use this...
    tar -xvzf mattermost-team-3.3.0-linux-amd64.tar.gz

    After that, follow the guide to the letter and it will get you to this...
    0_1473265786807_upload-d89fe07b-7d71-4d39-8dd7-e00395f6aa84

    @aaronxiang @wirestyle22 @scottalanmiller



Looks like your connection to MangoLassi was lost, please wait while we try to reconnect.