{"id":3179,"date":"2023-03-21T06:06:23","date_gmt":"2023-03-21T11:06:23","guid":{"rendered":"https:\/\/promincproductions.com\/blog\/?p=3179"},"modified":"2023-05-09T21:04:05","modified_gmt":"2023-05-10T02:04:05","slug":"install-mattermost-on-qnap-nas-with-container-station","status":"publish","type":"post","link":"https:\/\/promincproductions.com\/blog\/install-mattermost-on-qnap-nas-with-container-station\/","title":{"rendered":"Install Mattermost on QNAP NAS with Container Station"},"content":{"rendered":"<p>Installing Mattermost on a QNAP server is achievable using Container Station.  Mattermost provides a Docker container that makes this installation a pretty straightforward process with the correct configuration.  Mattermost does require a Postgres database to store the data in, which is not built into the Mattermost Docker container or the QNAP platform.  For that reason a second container with Postgres is required as well.<\/p>\n\n\n\n<p>This tutorial walks through the steps to get Mattermost installed on a QNAP server.  Setting the configuration of the networking of the Mattermost container correctly is critical to getting this talking to the Postgres container.  With that set, a Mattermost chat server will be up and running before you know it!<\/p>\n\n\n\n<p>While Mattermost provides deployment guides, they don&#8217;t seem to be sufficient enough on how to deploy Mattermost to a Qnap server.  That&#8217;s where this how to guide fills in the missing pieces with steps on how to install Mattermost on a Qnap server with success.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"600\" height=\"600\" src=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/mattermost-on-qnap-container-station.png\" alt=\"How to install Mattermostt on QNAP with Container Station\" class=\"wp-image-3290\" title=\"How to install Mattermostt on QNAP with Container Station\" srcset=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/mattermost-on-qnap-container-station.png 600w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/mattermost-on-qnap-container-station-500x500.png 500w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/mattermost-on-qnap-container-station-150x150.png 150w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/mattermost-on-qnap-container-station-450x450.png 450w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Why Use Mattermost<\/h2>\n\n\n\n<p>Mattermost is a pretty amazing opensource option for an enterprise grade chat \/ instant messaging platform.  Mattermost is a solid alternative to Rocket Chat and Slack in so many ways, but yet so much more!  Mattermost provides <strong>Boards<\/strong> for project management that replaces the need for Trello in a management suite.  In addition Mattermost has built in <strong>Playbooks<\/strong> as a cool tool for ensuring repeatable processes are executed with precision over and over!<\/p>\n\n\n\n<p>While Mattermost offers a free version, there is a paid tier that adds additional features and unlocks some premium features.  More information can be can be found on the <a href=\"https:\/\/mattermost.com\/pricing\/\" target=\"_blank\" rel=\"noopener\" data-lasso-id=\"880\">Mattermost pricing page<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is Needed to Run Mattermost on a QNAP NAS?<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">The Wrong Way to Install Mattermost on QNAP<\/h3>\n\n\n\n<p>In the QNAP <strong>App Center<\/strong> there is an app for Mattermost.  Installing through the <strong>App Center<\/strong> will quickly get Mattermost up and running.  However, it is highly outdated (version 5.5, current version at the time of writing is 7.9) to the point that the mobile and desktop applications no longer work with this version.  It can be accessed through a web browser.  The app in <strong>App Center<\/strong> is NOT provided by QNAP and thus they will not maintain this app with updated versions.  The maintainer of this app obviously has chosen to not update it.  There are others out there publishing more up to date apps that can be manually installed, however in my experience those were not stable\/reliable options.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The RIGHT Way to Install Mattermost on QNAP<\/h3>\n\n\n\n<p>Thankfully QNAP provides <strong>Container Station<\/strong> and Mattermost is available as a Docker container.  Thus, a simple path to a successful installation is available.  There is one (solvable) caveat here &#8211; Mattermost requires Postgres as the database to store the chat data in.  And thankfully, <em>there&#8217;s a container for that<\/em>!<\/p>\n\n\n\n<p>All that said, the solution to run Mattermost on a QNAP NAS is:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install and run Postgres in <strong>Container Station<\/strong><\/li>\n\n\n\n<li>Install and run Mattermost in <strong>Container Station<\/strong>\n<ul class=\"wp-block-list\">\n<li>The Mattermost container will connect to the Postgres container<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Install Postgres via Container Station<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.postgresql.org\/\" target=\"_blank\" rel=\"noopener\" data-lasso-id=\"881\">Postgres<\/a> is a database using SQL (standard query language).  This is where all the data for Mattermost will be stored &#8211; the conversations, users, boards, etc.<\/p>\n\n\n\n<p>These instructions will install Postgres with Container Station 2 in Container Station.  Additionally this will install phppgadmin as well &#8211; a web interface that can be used to access and manage the Postgres database.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open <strong>Container Station<\/strong><\/li>\n\n\n\n<li>Click the <strong>Create<\/strong> menu option in the left hand menu<\/li>\n\n\n\n<li>Click the <strong>+ Create Application<\/strong> button in the top right\n<ul class=\"wp-block-list\">\n<li><img decoding=\"async\" width=\"424\" height=\"393\" class=\"wp-image-3204\" style=\"width: 500px\" src=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image.png\" alt=\"Create application in Container Station\" srcset=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image.png 424w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-150x139.png 150w\" sizes=\"(max-width: 424px) 100vw, 424px\" \/><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>In the bottom left corner of the new screen, select <strong>PostgreSQL<\/strong> from the <strong>Sample<\/strong> dropdown\n<ul class=\"wp-block-list\">\n<li><img decoding=\"async\" width=\"1088\" height=\"289\" class=\"wp-image-3205\" style=\"width: 500px\" src=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-1.png\" alt=\"Select the Postgres sample template\" srcset=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-1.png 1088w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-1-500x133.png 500w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-1-1024x272.png 1024w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-1-768x204.png 768w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-1-150x40.png 150w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-1-600x159.png 600w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-1-450x120.png 450w\" sizes=\"(max-width: 1088px) 100vw, 1088px\" \/><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Optional Configuration: \n<ul class=\"wp-block-list\">\n<li><strong>Username and Password:<\/strong> \n<ul class=\"wp-block-list\">\n<li>The default username and password are defined by the <code>POSTGRES_USER<\/code> and <code>POSTGRES_PASSWORD<\/code> variables in the <code>postgres<\/code> <code>environment<\/code> section.  The default for both are <code>qnap_postgres<\/code><\/li>\n\n\n\n<li>The username and password can be changed at this time if desired.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Data Storage Location:<\/strong>\n<ul class=\"wp-block-list\">\n<li>The default location that the data will be stored is: <code>\/share\/Container\/postgresdb:\/var\/lib\/postgresql\/data<\/code><\/li>\n\n\n\n<li>This location can be changed in the <code>poastgres<\/code> <code>volumes<\/code> section of the YAML configuration here.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>phppgadmin<\/strong>:\n<ul class=\"wp-block-list\">\n<li>If phppgadmin isn&#8217;t desired, remove that section of configuration from the YAML file here before proceeding.  This is not recommended&#8230;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Click <strong>Create<\/strong><\/li>\n\n\n\n<li>Wait until this is done<\/li>\n<\/ol>\n\n\n\n<p>Postgres is now installed and running.  Clicking on the <strong>Container<\/strong> left hand menu option in <strong>Container Station<\/strong> should show Memory and CPU usage for this container to confirm it&#8217;s online.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Create a Database for Mattermost in Postgres<\/h2>\n\n\n\n<p>A database needs to be created in Postgres for the Mattermost application.  This should be done before setting up the Mattermost container.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open <strong>Container Station<\/strong><\/li>\n\n\n\n<li>Click the <strong>Container<\/strong> menu option in the left hand menu<\/li>\n\n\n\n<li>Click the <strong>triangle<\/strong> icon on the left hand side of the <strong>Postgres<\/strong> application to expand it<\/li>\n\n\n\n<li>Click the <strong>link<\/strong> icon for the <strong>phppgadmin<\/strong> container to open the <strong>phppgadmin<\/strong> web application.\n<ul class=\"wp-block-list\">\n<li>It may take a few seconds for this icon to show.<\/li>\n\n\n\n<li><img decoding=\"async\" width=\"1582\" height=\"461\" class=\"wp-image-3206\" style=\"width: 500px\" src=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-2.png\" alt=\"Open phppgadmin from the Container Station application\" srcset=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-2.png 1582w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-2-500x146.png 500w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-2-1024x298.png 1024w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-2-768x224.png 768w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-2-150x44.png 150w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-2-600x175.png 600w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-2-1536x448.png 1536w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-2-450x131.png 450w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-2-1360x396.png 1360w\" sizes=\"(max-width: 1582px) 100vw, 1582px\" \/><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>In the <strong>phppgadmin<\/strong> web interface, click on the <strong>PostgreSQL<\/strong> text link in the top left and login with the username and password from creating the container.<\/li>\n\n\n\n<li>Click the <strong>Create Database<\/strong> text link.\n<ul class=\"wp-block-list\">\n<li><img decoding=\"async\" width=\"731\" height=\"360\" class=\"wp-image-3208\" style=\"width: 500px\" src=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-4.png\" alt=\"Click the Create Database link in phppgadmin\" srcset=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-4.png 731w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-4-500x246.png 500w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-4-150x74.png 150w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-4-600x295.png 600w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/image-4-450x222.png 450w\" sizes=\"(max-width: 731px) 100vw, 731px\" \/><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Enter a name in the <strong>Name<\/strong> field<\/li>\n\n\n\n<li>Click the <strong>Create<\/strong> button<\/li>\n<\/ol>\n\n\n\n<p>Now that a database has been setup all the pre-requisites are complete.  The next step is to install Mattermost.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install Mattermost via Container Station<\/h2>\n\n\n\n<p>Mattermost is the actual chat software that needs to be installed.  It&#8217;ll utilize the Postges database that was created above to store the data.<\/p>\n\n\n\n<p>There are two ways to install Mattermost in Container Station.  It is strongly suggested that you utilize an <strong>Application<\/strong> within Container Station (<a href=\"#install-option-1\">Option 1<\/a>) using Mattermost yml configuration as it provides a bit more flexibility in the setup that results in controlling where the data for the container is stored.  This is important for when the version is updated [<a href=\"https:\/\/promincproductions.com\/blog\/update-container-version-in-qnap-container-station-2\/\" data-lasso-id=\"882\">tutorial<\/a>] that it always references the same volume.  If not, images, log data, etc. will not be connected and will result in an issue.  The alternative method is to install a <strong>Container<\/strong> using the Container Station GUI (<a href=\"#install-option-2\">Option 2<\/a>).  This method doesn&#8217;t provide the necessary ability to set the Linux user and container directories correctly.<\/p>\n\n\n\n<p>Despite the strong recommendation to install Mattermost via an Application (<a href=\"http:\/\/@install-option-1\" data-lasso-id=\"883\">Option 1<\/a>), both options are provided here as a reference.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-option-1\">Option 1: Create an Application in Container Station (<strong>preferred<\/strong> method)<\/h3>\n\n\n\n<p>When creating the application, a location to store images and files will be defined.  This can be reused when installing future updated versions of the Mattermost docker image.  This makes for easy upgrades in the future with no degradation to the user experience as the locations referenced in the database will always point to the location specified in the yml configuration. <\/p>\n\n\n\n<p>If you&#8217;re not familiar with yml (or yaml) configuration, don&#8217;t worry.  The supplied sample below is complete and provides what is needed to get up and running.  YAML (which stands for <em>yet another markup language<\/em>) is a clean simple way to define configuration that Docker (the technology that is really running behind Container Station) uses to setup your system.<\/p>\n\n\n\n<p>Since Mattermost will be writing data (images, files, logs, etc.) to the filesystem a Linux\/QNAP username and group need to be specified in the yaml configuration.  Technically speaking the <code>admin:administrators<\/code> user and group pair could be used (<code>0:0<\/code>).  This is bad practice however as that user has the highest level of access to the system.  If you don&#8217;t know much about cyber-security consider this your first lesson: don&#8217;t give software any more access\/privileges than it needs.  Software can&#8217;t be malicious if it doesn&#8217;t have access to things it shouldn&#8217;t.  (case and point: <a href=\"https:\/\/arstechnica.com\/information-technology\/2023\/02\/lastpass-hackers-infected-employees-home-computer-and-stole-corporate-vault\/\" target=\"_blank\" rel=\"nofollow noopener\" data-lasso-id=\"884\">lastpass hacked through a developers installation of Plex on their device<\/a>)<\/p>\n\n\n\n<p>After that is done, we get the Docker image and use it in an Application and Mattermost will be up and running!<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Create a Directory to Store Mattermost Content<\/h4>\n\n\n\n<p>A directory needs to be made to store the Mattermost content (images, log data, etc.) in the filesystem.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Login to the QNAP web admin<\/li>\n\n\n\n<li>From the main menu, choose <strong>File Station<\/strong><\/li>\n\n\n\n<li>Select the <strong>Container<\/strong> directory in the root level of the file structure in the left hand menu<\/li>\n\n\n\n<li>Click the <code>+<\/code> folder icon and choose <strong>Folder<\/strong> to create a new folder<\/li>\n\n\n\n<li>Enter the name <code>mattermost<\/code> and click <strong>Ok<\/strong>.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Create a QNAP User and Group<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Login to the QNAP web admin<\/li>\n\n\n\n<li>From the main menu choose <strong>Users<\/strong><\/li>\n\n\n\n<li>Select the <strong>User Groups<\/strong> tab<\/li>\n\n\n\n<li>Click the <strong>Create<\/strong> button\n<ul class=\"wp-block-list\">\n<li>Enter <code>Integrations<\/code> into the <strong>User group name:<\/strong> field<\/li>\n\n\n\n<li>Click the <strong>Create<\/strong> button<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Select the <strong>Users<\/strong> tab<\/li>\n\n\n\n<li>Click the <strong>Create<\/strong> button and choose <strong>Create a User<\/strong>\n<ul class=\"wp-block-list\">\n<li>Enter <code>Mattermost<\/code> in the <strong>Username<\/strong> field<\/li>\n\n\n\n<li>Enter a password in the <strong>Password<\/strong> and <strong>Verify Password<\/strong> fields<\/li>\n\n\n\n<li>Click the <strong>Edit<\/strong> button in the <strong>User Group<\/strong> section and check the <code>Integrations<\/code> group<\/li>\n\n\n\n<li>Click the <strong>Edit<\/strong> button in the <strong>Shared Folder Permissions<\/strong> <\/li>\n\n\n\n<li>Check the <strong>RW<\/strong> (read and write) box for the <code>Container<\/code> directory and <strong>Deny<\/strong> for all of the other directories.<\/li>\n\n\n\n<li>Click the <strong>Edit<\/strong> button for the <strong>Edit Application Privilege<\/strong> section.<\/li>\n\n\n\n<li>Uncheck all of the <strong>Application<\/strong> options.<\/li>\n\n\n\n<li>Click the <strong>Create<\/strong> button<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/image-1024x603.png\" alt=\"Create a user in QNAP for Container Station access\" class=\"wp-image-3283\" width=\"638\" height=\"376\" title=\"Create a user in QNAP for Container Station access\" srcset=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/image-1024x603.png 1024w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/image-500x295.png 500w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/image-768x452.png 768w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/image-150x88.png 150w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/image-600x353.png 600w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/image-450x265.png 450w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/image-1019x600.png 1019w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/image.png 1202w\" sizes=\"(max-width: 638px) 100vw, 638px\" \/><\/figure>\n<\/div>\n\n\n<h4 class=\"wp-block-heading\">Get the New User and Group IDs<\/h4>\n\n\n\n<p>Users and groups in a Linux operating system (Linux is the kernel that QNAP runs on) are assigned a numeric ID.  These will be needed to configure the Mattermost Application yaml.  Sadly QNAP doesn&#8217;t expose these IDs in the web admin, so SSH access will be needed to find these IDs.  If you don&#8217;t have SSH access setup to the server yet, follow the <a href=\"https:\/\/www.qnap.com\/en\/how-to\/faq\/article\/how-do-i-access-my-qnap-nas-using-ssh\" target=\"_blank\" rel=\"noopener\" data-lasso-id=\"885\">QNAP SSH tutorial<\/a> to get that access setup.<\/p>\n\n\n\n<p>Linux stores the user and group information in files <code>\/etc\/passwd<\/code> and <code>\/etc\/groups<\/code> respectively.  A command line based program called <code>grep<\/code> can search a file and return the lines that match.  Another program <code>awk<\/code> can be used to parse the line returned to get just specific data that is desired.  These values will be needed in the step below for the Mattermost yaml code.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Get User ID (UID) via Command Line for Specific User Name<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>grep Container \/etc\/passwd | awk -F ':' '{ print $3; }'<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Get Group ID (GID) via Command Line for Specific Group Name<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>grep Integrations \/etc\/group | awk -F ':' '{ print $3; }'<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Get the Mattermost Image from Docker Hub<\/h4>\n\n\n\n<p>Mattermost publishes an image of their software on <a href=\"https:\/\/hub.docker.com\/r\/mattermost\/mattermost-enterprise-edition\" target=\"_blank\" rel=\"noopener\" data-lasso-id=\"886\">Docker Hub<\/a> that will be used by the Container Station application in QNAP to run Mattermost.  That image needs to be fetched from Docker Hub to the QNAP server.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Login to the QNAP web admin<\/li>\n\n\n\n<li>From the main menu choose <strong>Container Station<\/strong><\/li>\n\n\n\n<li>From the left hand menu select <strong>Images<\/strong><\/li>\n\n\n\n<li>Click the <strong>Pull<\/strong> button\n<ul class=\"wp-block-list\">\n<li><strong>Registry:<\/strong> <code>Docker Hub<\/code><\/li>\n\n\n\n<li><strong>Image Name:<\/strong> <code>mattermost\/mattermost-enterprise-edition<\/code><\/li>\n\n\n\n<li><strong>Image Version:<\/strong> <code>latest<\/code><\/li>\n\n\n\n<li>Click the <strong>Pull<\/strong> button<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>It&#8217;ll take a little while for the image to pull down.  A progress bar is shown in the top right corner of the <strong>Container Station<\/strong> window in the <strong>Background Tasks<\/strong> dropdown menu.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Create the Mattermost Application in Container Station<\/h4>\n\n\n\n<p>All the steps above finally lead to the point we&#8217;ve really wanted to get to &#8211; being able to actually install Mattermost!  This step is where the Mattermost software will be installed onto the QNAP server.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Login to the QNAP web admin<\/li>\n\n\n\n<li>From the main menu choose <strong>Container Station<\/strong><\/li>\n\n\n\n<li>Click on <strong>Create<\/strong> in the left hand menu<\/li>\n\n\n\n<li>Click the <strong>+ Create Application<\/strong> button<\/li>\n\n\n\n<li>Enter a recognizable name in the <strong>Application Name<\/strong> field like <code>mattermostenterprise77<\/code> (alphanumeric only allowed)<\/li>\n\n\n\n<li>Copy and paste the below yaml into the <strong>YAML<\/strong> text box (replacing anything else in the box).  Replace values in the sample code below like <code>&lt;sample&gt;<\/code> with your specific values.<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>version: \"3\"\n\nservices:\n  mattermost:\n    image: mattermost\/mattermost-enterprise-edition:latest\n    restart: unless-stopped\n    user: &lt;qnap_user_id&gt;:&lt;qnap_group_id&gt;\n    environment:\n      MM_FEATUREFLAGS_BoardsProduct: true\n      MM_NO_DOCKER: true\n      MM_SERVICESETTINGS_SITEURL: http:\/\/<span style=\"background-color: initial;font-family: inherit;font-size: inherit;color: initial\">&lt;ip-address-of-the-qnap-server&gt;:8065<\/span>      MM_SQLSETTINGS_DATASOURCE: postgres:\/\/<span style=\"background-color: initial;font-family: inherit;font-size: inherit;color: initial\">&lt;postres-username-from-postres-app-setup&gt;:<\/span><code><code>&lt;postres-password-from-postres-app-setup&gt;<span style=\"background-color: initial;font-family: inherit;font-size: inherit;color: initial\">@127.0.0.1:5432\/mattermost?sslmode=disable&amp;connect_timeout=10<\/span><\/code><\/code>      PATH: \/mattermost\/bin:\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin\n    volumes:\n      - \/share\/Container\/mattermost\/client\/plugins:\/mattermost\/client\/plugins\n      - \/share\/Container\/mattermost\/config:\/mattermost\/config\n      - \/share\/Container\/mattermost\/data:\/mattermost\/data\n      - \/share\/Container\/mattermost\/logs:\/mattermost\/logs\n      - \/share\/Container\/mattermost\/plugins:\/mattermost\/plugins\n    network_mode: host<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"7\">\n<li>Click the <strong>Validate YAML<\/strong> button.  If you get a green checkmark you&#8217;re clear to proceed.  If not, something in the yaml configuration needs to be adjusted and re-validated.<\/li>\n\n\n\n<li>Click the <strong>Create<\/strong> button<\/li>\n\n\n\n<li>It&#8217;ll take a minute or two for the application to be created and start running.\n<ul class=\"wp-block-list\">\n<li>The Container Station background tasks icon (top right) will show this process.<\/li>\n\n\n\n<li>Even after that is done it&#8217;ll take a few minutes for the container to fully load.\n<ul class=\"wp-block-list\">\n<li>Click on <strong>Container<\/strong> in the left hand menu<\/li>\n\n\n\n<li>Click the&nbsp;<strong>triangle<\/strong>&nbsp;icon on the left hand side of the <strong>Mattermost<\/strong> application<\/li>\n\n\n\n<li>Click on the blue text link of the Docker container in the application.  In the black portion of the screen is a log of what the container is doing and should indicate when the system is up and running.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-option-2\">Option 2: Install a Container in Container Station (non-preferred method)<\/h3>\n\n\n\n<p>This method utilizes the pre-built container configuration provided by the Mattermost docker container.  The container is created using the Container Station graphical interface.  This will result in a system-defined location of the volume that will not persist when the container is updated [<a href=\"https:\/\/promincproductions.com\/blog\/update-container-version-in-qnap-container-station-2\/\" data-lasso-id=\"887\">tutorial<\/a>] in Container Station to a newer version of Mattermost, thus breaking all of the images and files shared in Mattermost.  This is a very fast and easy method to setup, though the speed gain is negligible over <a href=\"#install-option-2\">Option 1<\/a>.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open <strong>Container Station<\/strong><\/li>\n\n\n\n<li>Click the <strong>Create<\/strong> menu option in the left hand menu<\/li>\n\n\n\n<li>Search for <code>mattermost<\/code> in the search box<\/li>\n\n\n\n<li>Select the <strong>Docker Hub<\/strong> tab<\/li>\n\n\n\n<li>Click the <strong>Install<\/strong> button for the <code>mattermost\/mattermost-enterprise-edition<\/code> option.\n<ul class=\"wp-block-list\">\n<li>The <code>mattermost\/mattermost-team-edition<\/code> is a usable option as well however not recommended.  The <code>enterprise<\/code> option is the full suite which includes the <code>team<\/code> version in it.  If a paid plan will be used, <code>enterprise<\/code> is the required option here.  The Mattermost explanation of the difference of these options can be found here: <a href=\"https:\/\/docs.mattermost.com\/about\/editions-and-offerings.html#self-hosted-editions\" target=\"_blank\" rel=\"noopener\" data-lasso-id=\"888\">Mattermost Editions Explained<\/a><\/li>\n\n\n\n<li><img decoding=\"async\" width=\"1895\" height=\"607\" class=\"wp-image-3212\" style=\"width: 500px\" src=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/install-mattermost-enterprise-container-from-docker-hub.png\" alt=\"Install the Mattermost  Enterprise container from Docker Hub\" srcset=\"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/install-mattermost-enterprise-container-from-docker-hub.png 1895w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/install-mattermost-enterprise-container-from-docker-hub-500x160.png 500w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/install-mattermost-enterprise-container-from-docker-hub-1024x328.png 1024w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/install-mattermost-enterprise-container-from-docker-hub-768x246.png 768w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/install-mattermost-enterprise-container-from-docker-hub-150x48.png 150w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/install-mattermost-enterprise-container-from-docker-hub-600x192.png 600w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/install-mattermost-enterprise-container-from-docker-hub-1536x492.png 1536w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/install-mattermost-enterprise-container-from-docker-hub-450x144.png 450w, https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/02\/install-mattermost-enterprise-container-from-docker-hub-1360x436.png 1360w\" sizes=\"(max-width: 1895px) 100vw, 1895px\" \/><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Select <strong>latest<\/strong> from the dropdown\n<ul class=\"wp-block-list\">\n<li>If a specific version is desired, this is where that would be selected<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>The default settings for the container are sufficient for most of the configuration.  But a few custom settings need to be set.\n<ul class=\"wp-block-list\">\n<li>On the <strong>Create Container<\/strong> page:\n<ul class=\"wp-block-list\">\n<li>Set the <strong>CPU Limit<\/strong> to <code>75%<\/code><\/li>\n\n\n\n<li>Set the <strong>Memory Limit<\/strong> to around <code>75%<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Click on <strong>Advanced Settings &gt;&gt;<\/strong><\/li>\n\n\n\n<li>On the <strong>Environment<\/strong> tab:\n<ul class=\"wp-block-list\">\n<li>Click the <strong>Add<\/strong> button and add the following settings:\n<ul class=\"wp-block-list\">\n<li><code>MM_FEATUREFLAGS_BoardsProduct<\/code> = <code>true<\/code><\/li>\n\n\n\n<li><code>MM_NO_DOCKER<\/code> = <code>true<\/code><\/li>\n\n\n\n<li><code>MM_SERVICESETTINGS_SITEURL<\/code> = <code>http:\/\/&lt;ip-address-of-the-qnap-server&gt;:8065<\/code><\/li>\n\n\n\n<li><code>MM_SQLSETTINGS_DATASOURCE<\/code> = <code>postgres:\/\/&lt;postres-username-from-postres-app-setup&gt;:<code>&lt;postres-password-from-postres-app-setup&gt;<\/code>@127.0.0.1:5432\/mattermost?sslmode=disable&amp;connect_timeout=10<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>On the <strong>Network<\/strong> tab:\n<ul class=\"wp-block-list\">\n<li>Set the <strong>Network Mode<\/strong> to <strong>Host<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Click the <strong>Create<\/strong> button<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Accessing Mattermost<\/h3>\n\n\n\n<p>Regardless if <a href=\"#install-option-1\">Option 1<\/a> or <a href=\"#install-option-2\">Option 2<\/a> were used, once those steps are complete Mattermost can be accessed and used!<\/p>\n\n\n\n<p>Open Mattermost via a web browser at <code>http:\/\/&lt;ip-address-of-the-qnap-server&gt;:8065<\/code>.<\/p>\n\n\n\n<p>Alternatively Mattermost provides <a href=\"https:\/\/mattermost.com\/download\/#desktop\" target=\"_blank\" rel=\"nofollow noopener\" data-lasso-id=\"889\">desktop<\/a> and <a href=\"https:\/\/mattermost.com\/download\/#mobile\" target=\"_blank\" rel=\"nofollow noopener\" data-lasso-id=\"890\">mobile<\/a> applications.  Those applications will ask for the same address as the web browser uses to connect to the Mattermost server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Image Storage<\/h2>\n\n\n\n<p>Mattermost stores images in two ways.  In the Postgres database table <code>fileinfo<\/code> is where this information is stored.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>An extremely low resolution base64 encoded representation of the image is stored in field <code>minipreview<\/code> in table <code>fileinfo<\/code>.<\/li>\n\n\n\n<li>Various sizes of the image are stored in the filesystem in the <code>data<\/code> directory and the filename\/path is specified in table <code>fileinfo<\/code>.<\/li>\n<\/ol>\n\n\n\n<p>Images are stored in dated directories.<\/p>\n\n\n\n<p>If <a href=\"#install-option-1\">Option 1<\/a> was used to install Mattermost, the location on the filesystem of the <code>data<\/code> directory for the full-sized images was specified.  This makes it easy if the server ever needs to be migrated, data recovery is needed, etc.  Additionally, if the docker container is ever updated to a newer version for security or feature reasons, the directory of the images is known and thus not an issue to ensure the updated version is connected to.<\/p>\n\n\n\n<p>However if <a href=\"#install-option-2\">Option 2<\/a> was used a random hashname is used for the image directory and is stored in a location like this: <code>\/share\/CACHEDEV1_DATA\/Container\/container-station-data\/lib\/docker\/volumes\/982c23e022dfc41037219e71763b87b699dc1bf04724c256f7213f9e40a38064\/_data<\/code>.  Then when the container is updated some day in the future a new random hash will be used, thus losing the connection to the older images.  Copying\/moving the images from the old directory should reconnect them to Mattermost as the directory name is not stored in the database, however in my experience I struggled to reconnect all images in a move.  Thus why I recommend the slight extra effort of <a href=\"#install-option-1\">Option 1<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">QNAP Specifications<\/h2>\n\n\n\n<p>Any QNAP server should work, but for reference this is the configuration this tutorial was based on.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>QNAP TS-251 (<a href=\"https:\/\/amzn.to\/3LFiFzF\" target=\"_blank\" rel=\"nofollow noopener\" data-lasso-id=\"891\">buy on Amazon<\/a>)\n<ul class=\"wp-block-list\">\n<li>4GB RAM<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>QTS 5.0.1.2277<\/li>\n\n\n\n<li>Container Station 2<\/li>\n\n\n\n<li>Mattermost Enterprise 7.7<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Installing Mattermost on a QNAP server is achievable using Container Station. Mattermost provides a Docker container that makes [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3290,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wprm-recipe-roundup-name":"","wprm-recipe-roundup-description":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[18,384],"tags":[459,330],"class_list":["post-3179","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computers","category-qnap","tag-mattermost","tag-qnap"],"jetpack_featured_media_url":"https:\/\/promincproductions.com\/blog\/wp-content\/uploads\/2023\/03\/mattermost-on-qnap-container-station.png","jetpack_shortlink":"https:\/\/wp.me\/p4BbcR-Ph","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/posts\/3179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/comments?post=3179"}],"version-history":[{"count":19,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/posts\/3179\/revisions"}],"predecessor-version":[{"id":3359,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/posts\/3179\/revisions\/3359"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/media\/3290"}],"wp:attachment":[{"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/media?parent=3179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/categories?post=3179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/promincproductions.com\/blog\/wp-json\/wp\/v2\/tags?post=3179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}