Skip to content

Phils Blog and Stuff

TELECOMS. VIRTUALIZATION. IT. CODING. and more…

Menu
  • Home
  • Resources
    • Subnet Mask Cheat Sheet
    • Easy Dmarc+Email
    • MX Tool Box
    • LOAD BALANCING & SRE
  • SHOP
  • SOLUTIONS
  • SERVICES
  • Contact Me
Menu

Automate Debian installations with Seed, DHCP and Nginx.

Posted on 15/03/2023 by Phil

In this post i will detail how to automate the installation of Debian through the use of a Seed File and DHCP. If like me you install a few Debian Servers for things like web servers and stuff. you will have had to sit through the installation, clicking options. Well now you don’t have to.

Seed file. Place preseed.cfg on a web server in the root, or easy access path.

#_preseed_V1
## Country and system locale
d-i     debian-installer/locale string en_GB.UTF-8
d-i     debconf/language        string  en_GB.utf8
d-i     console-keymaps-at/keymap select gb
d-i     console-setup/layout string "United Kingdom"

## Network config
d-i netcfg/choose_interface select eth0


## Sort Keyboard settings
d-i     keyboard-configuration/xkb-keymap select gb
d-i     kbd-chooser/method      select "United Kingdom"
d-i     kbd-chooser/method      select "British English"
d-i     keyboard-configuration/variant  select  English (UK)
keyboard-configuration  keyboard-configuration/variant  select  English (UK)

## Sort Root Password
d-i     passwd/root-password password password123456789
d-i     passwd/root-password-again password password123456789


## Add new user and set password
user-setup-udeb passwd/username string  Bob.User
d-i     passwd/user-fullname string Dob.User
d-i     passwd/user-password password password
d-i     passwd/user-password-again password password

## Set Time Zone information
d-i     time/zone string Europe/London
tzsetup-udeb    time/zone       select  Europe/London
tzdata  tzdata/Zones/Europe     select  London
d-i     clock-setup/utc-auto boolean true
d-i     clock-setup/utc boolean true
d-i clock-setup/ntp-server string uk.pool.ntp.org

## Choose Local mirror to install software
d-i     mirror/https/mirror     select  deb.debian.org
choose-mirror-bin       mirror/http/countries   select  GB

## Select Software
popularity-contest popularity-contest/participate boolean false
tasksel tasksel/first   multiselect     ssh-server, standard
d-i     tasksel/first   multiselect     SSH server, standard system utilities
d-i pkgsel/include string sudo curl snmpd nano zip gnupg ntp hyperv-daemons salt-minion salt-common bmon mc htop

## Sort out PArtition
d-i     partman-partitioning/confirm_write_new_label boolean true
d-i     partman/choose_partition select finish
d-i     partman/confirm boolean true
d-i     partman/confirm_nooverwrite boolean true
d-i     partman-auto/method string regular
d-i     partman-md/device_remove_md boolean true
d-i     partman-lvm/confirm boolean true
d-i     partman-lvm/confirm_nooverwrite boolean true
d-i     partman-lvm/device_remove_lvm boolean true

## Sort Grub Stuff
d-i     grub-installer/only_debian boolean true
d-i     grub-installer/bootdev  string /dev/sda
d-i     grub-installer/bootdev  string default
d-i     finish-install/reboot_in_progress note

## Sort End of install to eject CD and reboot
d-i     cdrom-detect/eject boolean true
d-i     kbd-chooser/method      select "United Kingdom"

DHCP Config. The below is the DHCP Config for VyOS

service {
     dhcp-server {
         shared-network-name LAB {
             subnet 10.10.10.0/24 {
                 bootfile-name http://10.10.10.2/preseed.cfg
                 default-router 10.10.10.1
                 dns-server 8.8.8.8
                 domain-name LAB.local
                 range 0 {
                     start 10.10.10.10
                     stop 10.10.10.200
			}
		}
	}
}
}

Debian Installation Options

POSTS

  • Home Assistant. Add water meter with PHP+MQTT+YML.
  • Automating your home with Home Assistant. Initial install and config (Hyper-V).
  • The importance of setting up email security correctly.
  • Automate Debian installations with Seed, DHCP and Nginx.
  • A simple link shortener.. Fun little project…

WORD CLOUD

3CX 3CX Phone System Apache Asterisk Cacti CentOS CRM DHCP DNS Email Fail over Failover File System Firewall FreeBSD FreeNAS FXO IAX install IP IP PBX Linux M0n0wall Nottingham Open Source PBX PFSense PHP Router Server SIP snom SSH TrixBox ubuntu VLAN Voice VoIP VPN vyatta WAN Website WiFi yealink ZFS

© 2025 Phils Blog and Stuff | Powered by Superbs Personal Blog theme