Skip to content

Repository files navigation

DevOps Lab

Personal DevOps homelab used to practice Docker, Linux, networking, storage and backup strategies.

This repository does NOT contain real production data. It represents a cleaned and documented reference architecture based on a real home server.

Shell Lint Python Lint


Goals

  • Practice Docker and docker-compose
  • Prepare foundation for Kubernetes (containerization, networking, storage concepts)
  • Design persistent storage for containers
  • Separate infrastructure from application data
  • Implement and automate backups
  • Document operational decisions (runbooks)
  • Prepare for Junior DevOps / SRE interviews

Environment

Host system:

  • Debian Linux
  • Single-node homelab (laptop used as server)

Main components:

  • Docker
  • docker-compose
  • Bash scripts
  • rsync backups
  • Reverse proxy (nginx)

Monitoring

                          ┌─────────────────────────┐
                          │          Nginx          │
                          │      Reverse Proxy      │
                          └─────────────┬───────────┘
                                        │
                                        ▼
                                ┌───────────────┐
                                │    Grafana    │
                                │   Dashboards  │
                                └───────┬───────┘
                                        │
                     ┌──────────────────┴──────────────────┐
                     │                                     │
                     ▼                                     ▼
              ┌───────────────┐                     ┌──────────────┐
              │  Prometheus   │                     │     Loki     │
              │ Metrics Store │                     │  Log Storage │
              └───────┬───────┘                     └──────┬───────┘
                      │                                     │
          ┌───────────┴───────────┐                         │
          │                       │                         │
          ▼                       ▼                         ▼
   ┌──────────────┐       ┌───────────────┐         ┌───────────────┐
   │   cAdvisor   │       │ Node Exporter │         │    Promtail   │
   │Container Stats│      │ Host Metrics  │         │  Log Collector│
   └──────────────┘       └───────────────┘         └───────────────┘
                                                        │
                                                        ▼
                                               Docker container logs

The monitoring stack combines metrics and log collection.

Metrics pipeline:

  • Node Exporter exposes host system metrics
  • cAdvisor exposes container resource metrics
  • Prometheus scrapes metrics from both services
  • Grafana queries Prometheus to visualize metrics

Logging pipeline:

  • Promtail collects logs from Docker containers
  • Loki stores and indexes log data
  • Grafana queries Loki to visualize logs

Only Grafana is exposed externally through the reverse proxy. All other services communicate internally through the Docker network.

The monitoring example:

Monitoring Setup Guide


Backup Implementation

Backup scripts, snapshot logic, and retention strategy are implemented in:

backup_tools


Infrastructure Dashboard


A lightweight dashboard is deployed using Homepage to provide a central entry point for internal services.

The dashboard aggregates links to commonly used infrastructure components such as:

  • monitoring (Grafana)
  • service interfaces
  • development tools
  • internal applications

This allows quick navigation across the self-hosted environment without exposing multiple ports or remembering individual service URLs.

Example deployment configuration is available in:

docker_compose_services/homepage/

Example configuration: docker_compose_services/homepage


Repository Structure

docker_services/
Contains docker-compose files for each service. Only infrastructure definitions, no data.

app_data/
Example structure for persistent application data. Used only as reference, not real data.

ops/
Operational documentation and scripts.

architecture/
High-level explanations of system design decisions.

examples/
Sanitized examples of logs, configs and outputs.


Services Overview

Services included in this lab:

  • nginx (reverse proxy)
  • monitoring (glances)
  • media services (example)
  • application containers (example)

Each service:

  • runs in Docker
  • uses bind-mounted persistent data
  • is isolated in a custom Docker network

Storage Model

Principles:

  • Containers are stateless
  • All persistent data lives outside containers
  • Application data and infrastructure are separated

High-level layout:

  • docker_services → how services are started
  • app_data → what services store
  • backup → offline backup / Cloud

Backups

Backup strategy:

  • Tool: rsync
  • Target: offline USB drive
  • Mode: incremental with deletion

Backups include:

  • application data
  • service configuration
  • infrastructure definitions

Backups exclude:

  • operating system
  • temporary files
  • caches

See: ops/runbooks/backup.md


Operations

This repository contains runbooks for:

  • backups
  • restore procedures
  • permission issues
  • common container failures

The goal is to document operational thinking, not just configuration.


Security Notes

  • No real credentials are stored
  • All secrets are replaced with placeholders
  • .env files are provided as examples only

Status

This lab is actively evolving. Structure and documentation improve over time as new topics are learned. Kubernetes is planned as a next step after stabilizing the Docker-based setup.


Disclaimer

This is a learning and practice project. It is not intended to be used as a production-ready setup without adaptation.

About

Personal DevOps homelab for practicing Docker, Linux, networking, storage and backup strategies.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages