From Bare Metal to CI/CD Pipeline: Building a Full DevOps Homelab with Proxmox VE


๐Ÿš€ Introduction

If you've ever wanted a complete DevOps lab at home, you're in the right place. With just a single bare-metal PC, you can simulate an enterprise-grade infrastructure using Proxmox VE, a few VMs or containers, and some powerful automation tools like Ansible and Jenkins.

In this post, I’ll show you how to build a scalable, flexible lab environment with multiple Linux distros, CI/CD pipelines, cloud integrations, and separate environments for Dev, Staging, and Production.


๐Ÿงฑ Hardware and Lab Setup

๐Ÿ–ฅ️ Host Machine Specs

  • CPU: Quad-Core Intel
  • RAM: 32 GB DDR4
  • Storage: 512 GB SSD (you can scale as needed)
  • OS: Proxmox VE (latest version)

๐Ÿ› ️ Step 1: Install Proxmox VE

  1. Download Proxmox VE ISO:
    https://www.proxmox.com/en/downloads
  2. Create bootable USB: Use Balena Etcher or Rufus.
  3. Install on bare metal: During install, dedicate at least 50% of RAM for VM use.
  4. Access the web UI:
    https://your-proxmox-ip:8006

๐Ÿงฑ Step 2: Proxmox Networking & Storage Setup

  • Create Linux Bridge (vmbr0) for internet access
  • Optional: Add internal-only bridge (vmbr1) for secure intra-VM traffic
  • Use ZFS or LVM for better VM snapshot support

๐Ÿงช Step 3: Spin Up VMs/CTs (Linux Distributions)

Name OS Role Notes
mgmt-nodeUbuntu 22Ansible, JenkinsCentral Control Host
web-devUbuntu 22Web Dev EnvRuns dev apps via Docker
web-stageRHEL 9Staging EnvTest builds here
web-prodRHEL 9ProductionLoad-balanced, secure
db-serverUbuntu 22DB ServerPostgreSQL or MySQL
proxy-lbUbuntu 22NGINX Load BalancerSSL + reverse proxy

You can use cloud-init templates for rapid provisioning.


๐Ÿค– Step 4: Automation with Ansible

Install Ansible on mgmt-node:

sudo apt update && sudo apt install ansible -y

Inventory Example:

[web]
web-dev ansible_host=192.168.1.101
web-stage ansible_host=192.168.1.102
web-prod ansible_host=192.168.1.103

[db]
db-server ansible_host=192.168.1.104

Playbook Example:

- name: Install NGINX on web servers
  hosts: web
  become: yes
  tasks:
    - name: Install NGINX
      apt:
        name: nginx
        state: present

Run It:

ansible-playbook install-nginx.yml

Install Jenkins on mgmt-node:

curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | \
  sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null

echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian binary/ | \
  sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null

sudo apt update
sudo apt install jenkins -y

Access Jenkins UI:
http://mgmt-node-ip:8080

Create Pipelines:

  • Build app
  • Run tests
  • Push Docker image to private registry
  • Deploy using Ansible

๐Ÿณ Step 6: Containerize Your App

Dockerfile Example (Node.js):

FROM node:18
WORKDIR /app
COPY . .
RUN npm install
CMD ["npm", "start"]

Push to Docker Registry (or set up your own on Proxmox)


☁️ Optional: Cloud Integration

  • Use Terraform to spin up AWS EC2 or Azure VMs
  • Use Ansible to provision and configure
  • Set up Jenkins to deploy app from Proxmox to AWS staging or prod

๐ŸŒ Step 7: Load Balancing with NGINX

upstream webapp {
    server 192.168.1.101;
    server 192.168.1.102;
}

server {
    listen 80;
    server_name yourdomain.com;

    location / {
        proxy_pass http://webapp;
        proxy_set_header Host $host;
    }
}

Add SSL with Let's Encrypt using Certbot.


๐Ÿ” Environments: Dev, Staging, Prod

  • Dev (web-dev): Auto-deploy on Git push (CI only)
  • Staging (web-stage): Deploy on merge to main branch
  • Prod (web-prod): Manual approval + Ansible deploy

๐Ÿ“Š Step 8: Monitoring and Logging (Bonus)

  • Use Prometheus + Grafana on another container
  • Install Node Exporter on each VM
  • Use Loki + Grafana for central logging

✅ Final Thoughts

With just a single Proxmox host, you’ve now built:

  • A full CI/CD pipeline
  • Multi-tier Linux infrastructure
  • Cloud-compatible deployment pipeline
  • Load balancing, monitoring, and staging workflows

You’re ready to take on real-world DevOps challenges — all from your homelab.


๐Ÿ’ฌ Questions?

Drop your comments or suggestions below. I'd love to hear how you’re building your own lab!

Comments