Provisioning Linux
ISO, kickstart, partitioning, first boot checklist.
Learning objectives
- Plan disk partitioning for Linux on bare metal
- Install from ISO or automated kickstart
- Complete first-boot hardening checklist
Provisioning workflow
Swift Host delivers Workshop Co.’s dedicated server with blank drives or a minimal rescue OS. Your job: install Ubuntu Server LTS, configure networking, deploy the stack from Book 2.
- Mount Ubuntu 24.04 ISO via IPMI virtual media
- Boot installer; configure RAID in controller or software RAID
- Partition disks; install base system
- Set static public IP, gateway, DNS
- First boot: updates, SSH keys, firewall, deploy app
Partitioning example
| Mount | Size | Purpose |
|---|---|---|
/boot/efi | 512 MB | UEFI boot (if not hardware RAID boot) |
/ | 50 GB | OS and packages |
/var | 100 GB | Logs, PHP sessions, mail queue |
/var/lib/mysql | remainder | Database on fast volume |
| swap | 8 GB | Emergency memory (or swap file) |
With hardware RAID presenting one volume, LVM simplifies future resize — optional but common on bare metal.
Network config (netplan snippet)
# /etc/netplan/01-public.yaml
network:
version: 2
ethernets:
eno1:
addresses: [203.0.113.10/24]
routes:
- to: default
via: 203.0.113.1
nameservers:
addresses: [1.1.1.1, 1.0.0.1]
First-boot checklist
Before exposing to traffic
apt update && apt upgrade- Create deploy user, SSH keys only, disable root login
- Configure UFW: allow 22, 80, 443; default deny inbound
- Set hostname
workshopco-prod-01 - Install Nginx, PHP-FPM, MySQL — restore from backup
- Point DNS only after smoke tests via
/etc/hostsor staging
Worked example — automated install
For repeatability, Swift Host uses cloud-init or kickstart for Workshop Co.’s second server:
#cloud-config
hostname: workshopco-prod-02
users:
- name: deploy
ssh_authorized_keys:
- ssh-ed25519 AAAA... workshopco-deploy
packages:
- nginx
- php8.3-fpm
- mysql-server
Try it yourself — install order
Put these steps in correct order: enable UFW, mount ISO, restore DB dump, update DNS A record, run apt upgrade, install Nginx.
Answer
- Mount ISO → install OS
- apt upgrade
- Install Nginx (+ stack)
- Restore DB dump
- Enable UFW
- Update DNS A record (last — after verification)
Quick quiz
- Why defer DNS cutover until after smoke tests?
- What is cloud-init used for?
- Where should MySQL data live on a busy booking app?
Answers
- Avoid sending customers to a broken server during provisioning.
- Automate first-boot config — users, packages, network on fresh instances/servers.
- Fast dedicated partition or volume —
/var/lib/mysqlon NVMe/RAID.