01

Overview

My production server is a Linux VPS hosting Adminly, MeilleurAppart's collector and website, and internal tools for Swiss Web Création. From 9 to 15 November 2026, I took it back in hand: hardening, backups, deployment and monitoring. This work is documented; the server's initial setup, which came earlier, is not.

At its core: taking away root rights from the AI agents that work on this server, without breaking anything.

02

Context

As of 15 November 2026, the server runs several separate projects in Docker containers: 15 containers defined, 7 of them running. Some services are shared: the Caddy reverse proxy by every site, n8n by Swiss Web Création and a price-watch tool, the Umami analytics tool by Adminly, MeilleurAppart and a content site.

It is a single Linux VPS (2 vCores, 4 GB of memory) running the production of several projects. Up to six AI coding-assistant sessions work on it in parallel, all under the same account.

03

Challenge

Running your own infrastructure means owning every failure mode: an unpatched service, a full disk, a backup that cannot be restored. The challenge is to reach a dependable level of operations with limited time and attention.

The audit of 11 November 2026 established that this shared account was effectively root, in two ways: passwordless sudo and membership of the Docker group. A misled or faulty agent could read every secret, erase the backups or deploy unreviewed code. In one week, the sessions had run about 300 privileged Docker commands: access could not simply be cut off.

04

Objectives

  • A clear, documented server architecture
  • Services isolated in containers
  • Hardened access and a reduced attack surface
  • AI agents with no way of becoming root
  • Monitoring that surfaces problems early
  • Backups that are tested, not just scheduled

05

Technical decisions

Access is split into three levels: a personal administration account (sudo with a password, separate SSH keys); an account for the agents, with no free sudo and no Docker, but an allowlist of fixed root commands that take no free argument (server status, masked container logs, local CI, staging, publishing a site); and a dedicated service account per application. A system audit log records actions. Every root change goes through a versioned script, tested on a bench and installed by me after comparing its fingerprint, with three modes: check, apply, rollback.

Docker isolates services from one another and makes deployments reproducible. Caddy is the reverse proxy, with automatic TLS and security headers. Backups leave every day, encrypted, for off-site object storage, with a 30-day object lock and upload keys that have no delete permission: for 30 days, a backup cannot be erased with the keys stored on the server. External monitoring costs nothing.

06

Architecture

Internet → Caddy (TLS) → each project's containers (Adminly, MeilleurAppart, internal tools) and shared services (n8n, Umami). Adminly and MeilleurAppart databases on managed Supabase. Encrypted backups → off-site object storage. External monitoring → alerts.

Access: personal administration account → sudo with a password; agents account → no free sudo, no Docker, an allowlist of fixed root commands; one service account per application; system audit log.

07

Technologies

  • Linux (Ubuntu 24.04)
  • sudoers, POSIX groups and permissions
  • auditd
  • OpenSSH
  • fail2ban
  • UFW firewall
  • Docker / Docker Compose
  • Caddy
  • Bash
  • Git
  • n8n
  • Umami
  • Off-site object storage

08

Implementation

The work moved in small batches, each one scoped, applied and then checked: about thirty hardening batches from 9 to 15 November 2026, recorded in a 1,557-line change log. Least privilege, SSH, auditd, firewall, service accounts and sudo commands allowed one by one. Backups, monitoring and deployments followed the same approach.

The difficulties: the agents needed Docker for CI and staging; back doors remained, such as a script owned by the agents account and run by root every night, or writable service files; removing the group took effect only once existing sessions ended; and rootless Docker was impractical for lack of disk space.

The answers: closing the doors in order, starting with the scripts run by root; replacing legitimate uses with fixed commands; withdrawing rights over several nights, with a check between each; making every rule reversible by a simple rename. The "side passages" (n8n, the prospecting tool, the analytics service) were closed over the following days.

09

Results

  • Agents: as of 12 November 2026, they have no way left of becoming root; deployment, secrets and backups are out of their reach. Side passages closed as of 14 November 2026. No service outage caused by this work.
  • Restore: 5 documented runs across 3 scopes, from 4 to 13 November 2026; the restored data was checked. A full rebuild of the services and the recovery time have not been measured yet.
  • Monitoring: server alerts every 15 minutes and external HTTP monitors every 5 minutes, at no cost (15.11.2026).
  • Disk: usage brought down from about 89–94 % to 78 %, from 10 to 15 November 2026.
  • n8n upgrade during the work: 81 security advisories cleared, 37 of them high severity, for an outage of about 26 seconds.

10

Limits

Some risks remain open as of 15 November 2026. They are written down, and a hardening plan is still in progress.

11

My role

I commissioned the audit, approved the plan and gave my go-ahead sub-batch by sub-batch. I applied each step myself from my own account, with a rescue session open, and tested the emergency access (a second key, the hosting console). I carried out the operations with the providers, created the accounts, keys and storage buckets, installed the scripts and checked the results. The scripts, batch sheets, reports and procedures were largely written by Claude Code, under my direction.

12

Lessons learned

Reducing privileges on a production server also means closing indirect access paths and making changes in verifiable steps.

Contact

Let's build something reliable.

Available immediately for a systems administrator role, and always up for making a system reliable or talking through a product.

Get in touch