My homeserver setup. Everything managed securely using Portainer.

Overview

homeserver-traefik-portainer

Features:

  • access all services with free TLS from letsencrypt using your own domain
  • running a side project is super simple as you can plug the docker-compose file in the Portainer (directly from another repo) and even use Portainer as the docker registry
  • no shell scripts are needed for maintenance
  • automatic https and cert refresh
  • Only 80, 443 and 9000 are needed so no problems with allocated ports (9000 if Traefik died and you want to access Portainer)
  • not even ssh will be needed. Once Portainer is running through Traefik (https), everything can be updated using the UI
  • multiple ways to access logs (Portainer, Dozzle)

How to

Warning! If a docker-compose doesn't work for you out of the box, it's probably because I use docker mapping for synology, like /volume1/@docker:/var/lib/docker. If that's the case, you will have to change it yourself.

  1. Buy a domain. For this to work you will need to be able to create one DNS A record with a wildcard. Cloudflare offers domains at no cost (they don't make profit off it) and are great overall so I recommend them as a domain registrar.
  2. You will need an ACME provider for the ACME challenge. Here's the list of providers supported by Traefik. If you're using Cloudflare, head over to API Tokens and create one with Edit zone DNS permission. Save it. You will use it for CF_DNS_API_TOKEN in a moment.
  3. Copy .env.example to .env. Overwrite SERVER_DOMAIN with your domain name.
  4. Now you're ready to start. In the root directory, simply docker-compose up -d. It will start Portainer from the compose file. This compose already has some things that will be useful for Traefik in a moment.
  5. Once Portainer is up and running, head over to http://ip-where-portainer-is-running:9000. Go to Settings -> App Templates and replace the url with https://raw.githubusercontent.com/tomwojcik/homeserver-traefik-portainer/master/template.json.
  6. Go to App Templates. Make sure you see some applications there. Deploy Traefik first.
  7. When deploying Traefik you will need to set SERVER_DOMAIN, ACME_EMAIL and now is the time to use CF_DNS_API_TOKEN. If you want to use another challenge provider, you will have to copy this template and adjust it to fit your needs.
  8. Once you click Deploy the stack, head over to Traefik stack and see logs. Make sure there are no errors. If you have problems, it's best to expose ports of Traefik and Whoami using the "edit stack" option in Portainer. Then just fix whatever is broken.
  9. Now go to Cloudflare. You need to add a subdomain. Select your domain, go to DNS panel, click Add record. Assuming the Portainer is running on 192.168.1.2 within the local network, create record:
    1. Type: A
    2. Name: *
    3. IPv4 address: 192.168.1.2
    4. Proxy status: disabled
  10. From now on you can access Portainer (within local network) using portainer.example.com.
  11. Deploy other stacks. Enjoy.

My NAS-specific things

Synology uses 80 and 443 for DSM or other stuff so the ports need to be changed.

  1. sed -i -e 's/80/81/' -e 's/443/444/' /usr/syno/share/nginx/server.mustache /usr/syno/share/nginx/DSM.mustache /usr/syno/share/nginx/WWWService.mustache
  2. Depending on the DSM version, restart nginx with:
    1. DSM<7 = synoservicecfg --restart nginx
    2. DSM>=7 = sudo systemctl restart nginx

Other stuff

I adjusted https://github.com/SimonHaas/homeserver to my needs. Big kudos to Simon Haas for sharing his stack.

default Portainer templates

biggest OSS templates set

Portainer docs on templates

Contributing

It's my homeserver setup so if it works for me - there's nothing to improve. If you want to star / fork / download - go ahead. I hope it makes your life easier!

You might also like...
Ethereum Gas Fee for the MacBook Pro touchbar (using BetterTouchTool)
Ethereum Gas Fee for the MacBook Pro touchbar (using BetterTouchTool)

Gasbar Ethereum Gas Fee for the MacBook Pro touchbar (using BetterTouchTool) Worried about Ethereum gas fees? Me too. I'd like to keep an eye on them

AWS DeepRacer Free Student Workshop: Run faster by using your custom waypoints

AWS DeepRacer Free Student Workshop: Run faster by using your custom waypoints Reward Function Template for waypoints def reward_function(params):

Facebook open graph api implementation using the Django web framework in python

Django Facebook by Thierry Schellenbach (mellowmorning.com) Status Django and Facebook are both rapidly changing at the moment. Meanwhile, I'm caught

A Telegram mirror bot which can be deployed using Heroku.
A Telegram mirror bot which can be deployed using Heroku.

Slam Mirror Bot This is a telegram bot writen in python for mirroring files on the internet to our beloved Google Drive. Getting Google OAuth API cred

Finds Jobs on LinkedIn using web-scraping
Finds Jobs on LinkedIn using web-scraping

Find Jobs on LinkedIn 📔 This program finds jobs by scraping on LinkedIn 👨‍💻 Relies on User Input. Accepts: Country, City, State 📑 Data about jobs

Twitter bot that turns comment chains into ace attorney scenes. Inspired by and using https://github.com/micah5/ace-attorney-reddit-bot

Ace Attorney twitter Bot Twitter bot that turns comment chains into ace attorney scenes. Inspired by and using https://github.com/micah5/ace-attorney-

A website application running in Google app engine, deliver rss news to your kindle. generate mobi using python, multilanguages supported.

Readme of english version refers to Readme_EN.md 简介 这是一个运行在Google App Engine(GAE)上的Kindle个人推送服务应用,生成排版精美的杂志模式mobi/epub格式自动每天推送至您的Kindle或其他邮箱。 此应用目前的主要

AHA is an incident management & communication framework to provide real-time alert customers when there are active AWS event(s). For customers with AWS Organizations, customers can get aggregated active account level events of all the accounts in the Organization. Customers not using AWS Organizations still benefit alerting at the account level. tfquery: Run SQL queries on your Terraform infrastructure.  Query resources and analyze its configuration using a SQL-powered framework.
tfquery: Run SQL queries on your Terraform infrastructure. Query resources and analyze its configuration using a SQL-powered framework.

🌩️ tfquery 🌩️ Run SQL queries on your Terraform infrastructure. Ask questions that are hard to answer 🚀 What is tfquery? tfquery is a framework tha

Owner
Tomasz Wójcik
There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors.
Tomasz Wójcik
PyManGenerator is a token generator for discord, it joins servers using webbot to automate everything

PyManGenerator is a token generator for discord, it joins servers using webbot to automate everything. Captcha can be done by itself unless you used your current IP Address more than once.

null 5 Nov 27, 2021
Bill is a bot capable to Chat with you, search everything on web to you, and send message to yours contacts for you.

Bill Bot The inteligent Bot Bill is a intelligent bot, it can chat, search and send messages to you. Chat with You Send messages on WhatsApp for you S

João Assalim 3 Sep 12, 2021
Discord Panel is an AIO panel for Discord that aims to have all the needed tools related to user token interactions, as in nuking and also everything you could possibly need for raids

Discord Panel Discord Panel is an AIO panel for Discord that aims to have all the needed tools related to user token interactions, as in nuking and al

null 11 Mar 30, 2022
Dante, my discord bot. Open source project in development and not optimized for other filesystems, install and setup script in development

DanteMode (In private development for ~6 months) Dante, my discord bot. Open source project in development and not optimized for other filesystems, in

null 2 Nov 5, 2021
Unit testing AWS interactions with pytest and moto. These examples demonstrate how to structure, setup, teardown, mock, and conduct unit testing. The source code is only intended to demonstrate unit testing.

Unit Testing Interactions with Amazon Web Services (AWS) Unit testing AWS interactions with pytest and moto. These examples demonstrate how to structu

AWS Samples 21 Nov 17, 2022
Tools used by Ada Health's internal IT team to deploy and manage a serverless Munki setup.

Serverless Munki This repository contains cross platform code to deploy a production ready Munki service, complete with AutoPkg, that runs entirely fr

Ada Health 17 Dec 5, 2022
Hostapd-mac-monitor - Setup a hostapd AP to conntrol the connections of specific MACs

A brief explanation This script provides way to setup a monitoring service of sp

null 2 Feb 3, 2022
Telegram PHub Bot using ARQ Api and Pyrogram. This Bot can Download and Send PHub HQ videos in Telegram using ARQ API.

Tg_PHub_Bot Telegram PHub Bot using ARQ Api and Pyrogram. This Bot can Download and Send PHub HQ videos in Telegram using ARQ API. OS Support All linu

TheProgrammerCat 13 Oct 21, 2022
It's a Discord bot to control your PC using your Discord Channel or using Reco: Discord PC Remote Controller App.

Reco PC Server Reco PC Server is a cross platform PC Controller Discord Bot which is a modified and improved version of Chimera for Reco-Discord PC Re

Arvinth Krishna 12 Aug 31, 2022
The simple way of using Imgur.

PyImgur The simple way of using Imgur. You can upload images, download images, read comments, update your albums, message people and more. In fact, yo

Andreas Damgaard Pedersen 120 Dec 6, 2022