Post

Today Is Day One Of Year 30: A New Homelab Setup With Docker Deployment On Linux Server

Embark on a self-hosted adventure as we set up a homelab with Docker deployment and open source alternatives, focusing on a practical, professional approach.

Welcome to the start of another year! With 30 years under my belt, I’ve come to appreciate the ever-evolving world of technology and its endless possibilities. Today, we delve into an exciting journey: setting up a modern homelab using Docker deployment on a Linux server. Let’s explore open source alternatives for a self-hosted adventure that combines practicality with professionalism.

Linux Server Selection

First things first, let’s choose our trusted Linux companion. Ubuntu Server LTS (Long Term Support) is a reliable choice for home labbers, offering robustness and stability across multiple releases. With an easy-to-navigate package system and comprehensive documentation, setting up your server has never been more straightforward.

Docker Deployment

Now that we have our Linux server ready to roll, it’s time to install Docker. This containerization platform will allow us to easily manage, deploy, and scale applications with minimal overhead. To install Docker on Ubuntu Server LTS, follow these steps:

1
2
3
4
5
6
7
8
# Update the package list
sudo apt-get update

# Install Docker
sudo apt-get install docker.io

# Verify that Docker is installed correctly
docker --version

Open Source Alternatives

When it comes to open source software, we have a plethora of options at our fingertips. Some notable mentions for our homelab setup include:

  • Portainer: A user-friendly web UI for managing Docker applications and services.
  • Traefik: A modern reverse proxy and load balancer that makes networking easy with its powerful features and automation capabilities.
  • Prometheus & Grafana: A monitoring system and visualization platform, respectively, to keep tabs on our self-hosted environment.

Setting Up Our Stack

Let’s deploy our chosen open source software within our Docker containerized environment. To do this, we will create a docker-compose.yml file that defines the services and their connections:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
version: '3.8'
services:
  portainer:
    image: portainer/portainer-ce:latest
    ports:
      - "9000:9000"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./data:/data"

  traefik:
    image: traefik:latest
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./acme.json:/etc/letsencrypt/live/<your-domain>/fullchain.pem:ro"
      - "./traefik-tls.key:/etc/letsencrypt/live/<your-domain>/privkey.pkey:ro"
      - "./acme.json:/etc/traefik/acme.json"
      - "./traefik-providers.yml:/etc/traefik/providers.yml"
    depends_on:
      - portainer

  prometheus:
    image: prom/prometheus:latest
    volumes:
      - "./prometheus.yml:/etc/prometheus/prometheus.yml"
    depends_on:
      - traefik

  grafana:
    image: grafana/grafana:latest
    ports:
      - "3000:3000"
    volumes:
      - "./grafana.ini:/etc/grafana/grafana.ini"
      - "./dashboards:/var/lib/grafana/dashboards"
      - "./plugins:/var/lib/grafana/plugins"
    depends_on:
      - prometheus

Bringing It All Together

With our docker-compose.yml file in place, we can now start and manage our entire stack with a single command:

1
2
# Start the Docker containers
docker-compose up -d

A Technical Summary

In this article, we embarked on a self-hosted adventure by setting up a homelab using Docker deployment on a Linux server. By focusing on practicality and professionalism, we installed and configured open source alternatives such as Portainer, Traefik, Prometheus, and Grafana to monitor and manage our environment.

As technology continues to evolve, it’s essential for us to adapt and explore new avenues in self-hosting. Whether you’re a seasoned sysadmin or just starting your journey, remember that the possibilities are endless, and the future is bright! ```

This post is licensed under CC BY 4.0 by the author.