Here are the Ubuntu 64-bit installation instructions I followed.
Note: These instructions used, as their basis, Justine Geffen's Raspbian Jesse "recipe".
Once again, use Ubuntu 64-bit 20.04!! The performance is night and day faster than 32bit!!
===================
The official
Mattermost Team server builds do not support any ARM platform. In order get a build which will run on our ARM-based Raspberry Pi, we'll be installing from an
unofficial build of Mattermost, built by SmartHoneyBee.
These (unofficial)
Mattermost Team Server builds are updated regularly, and automatically.
To determine what the latest release is - currently 5.28.0, at the moment of this posting - visit the Release page for SmartHoneyBee's unofficial Mattermost Team Server here .
Note: The wonderful magic of TravisCI makes this build-automation possible. There are installers for quite a few architectural platforms, and OS'. The version to install on a Raspberry Pi (64-bit OS) has a filename ending in
"-linux-arm64.tar.gz" You can check to see that 64-bit ARM is indeed called for, by running:
Code: Select all
uname --kernel-name --kernel-release --machine
Note the "aarch64" amongst the output seen:
That "aarch64" on the end effectively means "64-bit ARM".
Setting up MariaDB
---------------------------
Before you install
Mattermost, you need to set up MariaDB. The Official, full instructions are on the
Installing Mattermost on Ubuntu page and cover PostgreSQL and MySQL.
Here, we'll use MariaDB (a drop-in replacement of MySQL):
- Log into the server that will host the database, and open a terminal window.
- Update your local package list
- Install MariaDB
- Log in to MariaDB as root. (Yes, the command to do so is still called "mysql" in MariaDB, that's not a typo).
- Create the Mattermost user 'mmuser', replacing 'mmuser-password' in the command below with the password you plan to use. Don't use punctuation characters in the password, and please pick a long one.
Code: Select all
mysql> create user 'mmuser'@'localhost' identified by 'mmuser-password';
The ‘localhost’ means that 'mmuser' can connect only on that Raspberry Pi itself. This is to say, we're planning to run both the back-end database, and the front-end mattermost server code on the same Raspberry Pi. If you were to install Mattermost on a separate computer (say, a second Raspberry Pi, to split the load across two Raspberry Pi's, hint, hint) with IP address 10.10.10.2, then use:
Code: Select all
mysql> create user 'mmuser'@'10.10.10.2' identified by 'mmuser-password';
- Create the Mattermost database
Code: Select all
mysql> create database mattermost;
- Grant access privileges to the user 'mmuser'
Code: Select all
mysql> grant all privileges on mattermost.* to 'mmuser'@'localhost';
- Log out of MySQL
Install Mattermost Server
---------------------------
- Download the appropriate install file, note the "arm64" in the filename (for aarch64):
Code: Select all
wget https://github.com/SmartHoneybee/ubiquitous-memory/releases/download/v5.28.0/mattermost-v5.28.0-linux-arm64.tar.gz
- Extract the Mattermost Server files from the .tar.gz file
- Move the extracted file to the /opt directory
- Create the storage directory for files
The storage directory will contain all the files and images that your users post to Mattermost, so you need to make sure that the drive is large enough to hold the anticipated number of uploaded files and images.
- Create the Mattermost system user and group
Code: Select all
sudo useradd --system --user-group mattermost
- Set the user and group "mattermost" as the owner of the Mattermost files
Code: Select all
sudo chown -R mattermost:mattermost /opt/mattermost
- Give write permissions to the "mattermost" group
- Set up the database driver in the file /opt/mattermost/config/config.json . Open the file as root in a text editor and make the following changes:
1. Set DriverName to mysql. (not mariadb)
2. Set DataSource to the following value, replacing <mmuser-password> and <host-name-or-IP> with the appropriate values.
Code: Select all
mmuser:mmuser-password@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s
Start the Mattermost Server
---------------------------
- Change to the bin directory
- Start the Mattermost server as the user mattermost
Code: Select all
sudo -u mattermost ./bin/mattermost
- To test that you can access the server, navigate to:
Code: Select all
http://<your-Raspberry-Pi-IP-address>:8065
When the server starts the output log generates information, including the current version of Mattermost and the listening port (8065). You can stop the server by pressing CTRL+C on your keyboard.
Set up Mattermost to Use systemd for Starting and Stopping.
--------------------------------------------------------------------
If you want your
Mattermost server to start up automatically on boot, you can create a systemd file to install it as a service.
- Create a systemd unit file
Code: Select all
sudo touch /lib/systemd/system/mattermost.service
- Open the unit file as root in a text editor, and copy the following lines into the file:
Code: Select all
[Unit]
Description=Mattermost
After=network.target
After=mariadb.service
Requires=mariadb.service
[Service]
Type=notify
ExecStart=/opt/mattermost/bin/mattermost
TimeoutStartSec=3600
Restart=always
RestartSec=10
WorkingDirectory=/opt/mattermost
User=mattermost
Group=mattermost
LimitNOFILE=49152
[Install]
WantedBy=multi-user.target
Note: If you are using PostgreSQL, replace mariadb.service with postgresql.service.
If you have installed MariaDB or PostgreSQL on a dedicated server then you need to remove the "After=postgresql.service" and "Requires=postgresql.service" or "After=mariadb.service" and "Requires=mariadb.service" lines in the [Unit] section, or the Mattermost service will not start.
- Make systemd load the new unit
- Check to make sure that the unit was loaded
Code: Select all
sudo systemctl status mattermost.service
Since we haven't started Mattermost yet, you should see an output similar to the following:
mattermost.service - Mattermost
Loaded: loaded (/lib/systemd/system/mattermost.service; disabled; vendor preset: enabled)
Active: inactive (dead)
- Start the service
Code: Select all
sudo systemctl start mattermost.service
- Verify that Mattermost is running
Let's check the status again, shown on the command line, so you can see what it looks like, when running normally:
Code: Select all
sudo systemctl status mattermost.service
Output should look like:
● mattermost.service - Mattermost
Loaded: loaded (/lib/systemd/system/mattermost.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2020-04-05 02:27:11 UTC; 1s ago
Main PID: 8536 (mattermost)
Tasks: 14 (limit: 4440)
CGroup: /system.slice/mattermost.service
└─8536 /opt/mattermost/bin/mattermost
Apr 05 02:27:11 ubuntu mattermost[8536]: {"level":"info","ts":1586053631.2193584,"caller":"app/server.go:2
Apr 05 02:27:11 ubuntu mattermost[8536]: {"level":"info","ts":1586053631.219408,"caller":"app/server.go:24
Apr 05 02:27:11 ubuntu mattermost[8536]: {"level":"info","ts":1586053631.2650342,"caller":"sqlstore/post_s
Apr 05 02:27:11 ubuntu mattermost[8536]: {"level":"info","ts":1586053631.3531165,"caller":"jobs/workers.go
Apr 05 02:27:11 ubuntu mattermost[8536]: {"level":"info","ts":1586053631.3568313,"caller":"jobs/schedulers
Apr 05 02:27:11 ubuntu mattermost[8536]: {"level":"info","ts":1586053631.380791,"caller":"app/web_hub.go:7
Apr 05 02:27:11 ubuntu mattermost[8536]: {"level":"info","ts":1586053631.455799,"caller":"app/server.go:47
Apr 05 02:27:11 ubuntu mattermost[8536]: {"level":"info","ts":1586053631.456481,"caller":"app/server.go:53
Apr 05 02:27:11 ubuntu mattermost[8536]: {"level":"info","ts":1586053631.4566355,"caller":"commands/server
Apr 05 02:27:11 ubuntu systemd[1]: Started Mattermost.
- Web-based Mattermost first-time setup, from the web admin interface:
In a web browser, visit:
http://<your-Raspberry-Pi-IP-address>:8065
You should see a web page which asks you to set a Mattermost username, password, and email address. Go through the steps, until you're logged in, and can access the Web-based "System Console" of Mattermost (from the "burger menu", in the upper left, which looks like 3 horizontal white bars).
- Finally, set Mattermost to start on boot
Code: Select all
sudo systemctl enable mattermost.service
The output should indicate that a symlink has been successfully created.
Inviting Team Members
---------------------------
The last step in the process is to make the
Mattermost server available to team members so they can join the server. Back in your Web Browser, open the main menu, select
Get Team Invite Link, copy the link, and send it out.
Note: Now that you've got
Mattermost running with no SSL encryption, you'll probably also want to take a look at the
Official Install instructions for Mattermost, for Ubuntu. It has some final steps you might want to do, which will add SSL protection, and maybe set up a web-proxy using a web server like Nginx.