Run next/image on a self-hosted VPS without OOM: why the optimizer is memory-hungry, how to bound device sizes, formats, and cache, or offload it.
5 articles · 1 review
Infrastructure articles cover the operational side of software — servers, load balancers, database configuration, backups, and the decisions that keep production systems running reliably.
Run next/image on a self-hosted VPS without OOM: why the optimizer is memory-hungry, how to bound device sizes, formats, and cache, or offload it.
Structured logging in Next.js with pino: JSON to stdout, a per-request x-request-id, a wrapper that logs method/path/status/latency, and no secrets in logs.
Production healthcheck endpoints: liveness vs readiness probes, dependency checks with timeouts, 200 vs 503 logic, Docker and Kubernetes config, and security.
Stack
Databases
Block scanner bots with Cloudflare WAF on the free plan. Exact rule for /.env, /wp-admin, /xmlrpc — with the starts_with gotcha and curl API deployment.
Services
Self-host a Node.js API on a €6/month VPS: Caddy reverse proxy, Docker Compose, zero-downtime deploy script, and GitHub Actions CI — complete production setup.
We were about to pay for a hosting plan that was way more than we needed. Iurii looked at what we actually have — traffic, data, usage patterns — and suggested something much simpler.
Valentina Russo 🇮🇹
Service: technical consultation
AvailableGot a project in mind?
Whether it's a new product, an integration, or scaling an existing system — let's talk about how I can help.