I feel like everybody working on a home lab or home server should have some way of making sure it all didn’t just explode the second you walked out the door. Or a service crashes and leaved you stranded unable to access the website that was working a few hours ago. When deploying professional grade servers you need to ensure that you have some way to manage the server when the worst happens. Notice my words choice of “when” not “if” as things will go wrong when in active development. Thats why git exists is because people need a way to revert their mistakes. ## What Challenges come with Deploying Remote Management Solutions One if the major things to consider when attempting other deploy a Remote Management solution is wether or not your ISP (Internet Service Provider) is using CG-NAT (Carrier-Grade Network Address Translation) or in simple terms Dynamic NAT. ## What is Dynamic NAT or CG-NAT? What this means is your Public IP given to you from the ISP can change at after a set period of time. This helps on one hand by ensuring that even if your Public IP address does become compromised, it will change eventually and you will be coming from a totally different IP address. While this does bring in a sense of security to those who may suffer from bad OPSEC, those who know what they are doing are left with no way to properly port forward and attach a proper domain to your Real Public IP. This again in a sense is a valid security measure since you most likely do not want somebody to be able to run dig and find your real ip address ```dig yourwebsite.com``` ## What is the Solution to ISP’s using Dynamic NAT? The solution to all of this from my personal experience is a technology called Cloudflare Tunnels. Cloudflare Tunnels allows users who may have a dynamic IP address to install Cloudflare Tunnels as a service running on either a Docker container or natively in order to pass your websites traffic through Cloudflare. This will safely make your website publicly available whilst giving you the added benefit of never revealing your real IP address. ## Now I know how to make a website public from anywhere. Now what sort of Website should we host? The easiest way to remotely manage Linux devices from my experience in the past has been through CasaOS, CasaOS brings users a simple to use web interface for managing and deploying docker containers. However it can do much more than that, it can also remotely SSH into your machine you are running in on, and in turn start new ssh sessions from that one and control any other device on your local network. CasaOS can also allow users to remotely log into the Docker terminal to access docker containers directly from the web—interface. Additionally CasaOS also allows users to install a wide variety of web-applications and docker containers straight from the web-interface. You could build out a fully featured home-lab environment within CasaOS alone. However if you ever require more manual control of your machine SSH is always an option if you just need to run some commands remotely. ## This sounds great but what is a bad guy wanted to break into this website? CasaOS also uses a login username and password system to secure the web portal, it’s up to you how secure or insecure you make this password but access to all of your machines and local network will be secured through it so I would recommend making it secure. ## How to install CasaOS Installing CasaOS is as easy as running one script on your computer and the script will do the rest. Just note in the current state Fedora is not supported so I would recommend running on a Debian based distrobution. I have personally tested with Pop!OS, Debian, Ubuntu, and Arch. I found that anything with a Debian base works best until more development is contributed to the project. ## Install script ```curl -fsSL https://get.casaos.io | sudo bash ``` This will install CasaOS and launch on the default port of port 80 however this can be changed if necessary later. ## Now make it public To now implement the Cloudflare Tunnels side of things we now need to install one Docker Container from the CasaOS App Store called “Cloudflared” 1. Search Cloudflared on the CasaOS App Store 2. Go to Cloudflare and click on Zero Trust ![Image](https://api.whoisjason.me/api/files/4bz5g6gp5umym7d/jtzko08mkkwfdvd/zero_trust_vz1eKweUfp.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb2xsZWN0aW9uSWQiOiJfcGJfdXNlcnNfYXV0aF8iLCJleHAiOjE3MzI4OTM5NTQsImlkIjoicHBkZDd3aDk1ZjRudnV0IiwidHlwZSI6ImF1dGhSZWNvcmQifQ.hP9jnHe2l4aS7212zRWIoZYP_XtSzFMtiKh3REiOAE8) 3. Next Click onto Networks, and then Tunnels ![Image](https://api.whoisjason.me/api/files/4bz5g6gp5umym7d/lkcneetthwsx45f/tunnels_NipfLnkHV4.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb2xsZWN0aW9uSWQiOiJfcGJfdXNlcnNfYXV0aF8iLCJleHAiOjE3MzI4OTM5NTgsImlkIjoicHBkZDd3aDk1ZjRudnV0IiwidHlwZSI6ImF1dGhSZWNvcmQifQ.Kiwk_G2T6XagiZhdkWhwnVoIzAQx3fRbB9s-W17btKw) 4. Then Click on Create a Tunnel, and Select Cloudflared
# Recap of what we did By installing CasaOS users have a perfect and secure solution to remotely managing their Linux systems and managing Docker containers on those systems. Furthermore this also allows users to easily install new docker containers from the CasaOS community as well as allows remote SSH access to the system. Remember once you’re SSH’d into one system on your local network, you may open more ssh connections from that and get into any other system on your network with SSH enabled. This has been in my opinion the best way of managing your servers without physically being next to them. Meaning that if you leave the house and your website goes down. You’re not totally screwed.