{"id":3321,"date":"2022-03-12T23:07:20","date_gmt":"2024-01-31T07:12:38","guid":{"rendered":""},"modified":"2025-02-02T00:46:20","modified_gmt":"2025-02-01T23:46:20","slug":"install-mattermost-with-nginx-and-let-039-s-encrypt-on-windows-vps","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/install-mattermost-with-nginx-and-let-039-s-encrypt-on-windows-vps\/","title":{"rendered":"Install Mattermost with Nginx and Let&#039;s Encrypt on Windows VPS"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<h1>\u00a0<\/h1>\n<h2>Introduction<\/h2>\n<p>This guide walks you through the installation of Mattermost on a Windows VPS using Nginx as a reverse proxy and securing it with a free SSL certificate from Let&#8217;s Encrypt.<\/p>\n<h2>Prerequisites<\/h2>\n<ul>\n<li>A Windows VPS with administrative access.<\/li>\n<li>A registered domain name pointed to your VPS IP address.<\/li>\n<li>The Windows VPSSubsystem for Linux (WSL) installed, or use a Linux virtual machine. Follow Microsoft&#8217;s guide <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/wsl\/install\" target=\"_blank\" rel=\"follow\">here<\/a>.<\/li>\n<li>Basic knowledge of command-line operations.<\/li>\n<\/ul>\n<h2>Step 1: Install Required Software in WSL<\/h2>\n<p>Open your WSL terminal and run the following commands:<\/p>\n<pre><code>sudo apt update\r\nsudo apt install curl wget gnupg2 software-properties-common<\/code><\/pre>\n<h2>Step 2: Install Mattermost<\/h2>\n<p>You can install Mattermost using Docker for a simple setup. First, install Docker if you haven&#8217;t done so:<\/p>\n<pre><code>sudo apt install docker.io\r\nsudo systemctl start docker\r\nsudo systemctl enable docker<\/code><\/pre>\n<p>Now, create a directory for Mattermost:<\/p>\n<pre><code>mkdir ~\/mattermost\r\ncd ~\/mattermost<\/code><\/pre>\n<p>Next, create a <code>docker-compose.yml<\/code> file:<\/p>\n<pre><code>nano docker-compose.yml<\/code><\/pre>\n<p>And add the following content:<\/p>\n<pre><code>version: '3'\r\n\r\nservices:\r\n  mattermost:\r\n    image: mattermost\/mattermost-team-edition:latest\r\n    restart: unless-stopped\r\n    ports:\r\n      - \"8065:8065\"\r\n    volumes:\r\n      - mattermost_data:\/mattermost\/data\r\n\r\nvolumes:\r\n  mattermost_data:<\/code><\/pre>\n<p>Now, run Mattermost with Docker:<\/p>\n<pre><code>sudo docker-compose up -d<\/code><\/pre>\n<h2>Step 3: Install Nginx<\/h2>\n<p>To install Nginx, run the following command:<\/p>\n<pre><code>sudo apt install nginx<\/code><\/pre>\n<p>Start Nginx and enable it to run at boot:<\/p>\n<pre><code>sudo systemctl start nginx\r\nsudo systemctl enable nginx<\/code><\/pre>\n<h2>Step 4: Configure Nginx as a Reverse Proxy<\/h2>\n<p>Create a new Nginx configuration file for Mattermost:<\/p>\n<pre><code>sudo nano \/etc\/nginx\/sites-available\/mattermost<\/code><\/pre>\n<p>Add the following configuration, replacing <code>your_domain.com<\/code> with your actual domain:<\/p>\n<pre><code>server {\r\n    listen 80;\r\n    server_name your_domain.com;\r\n\r\n    location \/ {\r\n        proxy_pass http:\/\/localhost:8065;\r\n        proxy_http_version 1.1;\r\n        proxy_set_header Upgrade $http_upgrade;\r\n        proxy_set_header Connection 'upgrade';\r\n        proxy_set_header Host $host;\r\n        proxy_cache_bypass $http_upgrade;\r\n    }\r\n}<\/code><\/pre>\n<p>Link the configuration file to the `sites-enabled` directory:<\/p>\n<pre><code>sudo ln -s \/etc\/nginx\/sites-available\/mattermost \/etc\/nginx\/sites-enabled\/<\/code><\/pre>\n<p>Test the Nginx configuration for syntax errors:<\/p>\n<pre><code>sudo nginx -t<\/code><\/pre>\n<p>If there are no errors, restart Nginx:<\/p>\n<pre><code>sudo systemctl restart nginx<\/code><\/pre>\n<h2>Step 5: Install Certbot for Let&#8217;s Encrypt SSL<\/h2>\n<p>To install Certbot, run the following commands:<\/p>\n<pre><code>sudo apt install certbot python3-certbot-nginx<\/code><\/pre>\n<h2>Step 6: Obtain a Free SSL Certificate<\/h2>\n<p>Run the following command to obtain a SSL certificate:<\/p>\n<pre><code>sudo certbot --nginx -d your_domain.com<\/code><\/pre>\n<p>Follow the prompts during the certificate issuance process. If successful, Certbot will automatically configure Nginx to use SSL.<\/p>\n<h2>Step 7: Set Up Automatic Renewal of SSL Certificates<\/h2>\n<p>Certbot sets up a cron job by default for automatic renewal, but you can test it using:<\/p>\n<pre><code>sudo certbot renew --dry-run<\/code><\/pre>\n<h2>Step 8: Access Mattermost<\/h2>\n<p>Now you should be able to access your Mattermost instance by visiting <code>https:\/\/your_domain.com<\/code> in your web browser.<\/p>\n<h2>Conclusion<\/h2>\n<p>You have successfully installed Mattermost on a Windows VPS using WSL, configured Nginx as a reverse proxy, and secured it with Let&#8217;s Encrypt SSL.<\/p>\n<h2>Resources<\/h2>\n<ul>\n<li><a href=\"https:\/\/mattermost.com\/core\/\" target=\"_blank\" rel=\"follow\">Mattermost Official Website<\/a><\/li>\n<li><a href=\"https:\/\/www.nginx.com\/\" target=\"_blank\" rel=\"follow\">Nginx Official Website<\/a><\/li>\n<li><a href=\"https:\/\/letsencrypt.org\/\" target=\"_blank\" rel=\"follow\">Let&#8217;s Encrypt Official Website<\/a><\/li>\n<\/ul>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 Introduction This guide walks you through the installation of Mattermost on a Windows VPS using Nginx as a reverse proxy and securing it with a free\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-3321","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/3321","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=3321"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/3321\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=3321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=3321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=3321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}