Skip to content

0xC45/homelab-setup

Repository files navigation

Homelab Setup

This project is the "configuration as code" for my homelab environment. The project goal is to simplify management, updates, and configuration changes for every service running on my home network so that I don't get bogged down with day 2 operations (preventing me from focusing on my other projects). This document describes the steps required to (re)deploy each service from scratch.

Table of Contents

  1. Router
  2. Gitea
  3. Nextcloud
  4. Harbor
  5. Kubernetes
  6. OctoPi

Router

  1. Install OpenBSD 6.7
    • Enable SSH
  2. Setup passwordless SSH
    mkdir ~/.ssh
    chmod 700 ~/.ssh
    vi ~/.ssh/authorized_keys
    chmod 600 ~/.ssh/authorized_keys
    
  3. Install Python
    pkg_add python-3.8.2
    
  4. Run router Ansible role
    make router
    

Gitea

  1. Provision a VM
    • 1 CPU
    • 1 GB memory
    • 8 GB disk
  2. Install Debian 10
    • Disable GUI
    • Disable print server
    • Enable SSH
  3. Setup passwordless SSH
    mkdir ~/.ssh
    chmod 700 ~/.ssh
    nano ~/.ssh/authorized_keys
    chmod 600 ~/.ssh/authorized_keys
    
  4. Install sudo
    apt install sudo
    usermod -aG sudo <user>
    
  5. Run gitea Ansible role
    make gitea
    
  6. Create gitea user
    gitea --config /etc/gitea/app.ini admin create-user \
      --username <user> \
      --password password \
      --email <email> \
      --must-change-password \
      --admin
    
  7. Log in, setup SSH keys, GPG keys, repos, etc.

Nextcloud

  1. Provision a VM
    • 1 CPU
    • 2 GB memory
    • 64 GB disk
  2. Install Debian 10
    • Disable GUI
    • Disable print server
    • Enable SSH
  3. Setup passwordless SSH
    mkdir ~/.ssh
    chmod 700 ~/.ssh
    nano ~/.ssh/authorized_keys
    chmod 600 ~/.ssh/authorized_keys
    
  4. Install sudo
    apt install sudo
    usermod -aG sudo <user>
    
  5. Run nextcloud Ansible role
    make nextcloud
    
  6. Complete installation with web UI
  7. Install "Deck" App

Harbor

  1. Provision a VM
    • 2 CPU
    • 4 GB memory
    • 128 GB disk
  2. Install Debian 10
    • Disable GUI
    • Disable print server
    • Enable SSH
  3. Setup passwordless SSH
    mkdir ~/.ssh
    chmod 700 ~/.ssh
    nano ~/.ssh/authorized_keys
    chmod 600 ~/.ssh/authorized_keys
    
  4. Install sudo
    apt install sudo
    usermod -aG sudo <user>
    
  5. Run harbor Ansible role
    make harbor
    
  6. Log in to web UI and change admin password
  7. Configure Docker client to trust private CA
    sudo mkdir -p /etc/docker/certs.d/harbor.mydomain.com/
    sudo vim /etc/docker/certs.d/harbor.mydomain.com/ca.crt
    

Kubernetes

  1. Provision 6 VMs
    • 2 CPU
    • 7 GB memory
    • 32 GB disk
  2. Install Debian 10
    • Disable GUI
    • Disable print server
    • Enable SSH
  3. Setup passwordless SSH
    mkdir ~/.ssh
    chmod 700 ~/.ssh
    nano ~/.ssh/authorized_keys
    chmod 600 ~/.ssh/authorized_keys
    
  4. Install sudo
    apt install sudo
    usermod -aG sudo <user>
    
  5. Run k8s Ansible role
    make k8s
    
  6. (optional) Copy ~/.kube/config to local machine
    mkdir ~/.kube
    chmod 770 ~/.kube
    scp [email protected]:~/.kube/config ~/.kube/config
    

OctoPi

  1. Install OctoPi
  2. Configure WiFi by editing octopi-wpa-supplicant.txt on the root partition
  3. Connect to Raspberry Pi
    ssh [email protected] # password: raspberry
    
  4. Edit system settings
    sudo raspi-config
    # change password
    # set locale (under Localisation)
    # set timezone (under Localisation)
    
  5. Change root user password
    sudo su -
    passwd
    
  6. Create user account
    adduser <user>
    usermod -aG sudo <user>
    
  7. Setup passwordless SSH for user
    mkdir .ssh
    chmod 700 .ssh
    touch .ssh/authorized_keys
    chmod 600 .ssh/authorized_keys
    vi .ssh/authorized_keys
    
  8. Run homelab-setup ansible playbook
    make octopi
    

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published