Update Server:
apt update && apt upgrade -y
Set Hostname:
hostnamectl set-hostname ex.example.com
Install MarisDB:
sudo apt install mariadb-server
sudo mysql_secure_installation
Install Nginx:
sudo apt install nginx
sudo ufw allow 'Nginx HTTP'
Install Postfix:
sudo apt install mailutils
sudo nano /etc/postfix/main.cf
update
inet_interfaces = loopback-only
sudo systemctl restart postfix
sudo nano /etc/aliases
add
root: [email protected]
sudo newaliases
echo "This is the body of the email" | mail -s "subject line" root
Installing Mattermost:
mkdir ~/mattermost
cd ~/mattermost
wget https://releases.mattermost.com/5.24....
tar -xvzf mattermost*.gz
sudo cp -r mattermost /opt
sudo mkdir /opt/mattermost/data
sudo useradd --system --user-group mattermost
sudo chown -R mattermost:mattermost /opt/mattermost
sudo chmod -R g+w /opt/mattermost
Setting Up the Database
mysql -u root -p
CREATE USER 'mmuser'@'%' IDENTIFIED BY '123Admin';
CREATE DATABASE mattermost;
GRANT ALL PRIVILEGES ON mattermost.* TO 'mmuser'@'%';
FLUSH PRIVILEGES;
exit
sudo nano /opt/mattermost/config/config.json
update
...
"DriverName": "mysql"
"DataSource": "mmuser:123Admin@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s"
...
Creating a systemd Service:
sudo nano /lib/systemd/system/mattermost.service
paste
[Unit]
Description=Mattermost
After=network.target
After=mysql.service
Requires=mysql.service
[Service]
Type=notify
User=mattermost
Group=mattermost
ExecStart=/opt/mattermost/bin/mattermost
TimeoutStartSec=3600
Restart=always
RestartSec=10
WorkingDirectory=/opt/mattermost
LimitNOFILE=49152
[Install]
WantedBy=mysql.service
sudo systemctl daemon-reload
sudo systemctl status mattermost
sudo systemctl enable mattermost
Exposing Mattermost at Your Domain:
sudo nano /opt/mattermost/config/config.json
update
...
"SiteURL": "http://ex.example.com"
...
sudo nano /etc/nginx/sites-available/mattermost.conf
paste
upstream backend {
server localhost:8065;
keepalive 32;
}
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;
server {
listen 80;
server_name ex.example.com;
location ~ /api/v[0-9]+/(users/)?websocket$ {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
client_max_body_size 50M;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_buffers 256 16k;
proxy_buffer_size 16k;
client_body_timeout 60;
send_timeout 300;
lingering_timeout 5;
proxy_connect_timeout 90;
proxy_send_timeout 300;
proxy_read_timeout 90s;
proxy_pass http://backend;
}
location / {
client_max_body_size 50M;
proxy_set_header Connection "";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_buffers 256 16k;
proxy_buffer_size 16k;
proxy_read_timeout 600s;
proxy_cache mattermost_cache;
proxy_cache_revalidate on;
proxy_cache_min_uses 2;
proxy_cache_use_stale timeout;
proxy_cache_lock on;
proxy_http_version 1.1;
proxy_pass http://backend;
}
}
sudo ln -s /etc/nginx/sites-available/mattermost.conf /etc/nginx/sites-enabled/mattermost.conf
sudo nginx -t
sudo systemctl restart nginx
sudo systemctl start mattermost
Access web UI:
http://ex.example.com
Watch video How to install MatterMost Chat Service on Ubuntu online without registration, duration hours minute second in high quality. This video was added by user Quickloss3 31 January 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,740 once and liked it 22 people.