OneLinersCommand workbench
Guides
Operational guides

Complete procedures with a way back.

Searchable, versioned procedures with prerequisites, verification, concrete output, and rollback.

Guides
243
Favorites
0
243 launch guides · 2601 reviewed steps
29 of 243 guides

Packages & Updates · Incident Response & Troubleshooting · System Administration

Fix Sub-process /usr/bin/dpkg returned an error code (1) safely

Sub-process /usr/bin/dpkg returned an error code (1) is a final summary, not the root cause. The decisive message normally appears earlier in the transaction. This guide preserves that first failure, checks package-manager ownership, locks, disk and filesystem health, audits dpkg state, then completes configuration or performs a targeted rollback without deleting lock files or forcing unrelated removals.
Save to collectionCreate a collection in the sidebar first.
caution40 minintermediate9 stepsUbuntu Server

Packages & Updates · Software Engineering

Fix error: externally-managed-environment on Ubuntu safely

The error: externally-managed-environment means pip has refused to modify an Ubuntu-managed Python installation. This guide shows how to identify the interpreter you are using, preserve operating-system package ownership, and choose the correct safe route: apt for Ubuntu packages, a project virtual environment for libraries, pipx for command-line applications, or an isolated container for disposable work.
Save to collectionCreate a collection in the sidebar first.
caution25 minbeginner8 stepsUbuntu

Networking & DNS · Security

Run a private Unbound validating recursive resolver

Build a private, cache-enabled Unbound resolver that performs recursion itself, validates DNSSEC, minimizes query names, and refuses clients outside an explicit network.
Save to collectionCreate a collection in the sidebar first.
caution135 minadvanced13 stepsUbuntu Server

System Administration · Incident Response & Troubleshooting · Storage & Filesystems

Recover an Ubuntu server with systemd rescue and emergency modes

Recover a non-booting Ubuntu Server by choosing the least invasive systemd target, preserving console evidence, identifying the failed boot dependency, applying a reversible correction, and proving a clean normal boot.
Save to collectionCreate a collection in the sidebar first.
caution60 minadvanced12 stepsUbuntu Server

Networking & DNS · Security

Build private DNS filtering with Pi-hole and Unbound

Layer Pi-hole v6 filtering on a client-facing DNS service and Unbound validation on a loopback-only recursive port, with explicit privacy, firewall, DNSSEC, canary, and rollback controls.
Save to collectionCreate a collection in the sidebar first.
caution180 minadvanced13 stepsUbuntu Server

Networking & DNS · Security · System Administration

Deploy a Tailscale subnet router and controlled exit node

Build a tagged Ubuntu Tailscale router, advertise and approve a private subnet, authorize users with least-privilege grants, test optional internet egress, and rehearse failure, withdrawal, and replacement.
Save to collectionCreate a collection in the sidebar first.
caution120 minadvanced12 stepsUbuntu Server

System Administration · Storage & Filesystems · Security

Migrate a Linux root filesystem to a larger disk with minimal downtime

Copy an Ubuntu root filesystem to a larger ext4 disk, preserve Linux metadata, rebuild UUID-based boot artifacts, perform a controlled cutover, and retain the original disk as a tested rollback.
Save to collectionCreate a collection in the sidebar first.
danger150 minadvanced11 stepsUbuntu Server

Databases & Data · Security · Backup & Recovery

Secure SQL Server with TLS, least privilege, and verified backup restore

Configure SQL Server 2025 CU7 on Ubuntu 24.04 for strict validated TLS, replace broad application rights, create an encrypted checksum backup with off-host key escrow, and prove it through real restore and CHECKDB.
Save to collectionCreate a collection in the sidebar first.
danger270 minadvanced16 stepsSQL Server

Networking & DNS · System Administration

Configure VLANs, bonds, and bridges with Netplan without losing access

Build a redundant active-backup bond, carry a tagged service VLAN over it, terminate the host address on a Linux bridge, and introduce the topology through `netplan try` with automatic rollback, console recovery, and explicit switch-side evidence.
Save to collectionCreate a collection in the sidebar first.
danger120 minadvanced10 stepsUbuntu Server

Packages & Updates · Security

Configure automatic Ubuntu security updates with controlled reboot windows

Apply Ubuntu security updates through reviewed origins, dry-run the exact unattended policy, schedule APT timers inside a declared maintenance window, and permit reboots only at a known local time when no users are logged in.
Save to collectionCreate a collection in the sidebar first.
caution85 minintermediate9 stepsUbuntu Server

Services & Applications · Security

Configure journald retention, forwarding, and centralized remote logs

Make local journals persistent and bounded, receive per-host journal files on a dedicated collector, and upload structured events over mutually authenticated TLS while preserving a local buffer and auditable failure behavior.
Save to collectionCreate a collection in the sidebar first.
caution105 minadvanced10 stepsUbuntu Server

Storage & Filesystems · System Administration

Fix wrong fs type, bad option, bad superblock and configure reliable mounts

The mount error “wrong fs type, bad option, bad superblock” is a summary, not a diagnosis of corruption. Identify the exact storage layer, read the kernel reason, and separate missing helpers or invalid options from real damage before configuring UUID-based systemd mounts.
Save to collectionCreate a collection in the sidebar first.
caution55 minintermediate12 stepsUbuntu Server

Databases & Data · High Availability & Reliability

Configure PostgreSQL streaming replication and planned failover

Build and operate a PostgreSQL 18.4 hot standby with bounded WAL retention, verified lag, explicit fencing, planned promotion, endpoint cutover, and safe rewind or rebuild.
Save to collectionCreate a collection in the sidebar first.
danger360 minadvanced14 stepsPostgreSQL

