Skip to main content
CRUCIBLE
Legacy Reference Archive: This 44-chapter book reference has been distilled into Academy A01 (8 Executable Modules) with Tier-Adaptive Productive Failure, Kore/Puck voice, and live Firecracker labs.
Open Academy A01 →
COURSE 0 · SERVER BUILDING & LIFECYCLE MASTERY

Zero-to-Production Linux, Containers, Networking & Recovery

PROGRESS: 0 / 72 (0%)0/44L · 0Q · 0VM
CH 20 · PART IV · WORKED LABS & FULL LIFECYCLE (CH 14–24) · 1,280 WORDS (7 MIN)

20 Provisioning, networking and the host foundation

Provisioning creates compute, networking and storage resources. Configuration turns those resources into an intended operating environment. Deployment installs a particular service release.

FULL WAR-ROOM →
INTERACTIVE ARCHITECTURE · CLICK ANY LAYER TO INSPECT & RUN

Inside Your Private Linux Server (Shell -> Process -> Socket -> Disk)

Click any box below to see what lives at that layer, what fails in production, and the exact command to inspect it live.

spawnsbindspersistsBash ShellPTY · /home/operatorProcesses & PIDsFastAPI · Postgres · RedisTCP Sockets127.0.0.1 :8000 / :6432Filesystem & Logsconfig/ · logs/ · PGDATA
SELECTED LAYER · BASH SHELL
Interprets your commands, expands quotes/variables, and returns exit codes ($?).
Common failure: Running admin commands on the wrong host or directory when SSH prompts look identical.
$ hostname && whoami && pwd

Type: guided operational procedure. Prerequisites: the requirements contract, basic terminal use and administrator access to a new disposable Linux VM. Environments: local read-only inspection and an explicitly identified Ubuntu VM for later changes. Status: local lifecycle provisioning is executable; the remote-host procedure is a target-dependent recipe until you run it and retain evidence. Outcome: recreate a known environment without guessing which machine, disk or network you are changing.

Understand the layers you provision

Provisioning creates compute, networking and storage resources. Configuration turns those resources into an intended operating environment. Deployment installs a particular service release. Those activities can be automated together, but their ownership and recovery consequences remain different. Replacing a stateless API instance can be routine; replacing the only database disk can lose the service's records.

A cloud VM needs a region, image, instance shape, network placement, disk, access method and owner. A physical server needs compatible hardware, firmware, power, thermal capacity, management access, installation media and a tested recovery route. A container needs a host kernel, runtime, network and volume policy. Serverless still needs identity, configuration, observability, data lifecycle and limits. Write the parts your provider manages and the parts you retain.

The local lifecycle lab demonstrates reproducible file provisioning inside an owned temporary directory. It creates private configuration and distinct release artifacts, starts services, checks behavior and tears down owned state. That is a practical automation pattern, but it does not exercise VM creation, OS installation, cloud identity or public networking. Use its refusal and cleanup tests as a design example for scripts that will later control larger resources.

Establish location before every administrative change

On the intended disposable Linux VM, use read-only commands first:

bash
hostname
whoami
pwd
uname -a
cat /etc/os-release
ip -brief address
ip route
df -h

Expected results identify the hostname, account, directory, kernel/OS, interfaces, default route and mounted storage. Exact interface names and device names vary. Compare them to the inventory; do not copy an address from an earlier lab as if it were universal. Record the project identifier and provider resource ID separately from a hostname that can be reused.

Inside your Crucible Firecracker Linux VM (Debian/Ubuntu Linux), ip, ss, and journalctl/systemd inspection utilities follow standard Linux conventions. For cross-platform automation, detect the target and use a tested adapter rather than executing a Linux recipe unconditionally. A rejected environment is a useful safety result. Suppressing an error and continuing into a partial configuration is not portability.

Before remote access changes, establish an independent recovery path such as the provider's console or approved out-of-band management. Keep one working session while testing a second session using the intended key and account. Validate the proposed SSH configuration before reload, and confirm the administrative source network will remain allowed. Document how to regain access if the key, identity provider or network path fails.

Build an inventory that can survive its author

Record OS image provenance, instance/disk identifiers, architecture, CPU/RAM/storage, mount layout, private/public addresses, DNS ownership, management path, installed runtime versions, monitoring owner and backup owner. Tag resources consistently so the retirement inventory can discover them later. Avoid storing passwords or private keys in inventory files.

