~/kb$
Short answers, run on a fresh server
One task per page, the answer first, and the real output of every command. Pick a topic or browse the latest answers.
~/kb$ls topics/
Topics
rack-01 · 11 units
- U01First hour on a new serverSSH keys, a sudo user, a firewall, fail2ban, automatic updates, swap and the time zone.8 tested
- U02Linux basics for serverssystemd services and timers, reading logs with journalctl, users, permissions and scheduled jobs.3 tested
- U03Web server and SSLNginx, server blocks, free certificates with Let’s Encrypt, redirects and compression.6 tested
- U04DatabasesPostgreSQL and MariaDB: install, users, remote access, backups, restores and upgrades.1 tested
- U05DockerInstall Docker Engine, Compose, volumes, logs, updating containers and freeing disk space.5 tested
- U06Backupsrsync, restic to object storage, schedules, and testing that a restore really works.testing
- U07Self-hosted appsMoodle for online courses and n8n for automation: install, settings, upgrades and their common errors.testing
- U08Self-hosted AIOllama and Open WebUI on a CPU server: install, the service, HTTPS and keeping the API private.testing
- U09Sending mailSend mail from a server through a relay, and set SPF, DKIM and DMARC so it is delivered.testing
- U10Repository and journal serversDSpace repositories and OJS journals: install, HTTPS, OAI-PMH, backups, upgrades and fixes.4 tested
- U11Fixing errors502 Bad Gateway, Permission denied (publickey), no space left on device, port in use.6 tested
~/kb$ls -t | head
Latest answers
- passed on Ubuntu 26.04 and Ubuntu 24.04.4DSpace “Expected mime type application/octet-stream but got text/html”: the Solr fixDSpace “Expected mime type application/octet-stream but got text/html” means Solr sent an error page. Two causes, each reproduced on DSpace 10 and fixed.5 December 2026
- passed on Ubuntu 26.04 and Ubuntu 24.04.4DSpace cron jobs: the scheduled tasks DSpace 10 needs, testedThe crontab DSpace 10 needs: sitemaps, OAI-PMH, thumbnails, the search index, checksums and cleanup, each job run by hand first, then proved to run from cron.4 December 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5Reset a forgotten DSpace admin password from the command lineLocked out of DSpace? Reset the admin password from the server with dspace user --newPassword, check it with a REST login, and fix two errors. Tested.3 December 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5How to install DSpace 10 on Ubuntu 26.04 and 24.04Install DSpace 10.1 on Ubuntu 26.04 or 24.04 from source: PostgreSQL, Solr 9, the backend and web interface as services, and the build errors you will hit.2 December 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5Docker Compose on Ubuntu 26.04 and 24.04: run an app with a databaseRun a two-container app with Docker Compose on Ubuntu 26.04 or 24.04: compose.yaml, a safe .env, healthcheck, data that survives down and reboots. Tested live.1 December 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5How to schedule a job with a systemd timer instead of cron on Ubuntu 26.04 and 24.04Schedule a job with a systemd timer on Ubuntu 26.04 or 24.04: service and timer files, check the schedule, time zones, and what Persistent= does. Tested live.30 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5How to read a service’s logs with journalctl on Ubuntu 26.04 and 24.04Read a service’s logs with journalctl on Ubuntu: one service, follow live, errors only, by time, the boot before a reboot, and cap the journal’s disk use.29 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5How to run a program as a systemd service on Ubuntu 26.04 and 24.04Run any program as a systemd service on Ubuntu 26.04 or 24.04: its own user, start at boot, restart on crash, logs, 203/EXEC and 217/USER fixed. Tested live.28 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5How to change the SSH port on Ubuntu 26.04 and 24.04Change the SSH port on Ubuntu 26.04 or 24.04 where ssh.socket owns it: why restarting ssh does nothing, the two commands that work, and a safe test first.27 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5PostgreSQL “Connection refused” on Ubuntu: is it running, which port, which addressFix PostgreSQL “Connection refused … Is the server running”: check the cluster and port with pg_lsclusters, then listen_addresses and pg_hba.conf. Tested.26 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5apt “Could not get lock /var/lib/dpkg/lock-frontend” on Ubuntu: what holds it and how to waitFix apt “Could not get lock /var/lib/dpkg/lock-frontend”: see which process holds it, make apt wait, and why deleting the lock breaks things. Tested.25 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5“No space left on device” on Ubuntu: find what fills the disk and free itFix “No space left on device” on Ubuntu: find the full filesystem and files, free space a deleted log still holds, and fix inodes. Tested on 26.04 and 24.04.24 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5SSH “Permission denied (publickey)”: find the cause and fix it on UbuntuFix SSH “Permission denied (publickey)”: read the reason sshd logs, then fix the user, key, permissions or AllowUsers. Tested on Ubuntu 26.04 and 24.04.23 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5Nginx 502 Bad Gateway: find the cause in the error log and fix it on UbuntuFix Nginx 502 Bad Gateway: the error log line for each cause (PHP-FPM down, wrong socket, permissions, app down, big headers), each fixed. Tested on Ubuntu.22 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.4Docker logs filling the disk: limit container log sizeDocker keeps every log line by default. Find the big logs, empty one safely, set max-size in daemon.json, validate it, and prove the limit holds. Tested live.21 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.4Port already in use: find which process is using a port on UbuntuFix “Address already in use”: find which process holds a port with ss, lsof or fuser, stop it the right way, and prove the port is free. Tested on Ubuntu.20 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.4Docker container keeps restarting: how to stop the loop and fix itFix a Docker container stuck in “Restarting (1)”: stop the loop, read the exit code and logs, and fix exit 1, 137 (out of memory) and 0. Tested live.19 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5Fix “permission denied” on /var/run/docker.sockFix “permission denied while trying to connect to the docker API” (or daemon socket) on Ubuntu, why it fails right after usermod, and why chmod 666 is wrong.18 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5How to install PostgreSQL on Ubuntu 26.04 and 24.04Install PostgreSQL 18 on Ubuntu 26.04 (16 on 24.04), fix “Peer authentication failed”, add a user and database, allow one remote server. Run on both.18 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.4How to install Docker on Ubuntu 26.04 and 24.04Install Docker Engine and Compose on Ubuntu 26.04 or 24.04, check it works, and close the firewall hole Docker opens. Run live on both, real output.18 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.4How to enable HTTP/2 in Nginx on Ubuntu 26.04 and 24.04Turn on HTTP/2 in Nginx on Ubuntu 26.04 (`http2 on;`) or 24.04 (`listen … http2`) and prove it with curl and openssl. Tested on real servers: warnings, www.18 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5How to set the timezone on Ubuntu 26.04 and 24.04Set the timezone on Ubuntu 26.04 or 24.04 with timedatectl, see what follows the change and what keeps the old zone. Run live on both releases.15 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5How to install Nginx on Ubuntu 26.04 and 24.04Install Nginx on Ubuntu 26.04 or 24.04, open the firewall, hide the version, reload without downtime and fix "Address already in use". Run on both.18 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5How to set up Nginx server blocks on Ubuntu 26.04 and 24.04Host two sites on one Ubuntu 26.04 or 24.04 server with Nginx server blocks, test before DNS, catch unknown names and fix 403s. Run live on both.18 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.4How to get a free Let’s Encrypt certificate for Nginx on Ubuntu 26.04 and 24.04A free Let’s Encrypt certificate for Nginx on Ubuntu 26.04 or 24.04 with certbot: every prompt, what it changes, renewal, and why closing port 80 breaks it.18 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.4How to redirect www to non-www and HTTP to HTTPS in Nginx on Ubuntu 26.04 and 24.04Send http, www and https://www to one https:// address in Nginx on Ubuntu 26.04 or 24.04,. Tested on real servers: certificate, renewal, 308, the loop.18 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5How to enable gzip and Brotli compression in Nginx on Ubuntu 26.04 and 24.04Ubuntu’s Nginx gzips only HTML. Compress CSS and JS, add Brotli from one apt package, and avoid the duplicate error. Tested with real files and sizes.18 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5How to create a sudo user on Ubuntu 26.04 and 24.04Create a sudo user on Ubuntu 26.04 or 24.04, copy your SSH key so it can log in, and test sudo (sudo-rs on 26.04). Run live on both, with real output.15 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5How to set up SSH key login on Ubuntu 26.04 and 24.04Make an SSH key, copy it to Ubuntu 26.04 or 24.04 and turn off password login so it stays off. Run live on both releases, with real output.15 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.4How to set up a UFW firewall on Ubuntu 26.04 and 24.04Set up UFW on Ubuntu 26.04 or 24.04 without locking yourself out: allow SSH, enable, open web ports, rate-limit SSH. Run live on both, with real output.18 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.4How to install fail2ban on Ubuntu 26.04 and 24.04 to protect SSHInstall fail2ban on Ubuntu 26.04 or 24.04, see it ban a real SSH attacker, unban an address and whitelist your own. Run live on both, with real output.18 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5How to turn on automatic security updates on Ubuntu 26.04 and 24.04Automatic security updates on Ubuntu 26.04 and 24.04: check they are on, pick the time, prove a run happened, add a safe nightly reboot. Tested on both.15 November 2026
- passed on Ubuntu 26.04.1 and Ubuntu 24.04.5How to add a swap file on Ubuntu 26.04 and 24.04Add a 2 GB swap file on Ubuntu 26.04 or 24.04, keep it after a reboot, set swappiness, resize or remove it. Run live on both, with real output.15 November 2026