ខ្ញុំលែងប្រើ Cloud ហើយធ្វើ HomeLab Server មួយខ្លួនឯង | Moving from Cloud to Home Lab | TFDevs
14:59

ខ្ញុំលែងប្រើ Cloud ហើយធ្វើ HomeLab Server មួយខ្លួនឯង | Moving from Cloud to Home Lab | TFDevs

TFDevs

7 chapters7 takeaways12 key terms5 questions

Overview

This video details a personal journey of transitioning from cloud-based services to a self-hosted home lab server. The creator explains the motivations, including cost savings and greater control, and outlines the hardware and software choices made. The process involves setting up a mini-PC as a hypervisor, configuring virtual machines for various roles like gateway, monitoring, CI/CD, and database, and implementing infrastructure as code using Terraform for management. The video also touches upon network security with Cloudflare Tunnel for secure remote access and zero-trust principles. Finally, it discusses the cost-benefit analysis and future expectations for the home lab.

How was this?

Save this permanently with flashcards, quizzes, and AI chat

Chapters

  • The creator was spending a significant amount ($30-40/month) on cloud services for databases and other infrastructure.
  • A desire for greater control and ownership over their digital infrastructure led to the decision to build a home lab.
  • Previous attempts were hindered by lack of time and resources, but a firm decision was made to proceed.
  • The goal is to host all projects and migrate infrastructure from the cloud to the home lab.
Understanding the 'why' behind a decision helps learners connect with the material and consider their own motivations for similar projects.
Spending $30-40 per month on cloud databases and other services.
  • A mini-PC from brand GM (a Chinese company) was purchased for $260.
  • The PC includes a Ryzen 7 3700 CPU (2.0 GHz base, 4.5 GHz boost) with 16MB L3 cache and 4MB L2 cache.
  • The CPU has a low TDP of 15W, consuming only 45W under load, making it power-efficient.
  • Additional components purchased include 64GB of RAM and an SSD.
  • An Uninterruptible Power Supply (UPS) was also acquired to handle power outages, providing several hours of backup for the low-power system.
Specific hardware choices illustrate practical considerations like cost, performance, and power efficiency when building a home server.
Purchasing a GM mini-PC for $260 with a Ryzen 7 3700 CPU, 64GB RAM, and an SSD, along with a UPS.
  • The creator chose a Type 2 hypervisor approach, installing Proxmox VE as the operating system.
  • Proxmox VE is an open-source platform that manages virtual machines and containers.
  • The home lab machine is divided into 8 virtual machines (VMs), each with a specific role.
  • A 'gateway' VM acts as the single entry point for all network requests, enhancing security.
  • Remote access is managed via SSH and a web interface.
Understanding hypervisor types and virtualization strategies is crucial for efficiently allocating resources and managing multiple services on a single machine.
Using Proxmox VE to create and manage 8 separate virtual machines, including a dedicated gateway VM.
  • VM 1: Gateway (1 CPU, 2GB RAM) - Handles all incoming requests.
  • VMs 2-3: Cluster (2 CPUs, 4GB RAM each) - For general workloads.
  • VM 4: Monitoring (2 CPUs, 6GB RAM) - For tools like Grafana and Prometheus.
  • VM 5: Database (2 CPUs, 6GB RAM) - For hosting databases like Hbase, with considerations for performance vs. containerization.
  • VM 6: CI/CD (2 CPUs, 5GB RAM) - For build and deployment pipelines.
  • VM 7: Database (4 CPUs, 6GB RAM) - A separate, more powerful VM for databases.
  • The total allocated vCPUs (21) slightly exceed the physical CPU cores (8), indicating a mild overcommit strategy that is acceptable due to non-constant VM load.
Defining specific roles for VMs and allocating resources based on those roles ensures optimal performance and stability for each service.
Allocating a dedicated VM with 4 CPUs and 6GB RAM specifically for database hosting, separate from other services.
  • Manual configuration of each VM is tedious and error-prone.
  • Terraform is used for Infrastructure as Code (IaC), allowing the definition of the desired infrastructure state in code.
  • This approach enables reproducible deployments and easy management of changes.
  • Code allows for version control, making it possible to track changes, revert to previous states, and easily rebuild the infrastructure if hardware fails.
  • Changes like adding RAM or new VMs can be managed by updating the Terraform code and applying the changes.
Employing Infrastructure as Code principles like using Terraform drastically improves the efficiency, reliability, and manageability of complex server setups.
Using Terraform code to define and automatically provision all virtual machines and their configurations, enabling easy replication and updates.
  • To securely access the home lab from outside the network, Cloudflare Tunnel is implemented.
  • This creates a secure, outbound-only connection from the home lab to Cloudflare's network.
  • Only traffic routed through Cloudflare is allowed, enhancing security by not exposing direct ports.
  • A Cloudflare agent runs on the gateway VM, and another is set up on the Proxmox host.
  • This setup supports zero-trust principles, ensuring that only authenticated and authorized traffic can access services.
Implementing secure remote access solutions like Cloudflare Tunnel is essential for protecting a home lab from unauthorized access and maintaining a strong security posture.
Setting up Cloudflare Tunnel to expose services securely, allowing access only through Cloudflare's network without opening direct inbound ports.
  • The total initial cost for the home lab build was approximately $675.
  • This includes the PC, RAM, SSD, and UPS.
  • Compared to the $30-40 monthly cloud spend, the home lab breaks even financially within about 1.5 to 2 years.
  • The creator anticipates significant cost savings in subsequent years.
  • The creator plans to provide future updates on new configurations and learnings.
A clear cost-benefit analysis helps justify the investment in a home lab and provides a tangible measure of its long-term value compared to cloud alternatives.
Calculating that the initial $675 investment will be recouped through savings compared to monthly cloud fees within 1.5 to 2 years.

Key takeaways

  1. 1Transitioning to a home lab can offer significant cost savings and greater control over infrastructure compared to cloud services.
  2. 2Careful selection of hardware, balancing performance, cost, and power efficiency, is key for a home lab.
  3. 3Virtualization platforms like Proxmox VE are essential for efficiently running multiple services on a single machine.
  4. 4Infrastructure as Code (IaC) tools like Terraform are critical for managing and automating the setup and maintenance of complex server environments.
  5. 5Implementing robust security measures, such as Cloudflare Tunnel, is vital for protecting a home lab from external threats.
  6. 6The initial investment in a home lab can be recouped over time through reduced operational expenses compared to cloud providers.
  7. 7A well-planned home lab can serve as a powerful learning platform for exploring server administration, networking, and DevOps practices.

Key terms

Home LabCloud ServicesHypervisorProxmox VEVirtual Machine (VM)TDP (Thermal Design Power)UPS (Uninterruptible Power Supply)Infrastructure as Code (IaC)TerraformCloudflare TunnelZero Trust AuthenticationGateway VM

Test your understanding

  1. 1What were the primary motivations for the creator to move from cloud services to a home lab?
  2. 2How does the choice of hardware, such as the CPU's TDP, impact the overall efficiency and cost of a home lab?
  3. 3What is the difference between Type 1 and Type 2 hypervisors, and which did the creator choose and why?
  4. 4How does using Infrastructure as Code (IaC) with tools like Terraform benefit the management and maintenance of a home lab?
  5. 5What security advantages does Cloudflare Tunnel provide for a home lab server, and how does it relate to zero-trust principles?

Turn any lecture into study material

Paste a YouTube URL, PDF, or article. Get flashcards, quizzes, summaries, and AI chat — in seconds.

No credit card required