{"id":15665,"date":"2025-08-29T17:41:06","date_gmt":"2025-08-29T12:11:06","guid":{"rendered":"https:\/\/www.skynats.com\/?p=15665"},"modified":"2025-08-29T18:47:05","modified_gmt":"2025-08-29T13:17:05","slug":"how-to-install-mattermost-on-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/how-to-install-mattermost-on-ubuntu-24-04\/","title":{"rendered":"How to Install Mattermost on Ubuntu 24.04"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Mattermost is an open-source, self-hosted collaboration platform designed for secure team communication. If you\u2019re looking to set it up, you can follow this guide to install Mattermost on Ubuntu 24.04 for a seamless and secure deployment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-prerequisites\"><strong>Prerequisites<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A fresh <a href=\"https:\/\/ubuntu.com\/blog\/tag\/ubuntu-24-04-lts\" target=\"_blank\" rel=\"noopener\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-secondary-color\">Ubuntu 24.04<\/mark><\/a> server.<\/li>\n\n\n\n<li>Root or sudo privileges.<\/li>\n\n\n\n<li>Domain name pointing to your server<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\" id=\"h-step-1-update-system-packages\"><strong>Step 1: Update System Packages<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Step 2: Install and Configure PostgreSQL<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Install PostgreSQL and enable it to start on boot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install postgresql postgresql-contrib -y\nsudo systemctl enable postgresql\nsudo systemctl start postgresql<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Create Mattermost Database and User<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Switch to the PostgreSQL user:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>su - postgres<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new PostgreSQL user and database:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>createuser mattermostuser\npsql\nALTER USER mattermostuser WITH ENCRYPTED password 'xdghjasgduyhadhfIT';\nCREATE DATABASE mattermost OWNER mattermostuser;\nGRANT ALL PRIVILEGES ON DATABASE mattermost TO mattermostuser;\n\\q\nexit<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\" id=\"h-step-3-download-and-install-mattermost\"><strong>Step 3: Download and Install Mattermost<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Create a system user for Mattermost:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo useradd --system --user-group mattermost<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Download and extract Mattermost:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/releases.mattermost.com\/6.4.0\/mattermost-6.4.0-linux-amd64.tar.gz\ntar xvf mattermost-6.4.0-linux-amd64.tar.gz\nsudo mv mattermost \/opt\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create data directory and set permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir -p \/opt\/mattermost\/data\nsudo chown -R mattermost:mattermost \/opt\/mattermost\nsudo chmod -R g+w \/opt\/mattermost<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Step 4: Configure Mattermost<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Edit the Mattermost configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/opt\/mattermost\/config\/config.json<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Locate the following fields and update:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"DriverName\": \"postgres\",\n\"DataSource\": \"postgres:\/\/mattermostuser:&lt;mattermostuser-password>@&lt;host-name-or-IP>:5432\/mattermost?sslmode=disable&amp;connect_timeout=10\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">replacing &lt;mattermostuser-password&gt; and &lt;host-name-or-IP&gt; with the appropriate values.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-small-font-size\"><strong>Step 5: Create a Systemd Service for Mattermost<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create the systemd service file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/systemd\/system\/mattermost.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Paste the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription=Mattermost<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>After=network.target\nAfter=postgresql.service\nBindsTo=postgresql.service\n\n&#91;Service]\nType=notify\nExecStart=\/opt\/mattermost\/bin\/mattermost\nTimeoutStartSec=3600\nKillMode=mixed\nRestart=always\nRestartSec=10\nWorkingDirectory=\/opt\/mattermost\nUser=mattermost\nGroup=mattermost\nLimitNOFILE=49152\n\n&#91;Install]\nWantedBy=postgresql.service<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Reload the systemd manager and start Mattermost. Also check the status:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl daemon-reload\nsudo systemctl start mattermost\nsudo systemctl enable mattermost\nsudo systemctl status mattermost<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 7: Set Up Nginx Reverse Proxy<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install Nginx:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install -y nginx<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create a new configuration for mattermost domain:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/nginx\/sites-enabled\/mattermost.conf<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Paste the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n    listen 80;\n\n    server_name  training3.codeinall.com;\n    error_log \/var\/log\/nginx\/mattermost.error;\n    access_log \/var\/log\/nginx\/mattermost.access;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>    location \/ {\n        proxy_pass http:\/\/localhost:8065;\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Restart the Nginx:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart nginx<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Final Step: Access Mattermost<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open your browser and visit: <strong>http:\/\/training3.codeinall.com<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should see the Mattermost setup page. Create your admin account and configure your team to start using Mattermost.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-small-font-size\"><strong>Conclusion<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Successfully installed Mattermost on Ubuntu 24.04. This setup is ideal for teams looking to self-host a secure, customizable messaging platform.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019re looking to simplify collaboration and communication by deploying Mattermost, our team can help. From installation to optimization, we ensure a smooth setup tailored to your business needs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At Skynats, we specialize in <a href=\"https:\/\/www.skynats.com\/devops-support\/\">DevOps support services<\/a> and comprehensive <a href=\"https:\/\/www.skynats.com\/blog\/\">server management services<\/a> to help businesses set up, monitor, and maintain their infrastructure with ease.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Need assistance with Mattermost installation or server management? Contact Skynats today for professional support!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mattermost is an open-source, self-hosted collaboration platform designed for secure team communication. If you\u2019re looking to set it up, you can follow this guide to install Mattermost on Ubuntu 24.04 for a seamless and secure deployment. Prerequisites Step 1: Update System Packages Step 2: Install and Configure PostgreSQL Install PostgreSQL and enable it to start [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[1064,1092,302,993],"class_list":["post-15665","post","type-post","status-publish","format-standard","hentry","category-blog","tag-devops-support-services","tag-mattermost","tag-server-management-services","tag-ubuntu-24"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=15665"}],"version-history":[{"count":1,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15665\/revisions"}],"predecessor-version":[{"id":15666,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/15665\/revisions\/15666"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=15665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=15665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=15665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}