### Install and Start Apache HTTP Server for RHEL Mirror Source: https://docs.mattermost.com/deployment-guide/reference-architecture/deployment-scenarios/air-gapped-deployment.html Installs and enables the Apache HTTP server to host the RHEL package mirror. ```bash yum install httpd systemctl enable httpd systemctl start httpd ``` -------------------------------- ### Install Mattermost Desktop App using MSI Source: https://docs.mattermost.com/deployment-guide/desktop/desktop-msi-installer-and-group-policy-install.html Install the Mattermost Desktop App by double-clicking the MSI installer. Administrator privileges are required for installation. -------------------------------- ### dbcmp Example with DSN Strings Source: https://docs.mattermost.com/deployment-guide/manual-postgres-migration.html An example command demonstrating how to provide DSN strings for both source and target databases when using dbcmp. The PostgreSQL DSN must start with 'postgres://'. ```bash dbcmp --source "user:password@tcp(address:3306)/db_name --target "postgres://user:password@address:5432/db_name ``` -------------------------------- ### Download and Install Loki Source: https://docs.mattermost.com/administration-guide/scale/deploy-grafana-loki-for-centralized-logging.html Installs Loki binary and copies the configuration file. Ensure you have `unzip` installed. ```bash sudo apt-get install -y unzip cd /tmp curl -LO https://github.com/grafana/loki/releases/download/v3.4.2/loki-linux-amd64.zip unzip loki-linux-amd64.zip sudo mv loki-linux-amd64 /opt/loki/bin/loki sudo chmod +x /opt/loki/bin/loki ``` ```bash sudo cp loki-config.yaml /opt/loki/loki-config.yaml ``` -------------------------------- ### Get Mattermost Version (Default Installation) Source: https://docs.mattermost.com/administration/command-line-tools.html Run this command from the Mattermost root directory to display the Mattermost version. Ensure you run the binary as the `mattermost` user to avoid permission issues. ```bash cd /opt/mattermost/ sudo -u mattermost bin/mattermost version ``` -------------------------------- ### Start Mattermost Server Source: https://docs.mattermost.com/administration/upgrade.html Starts the Mattermost server using systemd. ```bash sudo systemctl start mattermost ``` -------------------------------- ### Enable and Start Elasticsearch Service Source: https://docs.mattermost.com/administration-guide/scale/elasticsearch-setup.html Use these commands to enable the Elasticsearch service to start on boot and then start it immediately. ```bash sudo /bin/systemctl daemon-reload sudo /bin/systemctl enable elasticsearch.service sudo systemctl start elasticsearch.service ``` -------------------------------- ### Enable and Start OpenSearch Service Source: https://docs.mattermost.com/administration-guide/scale/opensearch-setup.html Reloads the systemd daemon, enables the OpenSearch service to start on boot, and starts the service. ```bash sudo systemctl daemon-reload sudo systemctl enable opensearch sudo systemctl start opensearch sudo systemctl status opensearch ``` -------------------------------- ### Get Mattermost Version (Docker Install) Source: https://docs.mattermost.com/administration/command-line-tools.html Use this command to get the Mattermost version when installed via Docker. Replace `` with your actual container name. ```bash docker exec -it mattermost version ``` -------------------------------- ### Copy environment example file Source: https://docs.mattermost.com/deployment-guide/server/deploy-containers.html Create your .env file by copying the env.example file. Remember to edit the DOMAIN and MM_SUPPORTSETTINGS_SUPPORTEMAIL values. ```bash cp env.example .env ``` -------------------------------- ### Serve Aptly Mirror Repository Source: https://docs.mattermost.com/deployment-guide/reference-architecture/deployment-scenarios/air-gapped-deployment.html Starts a local web server to serve the Aptly mirror repository over HTTP. ```bash aptly serve ``` -------------------------------- ### Get Mattermost Installation Status Source: https://docs.mattermost.com/deployment-guide/server/deploy-kubernetes.html Use this command to review the status of your Mattermost installation after it has been created by the Operator. ```bash kubectl -n [namespace] get mattermost ``` -------------------------------- ### Example config.json for Pre-configuration Source: https://docs.mattermost.com/deployment-guide/desktop/silent-windows-desktop-distribution.html Create this `config.json` file in the user's Mattermost data directory (`%APPDATA%\Mattermost\config.json`) before the first launch to pre-configure servers and settings. ```json { "version": 2, "teams": [ { "name": "core", "url": "https://community.mattermost.com", "order": 0 }, { "name": "hq", "url": "https://hq.example.com", "order": 1 } ], "showTrayIcon": true, "trayIconTheme": "light", "minimizeToTray": true, "notifications": { "flashWindow": 2, "bounceIcon": true, "bounceIconType": "informational" }, "showUnreadBadge": true, "useSpellChecker": true, "enableHardwareAcceleration": true, "autostart": false, "spellCheckerLocale": "en-US", "darkMode": false } ``` -------------------------------- ### Find Mattermost Product Code GUID Source: https://docs.mattermost.com/deployment-guide/desktop/silent-windows-desktop-distribution.html Use this PowerShell command to find the Product Code GUID for your installed Mattermost version, which is required for silent uninstallation. ```powershell Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -like "*Mattermost*"} | Select-Object Name, IdentifyingNumber ``` -------------------------------- ### Install migration-assist Tool Source: https://docs.mattermost.com/deployment-guide/postgres-migration-assist-tool.html Install the latest version of the `migration-assist` tool using Go version 1.22 or later. ```bash go install github.com/mattermost/migration-assist/cmd/migration-assist@latest ``` -------------------------------- ### Run Go Profiler Source: https://docs.mattermost.com/administration-guide/scale/performance-monitoring-metrics.html Use the Go tool pprof to run the profiler against a specified duration. Replace `localhost` with your server name and `` with the correct port number. ```bash go tool pprof http://localhost:/debug/pprof/profile?seconds= ``` -------------------------------- ### Mattermost DB Reset Example Source: https://docs.mattermost.com/administration/command-line-tools.html Resets the database to its initial state by truncating all tables except `migrations`. This command does not start the application server. ```bash bin/mattermost db reset ``` -------------------------------- ### Create Directories and Set Permissions Source: https://docs.mattermost.com/administration-guide/configure/calls-offloader-setup.html Use these commands to create necessary directories and set ownership for the calls-offloader service. ```bash sudo mkdir -p /opt/calls-offloader/data/db sudo useradd --system --home /opt/calls-offloader calls-offloader sudo chown -R calls-offloader:calls-offloader /opt/calls-offloader ``` -------------------------------- ### Get System Logs Between Two Times Source: https://docs.mattermost.com/deployment-guide/server/troubleshooting.html Retrieve system logs within a specific time range. Replace the timestamps with the desired start and end times. ```bash sudo journalctl --since "2020-08-23 17:15:00" --until "2020-08-23 16:30:00" > mattermost_journalctl.log ``` -------------------------------- ### Create Sample Users with Profile Pictures Source: https://docs.mattermost.com/administration-guide/manage/mmctl-command-line-tool.html Generate sample users and assign profile pictures from a specified local directory. ```bash mmctl sampledata --profile-images ./images/profiles ``` -------------------------------- ### Systemd Service Configuration for Mattermost Source: https://docs.mattermost.com/deploy/server/preparations.html This is an example systemd service file for Mattermost. It includes basic setup, restart policies, and commented-out proxy environment variables. ```systemd [Unit] Description=Mattermost After=network.target After=postgresql.service BindsTo=postgresql.service [Service] Type=notify ExecStart=/opt/mattermost/bin/mattermost TimeoutStartSec=3600 KillMode=mixed Restart=always RestartSec=10 WorkingDirectory=/opt/mattermost User=mattermost Group=mattermost LimitNOFILE=49152 # Configure proxy settings if needed #Environment=HTTP_PROXY=http://proxy.example.com:3128 #Environment=HTTPS_PROXY=https://proxy.example.com:3128 #Environment=NO_PROXY=localhost,127.0.0.1,.internal.example.com # Recommended security options ProtectSystem=full PrivateTmp=true NoNewPrivileges=true [Install] WantedBy=postgresql.service ``` -------------------------------- ### Create Loki User and Directories Source: https://docs.mattermost.com/administration-guide/scale/deploy-grafana-loki-for-centralized-logging.html Set up a dedicated system user and necessary directories for Loki on the monitoring server. This prepares the environment for Loki installation. ```bash # Create a dedicated system user sudo useradd --system --no-create-home --shell /bin/false loki # Create directories sudo mkdir -p /opt/loki/data /opt/loki/bin ``` -------------------------------- ### Terraform Docker OpenSearch Setup Source: https://docs.mattermost.com/administration-guide/scale/opensearch-setup.html Use this Terraform configuration to set up a single-node OpenSearch instance using Docker. It includes installing the ICU analysis plugin. ```terraform provider "docker" { host = "unix:///var/run/docker.sock" } resource "docker_image" "opensearch" { name = "opensearchproject/opensearch:2.9.0" } resource "docker_container" "opensearch" { name = "opensearch" image = docker_image.opensearch.latest ports { internal = 9200 external = 9200 } ports { internal = 9600 external = 9600 } env = [ "cluster.name=mattermost-cluster", "network.host=0.0.0.0", "discovery.type=single-node", # remove for multi-node ] restart = "unless-stopped" } resource "null_resource" "install_icu_plugin" { depends_on = [docker_container.opensearch] provisioner "local-exec" { command = "docker exec opensearch /usr/share/opensearch/bin/opensearch-plugin install analysis-icu && docker restart opensearch" } } ``` -------------------------------- ### Install Plugin from URL with mmctl Source: https://docs.mattermost.com/administration-guide/manage/mmctl-command-line-tool.html Install plugins by providing URLs to their compressed .tar.gz files. Ensure plugins are enabled in the server's configuration settings. ```bash # You can install one plugin $ mmctl plugin install-url https://example.com/mattermost-plugin.tar.gz ``` -------------------------------- ### Delete Old Files During Upgrade Source: https://docs.mattermost.com/administration/upgrade.html Use this command to remove old files and directories from the Mattermost installation, excluding specific directories like 'client', 'config', 'logs', 'plugins', 'data', and a custom folder. The `-o -path mattermost/yourFolderHere` part is an example and should be adjusted. ```bash sudo find mattermost/ mattermost/client/ -mindepth 1 -maxdepth 1 \! \( -type d \( -path mattermost/client -o -path mattermost/client/plugins -o -path mattermost/config -o -path mattermost/logs -o -path mattermost/plugins -o -path mattermost/data -o -path mattermost/yourFolderHere \) -prune \) | sort | sudo xargs rm -r ``` -------------------------------- ### Example config.json structure for SiteURL Source: https://docs.mattermost.com/configure/environment-configuration-settings.html Illustrates the structure of the config.json file, showing the path to the SiteURL setting within ServiceSettings. ```json { "ServiceSettings": { "SiteURL": "https://example.com/company/mattermost" } } ``` -------------------------------- ### Configure helpLink for desktop app Source: https://docs.mattermost.com/deployment-guide/desktop/distribute-a-custom-desktop-app.html Set the URL for the help documentation accessible from the Help > Learn More menu. If not specified, this menu option is hidden. Expects a string. ```typescript helpLink: 'https://docs.mattermost.com/messaging/managing-desktop-app-servers.html' ``` ```typescript helpLink: '' ``` -------------------------------- ### Install NGINX on Ubuntu Source: https://docs.mattermost.com/deployment-guide/server/setup-nginx-proxy.html Installs NGINX using the apt package manager. Update the package index before installing. ```bash sudo apt update sudo apt install nginx ``` -------------------------------- ### Set up Mattermost APT Repository Source: https://docs.mattermost.com/deployment-guide/desktop/linux-desktop-install.html Configure the Mattermost APT repository on Debian-based systems. This script downloads and installs the necessary GPG key and repository configuration. ```bash curl -fsS -o- https://deb.packages.mattermost.com/setup-repo.sh | sudo bash ```