Skip to content
Logo
Table of contents
VeryCloud
DocumentationVPS Linux

Cobbler: automated Linux provisioning

Cobbler: automated Linux provisioning

Cobbler centralizes PXE, DHCP, DNS, TFTP, preseed/kickstart, and OS profiles in a single UI/API. The replacement for scattered homemade scripts for large-scale Linux provisioning.

Category
VPS Linux
Level
Intermediate
Reading time
5 min
Published
May 17, 2026

Introduction

Cobbler manages:

  • Distros (Debian, Ubuntu, RHEL, Rocky, CentOS)
  • Profiles (distro + kernel options + preseed combinations)
  • Systems (individual machines, identified by MAC)
  • Repos (local apt/yum mirrors for acceleration)
  • Integrated or external DHCP / DNS / TFTP
  • REST API + CLI + Web UI

You describe a target system (MAC, hostname, IP, profile), Cobbler handles the rest: generates TFTP files, updates DHCP, serves preseed via HTTP.

Prerequisites

  • VPS Debian / Ubuntu / Rocky
  • Root access
  • Provisioning LAN

Step 1: Install (Rocky / RHEL)

sudo dnf install -y epel-release
sudo dnf install -y cobbler cobbler-web tftp-server httpd
sudo systemctl enable --now cobblerd httpd tftp.socket

Step 2: Install (Debian / Ubuntu)

sudo apt update
sudo apt install -y cobbler cobbler-web debmirror apache2 tftpd-hpa
sudo systemctl enable --now cobblerd apache2 tftpd-hpa

Step 3: Base configuration

sudo nano /etc/cobbler/settings.yaml
server: 192.168.50.1
next_server: 192.168.50.1
default_password_crypted: "$6$rounds=4096$abc..."
manage_dhcp: 1
manage_dns: 0
manage_tftpd: 1
pxe_just_once: 1
nopxe_with_image: 1
sudo cobbler sync
sudo cobbler check

check lists actions needed to fix config (firewall, services).

Step 4: DHCP managed by Cobbler

sudo nano /etc/cobbler/dhcp.template
subnet 192.168.50.0 netmask 255.255.255.0 {
    option routers 192.168.50.1;
    option domain-name-servers 1.1.1.1;
    range dynamic-bootp 192.168.50.100 192.168.50.200;
    filename "/pxelinux.0";
    next-server $next_server;
}
sudo cobbler sync

Step 5: Import a distro

sudo mkdir -p /mnt/iso
sudo mount -o loop debian-12.iso /mnt/iso
sudo cobbler import --path=/mnt/iso --name=debian-12 --arch=x86_64

sudo cobbler distro list
sudo cobbler profile list

Step 6: Add kickstart / preseed

Cobbler calls it "automated install template".

sudo nano /var/lib/cobbler/templates/debian-default.preseed

Put your standard preseed (see PXE tutorial).

Associate with profile:

sudo cobbler profile edit --name=debian-12 --autoinstall=debian-default.preseed

Step 7: Define a system

sudo cobbler system add \
    --name=web01 \
    --hostname=web01.example.com \
    --profile=debian-12 \
    --interface=eth0 \
    --mac=AA:BB:CC:DD:EE:01 \
    --ip-address=192.168.50.10 \
    --netmask=255.255.255.0 \
    --gateway=192.168.50.1 \
    --dns-name=web01.example.com

Cobbler auto-generates:

  • Static DHCP entry for this MAC
  • Dedicated PXELINUX file
  • Preseed accessible via HTTP with substituted variables
sudo cobbler sync

Step 8: Boot the server

Power on web01 in PXE mode. Cobbler recognizes it by MAC, serves PXE menu, installs Debian 12 with defined preseed.

After install:

sudo cobbler system edit --name=web01 --netboot-enabled=False

Prevents re-install on next reboot.

Step 9: Web UI

If cobbler-web is installed:

https://192.168.50.1/cobbler_web

Default creds: cobbler / cobbler (change immediately):

sudo htdigest /etc/cobbler/users.digest "Cobbler" cobbler

UI lets you:

  • List distros, profiles, systems
  • Edit a system
  • Launch re-install
  • View events

Step 10: Snippets and templating

Cobbler uses Cheetah as template engine. Preseeds can contain variables:

d-i netcfg/get_hostname string $hostname
d-i netcfg/get_domain string $dns_name

#if $getVar('install_docker', '0') == '1'
d-i pkgsel/include string docker.io docker-compose
#end if

Reusable snippets:

sudo nano /var/lib/cobbler/snippets/install-docker
d-i preseed/late_command string \
    in-target curl -fsSL https://get.docker.com | sh

In preseed:

$SNIPPET('install-docker')

Step 11: Inherited profiles

sudo cobbler profile add --name=debian-12-web --parent=debian-12 --kickstart-meta="install_nginx=1 install_php=1"

Profile inherits from debian-12 and adds variables:

#if $getVar('install_nginx', '0') == '1'
d-i pkgsel/include string nginx
#end if

Step 12: REST API

Cobbler exposes XML-RPC and REST API.

curl -s http://192.168.50.1/cobbler_api \
    -H "Content-Type: application/xml" \
    -d '<methodCall><methodName>find_system</methodName><params><param><value><struct><member><name>name</name><value>web01</value></member></struct></value></param></params></methodCall>'

Easier with Python SDK:

import xmlrpc.client
server = xmlrpc.client.ServerProxy("http://192.168.50.1/cobbler_api")
token = server.login("cobbler", "cobbler")
systems = server.find_system({"profile": "debian-12"})
print(systems)

Troubleshooting

cobbler check returns errors

Each error has an action. Examples:

  • "iptables is blocking PXE": open ports 67, 68 (UDP), 69 (UDP), 80, 443
  • "SELinux is enabled": configure SELinux or disable for testing

Re-run cobbler check after fix.

"Distribution import failed"

Check ISO is mounted and readable:

sudo tail -f /var/log/cobbler/cobbler.log

PXE menu doesn't show

sudo cobbler sync
sudo systemctl restart dhcpd cobblerd

Preseed fails with "syntax error"

Cheetah templating error:

sudo cobbler validate-autoinstalls

Unwanted re-install

Cobbler reprovisions by default:

sudo cobbler system edit --name=web01 --netboot-enabled=False

Useful commands

sudo cobbler check
sudo cobbler sync

sudo cobbler distro list
sudo cobbler profile list
sudo cobbler system list
sudo cobbler system report --name=web01

sudo cobbler distro add --name=... --kernel=... --initrd=...
sudo cobbler profile add --name=... --distro=...
sudo cobbler system add --name=... --profile=... --mac=...
sudo cobbler system remove --name=web01

sudo cobbler system edit --name=web01 --netboot-enabled=True
sudo cobbler profile edit --name=debian-12 --autoinstall=my.preseed

sudo cobbler validate-autoinstalls
sudo cobbler buildiso --iso=/tmp/cobbler.iso

sudo tail -f /var/log/cobbler/cobbler.log

Conclusion

Cobbler simplifies large-scale Linux provisioning:

  • All-in-one (DHCP, TFTP, preseed, profiles)
  • API and Web UI
  • Powerful templating with snippets
  • Multi-OS, multi-arch

Limits:

  • Complex initial setup
  • Less maintained than MAAS or Foreman
  • More Linux-oriented (limited Windows support OOB)

Going further:

  • Combine with Ansible for post-install config
  • For large infra, check Foreman (full lifecycle management)
  • For managed MAAS, consider Ubuntu MAAS

Resources

Join our Discord community server

For any questions, suggestions, or just to chat with the community, join us on Discord!

900+Members