For storage, distinguish the device, partition, filesystem, mount point and application data directory. A free-space report for the host does not prove free capacity inside a Docker VM or a database volume. Inspect the layer where the write failed. If an operation reports “No space left on device,” consider filesystem blocks, inodes, quotas and the specific volume. Never resolve a storage error by deleting unrelated snapshots, volumes or backups.

A filesystem mount must be verified before starting a service whose data belongs there. Otherwise the process may write to an empty directory on the root disk while operators believe the data is on a protected volume. Test startup when the intended mount is absent. The correct outcome is a controlled failure, not silent fallback to a different storage location.

Make network decisions explicit

A client needs a usable path to the listener and a valid identity for the service it reaches. Addressing, routing, firewalls, DNS, TLS and application authorization are separate checks. Loopback only reaches the current network namespace. A container's127.0.0.1 is its own namespace, not the host or another container. Binding a service to all interfaces can expose more paths than intended.

Use private database placement and expose only the reviewed public edge. The reference Compose stack publishes the API on host loopback18768 and no database port. In a remote deployment, the proxy is the public edge. Verify IPv4 and IPv6 behavior independently when both are configured. A stale AAAA record can send some clients down a broken path even while an IPv4-only check succeeds.

Docker on Linux creates networking/firewall rules for bridge networks, and published ports can bypass assumptions based only on ufw's input rules. Inspect actual exposure from an authorized external client and read the [Docker packet-filtering guidance](https://docs.docker.com/engine/network/packet-filtering-firewalls/) for the selected backend. Do not disable Docker's rule management casually; an incomplete replacement can break connectivity or widen exposure.

Repeatable infrastructure and state ownership

Infrastructure-as-code requires a reviewed plan, a protected state location, locking, versioned inputs and an owner. The state may contain sensitive values. A plan's replacement marker matters: a configuration change may recreate a resource rather than update it in place. Keep data resource lifecycle distinct from routine application release lifecycle where possible.

Use a fresh lab account/project or a clearly owned resource group. Before applying, compare the selected account and region to the worksheet. Review additions, changes, replacements and deletions. After applying, query the actual resources and rerun the plan to inspect unexplained drift. A clean plan is one signal; it does not prove the service works or the network is secure.

Configuration management should converge: applying the same intended settings twice should not create duplicates or rotate a password unexpectedly. Where an operation cannot be safely repeated, its implementation must detect existing state and stop for a deliberate decision. The reference credential generator refuses to overwrite an existing .env; that refusal protects an existing configuration from being mistaken for an empty lab.

OS boot, process management and a failed service

On a systemd-based Linux VM, inspect without changing anything:

bash
systemctl --failed
systemctl list-units --type=service --state=running
journalctl -b -p err --no-pager

Expected results are a list of failed units, active services and current-boot error messages. Some logs require additional privileges. An empty failed-unit list does not prove the intended application is healthy; a process can be running while serving wrong results. Use these observations with the user workflow and dependency checks. The [systemctl reference](https://www.freedesktop.org/software/systemd/man/latest/systemctl.html) defines the commands and state model.

For a deliberately stopped lab service, distinguish inactive, failed, restarting and start-limited states. Inspect the unit's configured user, working directory, environment source, dependencies, restart policy and stop grace period. Never run an application as root solely to make a permissions error disappear. Fix the intended ownership or access path and prove the service cannot modify unrelated files.

A reboot exercise requires approval for the exact disposable host and a known recovery path. Record services enabled at boot, storage availability and dependent-service order. After reboot, verify the external workflow, alerts, data and scheduled tasks. Local process tests do not claim host reboot proof.

Fault exercise: configure a disposable service with a wrong data directory, observe the symptom, prove which directory it used, and recover using the recorded intended path. Cleanup: stop only the lab's services; retire resources through Chapter 24's inventory rather than a broad delete. Pass: you can reproduce the environment, identify its access path, prove storage placement and explain the recovery route before going live.

ACTIVE-RECALL MASTERY CHECKPOINT · CH 20

Lock in what you just learned (3 quick questions)

PASS 2/3 FOR +30 XP
Q1.Why maintain a canonical host inventory (provider, region, IP, owner, purpose, ports, retirement date) that survives its author?
Q2.Why must network ingress and egress decisions be made explicitly (default-deny inbound)?
Q3.What should you verify right after provisioning a fresh Linux host foundation?
Answered 0 / 3