WirelessPhreak.com

I like to travel, f*ck with technology, and partake in the occasional tropical drink.
I am also a co-host on The NBD Show podcast.
Follow Me

Self Hosting Home Lab



By   WirelessPhreak      Wednesday, June 07, 2023      Labels: , , ,  

 

Self hosting apps and building out your home lab!

I wanted to create this blog post not as a step-by-step guide but as a high-level outline and links to the resources you can use to build your container environment. I have wanted to get into containers and Docker for a while. I have played with Docker in the past and had not had much success. I could get stuff running but to be able to manage the health of my containers and easily deploy and destroy them was not intuitive for a dumb network guy like myself.


So I found a better way!

A friend of mine turned me on to Portainer CE and Nginx Proxy Manger, my world was turned upside down.  Portainer and NPM streamline and simplifies container deployment and management to a level most anyone can understand. At a high level, Portainer is a universal container management tool that can work with both Docker and Kubernetes to make the deployment and management of containerized applications and services easier and more efficient.


The second piece that streamlines the home lab setup is Nginx Proxy Manager. This is a user Interface to the powerful Nginx web server. The NPM project has scripted many of the configurations you would have had to manually build out in the past and fronted it with a super intuitive user interface. NPM can even generate and manage your let's encrypt certificates. I can't say enough good things about NPM.

 

So what you need to get started

  1. You will need a computer or even a Raspberry Pi (the Pi si a little under powered though)You can run Windows, Apple OS, or Linux.  I used Linux there seems to be much more documentation running it in linux. 
  2. Own a domain name so you can manage and create your own DNS records.
  3. Set up port forwarding on your home router to roward traffci to your new container server.
  4. Allow port 443 access on your local firewall if you are running in a VPS or at home.
  5. Install Docker link to install Docker. https://docs.docker.com/engine/install/ubuntu/
  6. Install Portainer here is a link their really great install docs. https://docs.portainer.io/start/install-ce/server/docker/linux
  7. Install Nignx Proxy Manager  https://nginxproxymanager.com/setup/#running-the-app

Once this has all been build out you have the basic framework to deploy containerized applications at will. 

 

High level diagram of what your environment will look like


 

Helpful Hint

  • When you deploy a container you need to add the container to the NGINX Proxy Manager Default network if you want the app to be fronted by NPM
  • When you configure NPM you need to use a fully qualified name that will route to your public IP that will in turn forward it to the server and then from NPM to the correct container. 
  • You can define the container in the NPM config by the name portainer assigns it.  You don't have to use the IP it was assigned. 
  • NPM will perform port translation (your application can be presented on port 443 even though it listens on 8080.)
  • NPM will offload SSL and force SSL redirects for apps that don't know they are behind a proxy.

 

 Some Self Hosted App Resources

 https://www.reddit.com/r/selfhosted/

 https://github.com/awesome-selfhosted/awesome-selfhosted

 

Lastly if your interested in an awesome Virtual Private Server (VPS) with unlimited bandwidth check out Frantech.  They are super cheap and super reliable, and they have awesome customer service. 

FYI this is an affiliate link so I will score a little cash if you buy. :)

FranTech


 

 

 

 

 

 

 

About WirelessPhreak

Just your everyday Packet Wrangler who enjoy's traveling and anything techie...