Running a Tiny Nginx Web Server in a Rootless Podman Container on Ubuntu 24.04

Ubuntu 24.04 ships with a fully‑featured Podman package that works out of the box.
Rootless mode lets a normal user spin up containers without any privileged operations, which is a great fit for a home lab or a small self‑hosted service.
Below is a step‑by‑step guide to build a minimal Nginx image, run it rootlessly, and keep the whole thing under tight, sane defaults.

Prerequisites

  • Ubuntu 24.04 (LTS) installed on a machine or VM.
  • A non‑root user with sudo privileges (the example assumes alice).
  • Basic knowledge of the shell, sudo, and systemd.
# Verify the kernel version – user namespaces require 5.8+ (Ubuntu 24.04 uses 6.6)
uname -r
# Install Podman if it isn’t already
sudo apt update
sudo apt install -y podman

Enable rootless mode

Podman automatically falls back to rootless when run as a normal user, but you should confirm that the user‑namespace mapping is in place:

[Read More]

Preventing Rootless Podman from Filling Up My Home Directory with Container Logs

Why Rootless Podman Can Bloat Your Home

When I first started juggling a handful of lightweight services in Podman from a non‑root account, my $HOME started filling up faster than my Git repos. The culprit? The per‑container log files that Podman writes under

$HOME/.config/containers/storage/overlay-containers/*/files/containers.log

If a container misbehaves or just beeps a lot, those logs can grow to gigabytes. Rootless Podman defaults to the file log driver when you explicitly request one, so the logs stay in your home directory and can fill up the disk before you notice anything.

[Read More]

Docker builds on a 32 GB Raspberry Pi: How I recovered from a full disk

I was running a hobbyist homelab on a Raspberry Pi 4 with 32 GB of eMMC storage. The Pi was a low‑cost, low‑power server that hosted a few services: a personal web server, a GitLab runner, and a Docker build farm for CI pipelines. The build farm was a simple script that pulled the latest code, built a Docker image, and pushed it to a registry. Everything worked until the disk filled up during a large multi‑stage build.

[Read More]

How I Stopped /var/log from Flooding the Root Filesystem with Systemd Journal Rotations

On a small home‑lab server or a single‑user laptop, the root filesystem is often the first place that runs out of space. I ran into this on a 2025‑era Raspberry Pi running Ubuntu 24.04 LTS: the systemd journal kept growing until the root partition hit 95 % and the machine refused to boot. The fix was surprisingly simple once you understand how systemd‑journald works and how to steer its output away from the root filesystem.

[Read More]

Pulling all failed SSH login attempts from auth.log in under a minute with awk

Fast extraction of SSH failures with awk

When a server is exposed to the internet, the first line of defense is the log.
In most Linux distributions the file /var/log/auth.log (or /var/log/secure on RHEL‑style systems) contains every authentication event, including failed SSH logins.
If you need a quick snapshot of the last hour’s failures, you can do it in a single awk command that finishes in a fraction of a second, even on a 10‑GB log file.

[Read More]

A single cron job ate all my RAM and crashed my server: how I added zram and tweaked ulimit

A night of memory chaos

I was running a 4 GB‑RAM VPS that hosts a handful of Docker containers and a personal website. A nightly backup script, scheduled with cron, suddenly started chewing through all RAM, triggering the OOM killer and bringing the whole machine to a halt. The crash happened on a Tuesday afternoon, and I had to reboot the server to get it back online. The lesson? Even a single misbehaving cron job can exhaust memory if you don’t guard against runaway processes. Below is a step‑by‑step guide on how I diagnosed the problem, added zram to give the kernel a memory cushion, and tweaked ulimit settings so that future cron jobs can’t over‑consume RAM.

[Read More]

How I stopped a 16‑GB microSD Raspberry Pi from dying mid‑boot because /var/log grew to 10 GB after a year of unattended cron jobs

Raspberry Pi’s are perfect for low‑power tinkering, but a 16‑GB microSD can start biting back if something writes too much data. After a year of unattended cron jobs, my Pi’s /var/log ballooned to 10 GB and the boot process stalled. Below is the exact walk‑through I used to bring the system back online and prevent a repeat.

Why the logs ate the SD card

The default Raspberry Pi OS ships with systemd‑journald for kernel and service logs and rsyslog for the classic syslog files. Both dump their output into /var/log. If you run cron jobs that spit out text and you don’t redirect or limit that output, each run just appends. Over a year, even a few megabytes per job can turn into gigabytes. The SD card’s limited write endurance means a bloated log file can accelerate wear‑out.

[Read More]