Databases & Data · Backup & Recovery

Recover PostgreSQL to a point in time with WAL archiving

Build a fail-closed PostgreSQL 18.4 WAL archive and verified base-backup chain, then restore to an exact target in isolation, validate while paused, promote, and re-establish protection.
Save to collectionCreate a collection in the sidebar first.
danger420 minadvanced17 stepsPostgreSQL

Networking & DNS · Security · System Administration

Deploy a Google Cloud VM with IAM, firewall policy and OS Login

Create a private Ubuntu 24.04 LTS Compute Engine VM with Shielded VM, IAP TCP forwarding, OS Login, service-account-targeted firewall rules and a least-privilege workload identity, then prove access and recovery.
Save to collectionCreate a collection in the sidebar first.
caution160 minadvanced11 stepsGoogle Cloud CLI

Networking & DNS · Security · System Administration

Deploy an Azure Linux VM with NSG and managed identity

Deploy a private Ubuntu 24.04 LTS VM with Trusted Launch, encryption at host, an explicit NSG, no public IP and a least-privilege system-assigned managed identity, then prove network, identity, patch and recovery controls.
Save to collectionCreate a collection in the sidebar first.
caution150 minadvanced11 stepsAzure CLI

Security · Services & Applications

Create AppArmor profiles and investigate denials

Build an enforce-mode Ubuntu AppArmor profile, review bounded learning evidence, model execution/network boundaries, interpret denials and roll out without unconfined shortcuts.
Save to collectionCreate a collection in the sidebar first.
danger270 minadvanced12 stepsUbuntu Server

Services & Applications · Security

Install Apache on Ubuntu with a production baseline

Install Apache 2.4, replace the default page, constrain the listener, set a server identity, open only required firewall ports, and prove restart safety.
Save to collectionCreate a collection in the sidebar first.
caution35 minbeginner8 stepsUbuntu Server

Containers & Kubernetes · Security

Install Docker Engine and Compose with safer defaults

Install from Docker's signed repository, limit daemon exposure, bound logs, and document privilege boundaries.
Save to collectionCreate a collection in the sidebar first.
caution35 minintermediate9 stepsUbuntu Server

Services & Applications · Networking & DNS

Configure Exim4 as an internet mail server

Set a canonical identity, local domains, relay policy, DNS, TLS, aliases, queue monitoring, and end-to-end SMTP tests on Debian or Ubuntu.
Save to collectionCreate a collection in the sidebar first.
caution90 minadvanced8 stepsExim4

Containers & Kubernetes · Networking & DNS · Security

Set up a Kubernetes cluster on Ubuntu with kubeadm

Build a single-control-plane Kubernetes cluster with containerd, an explicit Pod network, a joined worker, verification, and a complete reset path.
Save to collectionCreate a collection in the sidebar first.
caution90 minadvanced10 stepsUbuntu Server

Services & Applications · Databases & Data

Install a production LAMP stack on Ubuntu

Build Apache, MariaDB, PHP-FPM, TLS, application identity, database credentials, health checks, and backups as one verified stack.
Save to collectionCreate a collection in the sidebar first.
caution90 minadvanced8 stepsUbuntu Server

Services & Applications · Databases & Data

Install a production LEMP stack on Ubuntu

Build nginx, MariaDB, PHP-FPM, TLS, isolated application paths, FastCGI safety rules, health checks, and backups.
Save to collectionCreate a collection in the sidebar first.
caution90 minadvanced8 stepsUbuntu Server

Databases & Data · Security

Install and secure MySQL on Ubuntu

Install MySQL, remove unsafe defaults, create a least-privilege application database, optionally allow restricted TLS network access, and prove backup readiness.
Save to collectionCreate a collection in the sidebar first.
caution45 minintermediate12 stepsUbuntu Server

Services & Applications · Security

Install nginx on Ubuntu with a production baseline

Install nginx, replace the default site, set a minimal server identity, validate config, restrict firewall access, and prove restart behavior.
Save to collectionCreate a collection in the sidebar first.
caution35 minbeginner8 stepsUbuntu Server

Networking & DNS · Security

Fix OpenVPN Cannot resolve host address, VERIFY ERROR and TLS handshake failures

Deploy or repair an OpenVPN 2.6 gateway with certificate checks intact. Start Cannot resolve host address with the client's pre-tunnel DNS and actual profile; investigate VERIFY ERROR, peer certificate verification failure and TLS handshake failed only at their demonstrated transport or TLS layer.
Save to collectionCreate a collection in the sidebar first.
caution90 minadvanced14 stepsUbuntu Server

Databases & Data · Security

Install and configure PostgreSQL on Ubuntu

Install PostgreSQL, create a least-privilege role and database, optionally enable restricted TLS network access, validate authentication order, and prove recovery readiness.
Save to collectionCreate a collection in the sidebar first.
caution45 minintermediate13 stepsUbuntu Server

System Administration · Security

Perform an initial Ubuntu Server setup and security hardening

Create a named administrator, prove key-based recovery access, patch the host, restrict SSH, enable a host firewall, and verify time and exposed services.
Save to collectionCreate a collection in the sidebar first.
caution45 minintermediate10 stepsUbuntu Server

Networking & DNS · Security

Deploy a WireGuard server on Ubuntu 24.04 LTS

Create a minimal routed WireGuard VPN with protected keys, explicit peers, constrained forwarding, and peer removal.
Save to collectionCreate a collection in the sidebar first.
caution45 minintermediate9 stepsUbuntu Server