<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: FlatlinerAtheist | CLI-NERDS</title>
    <description>The latest articles on DEV Community by FlatlinerAtheist | CLI-NERDS (@clinerds).</description>
    <link>https://dev.to/clinerds</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4189900%2F91917414-3cb4-4a8a-9a53-8c115a821b0b.png</url>
      <title>DEV Community: FlatlinerAtheist | CLI-NERDS</title>
      <link>https://dev.to/clinerds</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/clinerds"/>
    <language>en</language>
    <item>
      <title>I Self-Hosted n8n and Replaced Three Subscriptions</title>
      <dc:creator>FlatlinerAtheist | CLI-NERDS</dc:creator>
      <pubDate>Mon, 16 Nov 2026 06:17:28 +0000</pubDate>
      <link>https://dev.to/clinerds/i-self-hosted-n8n-and-replaced-three-subscriptions-1c83</link>
      <guid>https://dev.to/clinerds/i-self-hosted-n8n-and-replaced-three-subscriptions-1c83</guid>
      <description>&lt;p&gt;Last month I audited my own subscription stack and found three automation tools I was paying for monthly, each doing one small job: one watched an RSS feed, one moved form submissions into a spreadsheet, one posted to social media. Total cost: more than my VPS. Total complexity: three dashboards, three logins, three privacy policies holding my data.&lt;/p&gt;

&lt;p&gt;So I did what any self-hoster would do: deleted all three and ran one container. The replacement is &lt;a href="https://n8n.io" rel="noopener noreferrer"&gt;n8n&lt;/a&gt; — a workflow automation tool you self-host, connect to ~400 services, and keep entirely on your own infrastructure. It's the closest thing to "Zapier, but mine" that I've found, and this post is the honest setup guide — including the license asterisk you should read before falling in love.&lt;/p&gt;

&lt;h2&gt;
  
  
  First, the asterisk: it's not open source
&lt;/h2&gt;

&lt;p&gt;Full disclosure, because this blog cares about that stuff (see &lt;a href="https://clinerds.com/article/openbao-secrets-after-vault-bsl" rel="noopener noreferrer"&gt;what happened when HashiCorp changed Vault's license&lt;/a&gt;): n8n uses a &lt;strong&gt;"fair-code" license&lt;/strong&gt; (Sustainable Use License). Source-available, free to self-host and use, but with commercial restrictions and not OSI-approved. My read: for personal automation it's a non-issue; if you're building a product on top of it, read the license or reach for something like Windmill or Activepieces instead. Know what you're adopting — that goes for every tool on this blog.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest setup
&lt;/h2&gt;

&lt;p&gt;One docker-compose file, following the same pattern as &lt;a href="https://clinerds.com/article/self-hosted-docker-compose-stack" rel="noopener noreferrer"&gt;the rest of my stack&lt;/a&gt; — app container, real database (not SQLite, you'll thank me at 10,000 executions), one reverse proxy in front:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;n8n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docker.n8n.io/n8nio/n8n:latest&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;N8N_HOST=n8n.mydomain.com&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;N8N_PROTOCOL=https&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;WEBHOOK_URL=https://n8n.mydomain.com/&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;DB_TYPE=postgresdb&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;DB_POSTGRESDB_HOST=postgres&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;DB_POSTGRESDB_USER=n8n&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;DB_POSTGRESDB_PASSWORD=${DB_PASSWORD}&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;N8N_ENCRYPTION_KEY=${ENCRYPTION_KEY}&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;n8n-data:/home/node/.n8n&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;postgres&lt;/span&gt;

  &lt;span class="na"&gt;postgres&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgres:17-alpine&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;POSTGRES_USER=n8n&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;POSTGRES_PASSWORD=${DB_PASSWORD}&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;POSTGRES_DB=n8n&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;pg-data:/var/lib/postgresql/data&lt;/span&gt;

&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;n8n-data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;pg-data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two environment variables deserve your attention before &lt;code&gt;docker compose up&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;N8N_ENCRYPTION_KEY&lt;/code&gt;&lt;/strong&gt; — set it once, generate a long random string, and &lt;em&gt;never lose it&lt;/em&gt;. It encrypts stored credentials. Losing it means re-entering every API key in every workflow; I keep mine in the password manager next to the &lt;a href="https://clinerds.com/article/openbao-secrets-after-vault-bsl" rel="noopener noreferrer"&gt;OpenBao unseal keys&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;WEBHOOK_URL&lt;/code&gt;&lt;/strong&gt; — must be your public HTTPS URL, or your webhook triggers will generate broken URLs silently and you'll debug it for an embarrassing length of time. Ask me how I know.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then point your DNS at the box, put nginx in front with a real certificate — the same dance as everything else on this domain, covered in the &lt;a href="https://clinerds.com/article/nginx-reverse-proxy-explained" rel="noopener noreferrer"&gt;reverse proxy guide&lt;/a&gt; — and open the URL. First run creates your owner account.&lt;/p&gt;

&lt;h2&gt;
  
  
  Webhooks are the point — protect them
&lt;/h2&gt;

&lt;p&gt;The power move with n8n is the webhook trigger: an HTTP endpoint that starts a workflow. That's also your attack surface. Two rules:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Authentication on by default.&lt;/strong&gt; n8n webhook nodes support header or basic auth — enable it for anything that touches private data. An unauthenticated webhook that posts to your social accounts is a remote-control you left on the porch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep it off the open internet where you can.&lt;/strong&gt; My instance sits behind the same VPN-plus-proxy arrangement as my other admin tools; the &lt;a href="https://clinerds.com/article/tailscale-homelab-remote-access" rel="noopener noreferrer"&gt;Tailscale setup&lt;/a&gt; gets used here too. If a workflow must be public (like a form), that's the exception, and it gets its own auth and rate limits.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What I actually automated (the three-subscription replacement)
&lt;/h2&gt;

&lt;p&gt;The original three jobs, rebuilt as two workflows:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. RSS → filtered digest.&lt;/strong&gt; Trigger node polls a few feeds hourly, a filter drops everything that doesn't match keywords I'm tracking, and the survivors land in a Telegram message each morning. Replaces the RSS-watcher subscription — and the keyword filter is better because I wrote it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Form → spreadsheet → draft social post.&lt;/strong&gt; A webhook receives a form submission, n8n appends a row to a Google Sheet (the integrations are first-class — OAuth setup takes minutes), then drafts a social post I review before anything goes live. Human in the loop, automation doing the boring 90%.&lt;/p&gt;

&lt;p&gt;Total running time per execution: seconds. Total cost: the VPS I was already paying for. There's also an AI node if you want to wire in a local model through the &lt;a href="https://clinerds.com/article/ollama-local-llm-cheap-vps" rel="noopener noreferrer"&gt;Ollama setup&lt;/a&gt; — summarize-then-post is where I'm experimenting next.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where self-hosted n8n wins — and where it doesn't
&lt;/h2&gt;

&lt;p&gt;Wins, honestly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Execution-based pricing beats per-step pricing at volume.&lt;/strong&gt; On Zapier, a ten-step workflow burns ten tasks; on Make, every module burns credits. Self-hosted n8n doesn't meter you at all — my digest workflow would be a metered horror on the hosted tiers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your data stays home.&lt;/strong&gt; Form submissions and API keys live on your disk, not in someone else's multi-tenant database. For a privacy-first stack, that's the whole argument.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code when you want it.&lt;/strong&gt; Every node can fall through to a JavaScript or Python step. Some of my "workflows" are 80% code nodes, and that's fine — the visual layer documents itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Losses, equally honest:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You own the uptime.&lt;/strong&gt; When the 7 AM digest doesn't arrive, that's your container to debug, not a status page to check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No support contract.&lt;/strong&gt; The community forum is genuinely good; a Slack channel with an SLA it is not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Complex branching logic gets messy&lt;/strong&gt; in a visual editor faster than you'd think. Past a certain complexity, it's a real application — write it as one.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Backup, because I always say it
&lt;/h2&gt;

&lt;p&gt;Your workflows and credentials live in Postgres now, which means your existing &lt;a href="https://clinerds.com/article/postgresql-backup-restore-guide" rel="noopener noreferrer"&gt;Postgres backup routine&lt;/a&gt; covers everything. Take the volume backup too (&lt;code&gt;n8n-data&lt;/code&gt; holds the encryption key material — back it up, or your credential backups are unreadable). Test a restore once; an automation tool whose config you can't restore is a very elaborate way to lose your afternoons.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worth it?
&lt;/h2&gt;

&lt;p&gt;If you pay for one or two lightweight automation subscriptions and already run a server: yes, emphatically. An afternoon of setup traded for permanently lower bills and a stack that keeps your data home is exactly the trade this blog exists to make. Just go in with open eyes about the license, set the encryption key before the first credential, and put auth on every webhook.&lt;/p&gt;

&lt;p&gt;And if you build the AI-summary workflow before I do — the RSS digest summarized by a local model every morning — tell me how it goes. That's the next post brewing.&lt;/p&gt;

</description>
      <category>selfhosted</category>
      <category>docker</category>
      <category>automation</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Scan Every Container Before It Ships: Trivy in CI</title>
      <dc:creator>FlatlinerAtheist | CLI-NERDS</dc:creator>
      <pubDate>Mon, 16 Nov 2026 06:17:07 +0000</pubDate>
      <link>https://dev.to/clinerds/scan-every-container-before-it-ships-trivy-in-ci-1a6p</link>
      <guid>https://dev.to/clinerds/scan-every-container-before-it-ships-trivy-in-ci-1a6p</guid>
      <description>&lt;p&gt;A couple of years ago I got a CVE alert email about a container running in production. Not a new CVE — one that had been public for eight months. The image was fine when we built it; it had just been sitting there while the world moved on. That was the day I stopped treating vulnerability scanning as a nice-to-have and made it a build gate.&lt;/p&gt;

&lt;p&gt;The tool I landed on was &lt;a href="https://github.com/aquasecurity/trivy" rel="noopener noreferrer"&gt;Trivy&lt;/a&gt; — free, open source, absurdly fast, and it doesn't just scan container images. If you have a CI pipeline (and after the &lt;a href="https://clinerds.com/article/github-actions-first-ci-pipeline" rel="noopener noreferrer"&gt;GitHub Actions article&lt;/a&gt;, you do), this is a thirty-minute upgrade that pays for itself the first time it catches something.&lt;/p&gt;

&lt;h2&gt;
  
  
  One minute to your first scan
&lt;/h2&gt;

&lt;p&gt;Install is a single binary (or a Docker image if you prefer):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sfL https://get.aquasec.io/trivy &lt;span class="o"&gt;|&lt;/span&gt; sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then point it at any image:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;trivy image nginx:1.27-alpine
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What you get back is a full bill of materials: OS packages, language dependencies (the ones baked into your app images), each with its CVE ID, severity, and — the part I love — whether a fixed version exists. "There's a critical CVE in libssl and upgrading to the current base image fixes it" is an actionable sentence. A raw CVE count is not.&lt;/p&gt;

&lt;p&gt;Two flags you'll use constantly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;trivy image --severity HIGH,CRITICAL --exit-code 1 myapp:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--exit-code 1&lt;/code&gt; is the whole trick: Trivy stops being a report and becomes a gate. Pipe that into CI and the build fails when a serious CVE ships.&lt;/p&gt;

&lt;h2&gt;
  
  
  The CI gate
&lt;/h2&gt;

&lt;p&gt;In GitHub Actions, after your build step:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Scan image&lt;/span&gt;
  &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;aquasecurity/trivy-action@master&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image-ref&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'ghcr.io/clinerds/app:${{ github.sha }}'&lt;/span&gt;
    &lt;span class="na"&gt;severity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'HIGH,CRITICAL'&lt;/span&gt;
    &lt;span class="na"&gt;exit-code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'1'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In GitLab CI, a plain script step does the same job:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;scan&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;test&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;aquasec/trivy:latest&lt;/span&gt;
    &lt;span class="na"&gt;entrypoint&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;trivy image --severity HIGH,CRITICAL --exit-code 1 $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few hard-won settings: scan the image you actually ship (by digest or immutable tag, never &lt;code&gt;:latest&lt;/code&gt; — you'll rescan whatever is newest, not what you built). Run the scan on every merge request &lt;em&gt;and&lt;/em&gt; nightly — new CVEs appear under old images. And cache the vulnerability DB (&lt;code&gt;--cache-dir&lt;/code&gt; or the action's built-in caching); the default download on every run gets old fast.&lt;/p&gt;

&lt;p&gt;My own CI templates carry a Trivy job wired exactly like this — because copy-paste security is better than no security.&lt;/p&gt;

&lt;h2&gt;
  
  
  Managing the noise: the ignore file, with discipline
&lt;/h2&gt;

&lt;p&gt;Within a week, one of three things happens: you fix every finding (congratulations), you disable the gate (don't), or you learn to triage. Triage means &lt;code&gt;.trivyignore&lt;/code&gt; — but treat it like a loaded weapon:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# CVE-2025-12345 — false positive for our usage, we don't call that code path
# reviewed 2026-11-14 by faizan, revisit on next base image bump
CVE-2025-12345
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two rules I enforce on myself: every ignored CVE gets a comment explaining &lt;em&gt;why&lt;/em&gt; and &lt;em&gt;when to revisit&lt;/em&gt;, and the ignore file gets audited monthly. An uncommented CVE in that file is how eight-month-old vulnerabilities end up in production.&lt;/p&gt;

&lt;p&gt;Also set realistic expectations with &lt;code&gt;--severity&lt;/code&gt;. Start with &lt;code&gt;HIGH,CRITICAL&lt;/code&gt; as the gate and let &lt;code&gt;MEDIUM&lt;/code&gt; be visible-but-nonblocking; going straight to "zero findings including LOW" is how teams end up disabling the whole thing in frustration.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part most people miss: it's not just images
&lt;/h2&gt;

&lt;p&gt;Trivy scans three other things, and two of them matter more than images for most teams:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Misconfigured infrastructure:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;trivy config .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Point it at a directory of Terraform, Kubernetes manifests, or Dockerfiles and it flags misconfigurations — containers running as root, missing resource limits, wide-open security contexts, S3 buckets that rhyme with "public." This is the cheapest compliance win I know of: no agents, no cloud permissions, just YAML judgment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Secrets in the repo:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;trivy fs --scanners secret .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It catches committed AWS keys, private keys, and the usual suspects. Pair it with a pre-commit hook so the secret never lands in history at all — rotating a key that was committed for four minutes is a worse afternoon than it sounds.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Filesystem scans on hosts&lt;/strong&gt; (&lt;code&gt;trivy fs&lt;/code&gt;) work for scanning a server after the fact, which I've used more than once during &lt;a href="https://clinerds.com/article/new-linux-server-first-30-minutes" rel="noopener noreferrer"&gt;first-30-minutes hardening&lt;/a&gt; on a box I didn't build.&lt;/p&gt;

&lt;h2&gt;
  
  
  Generate an SBOM while you're at it
&lt;/h2&gt;

&lt;p&gt;One command turns your image into a Software Bill of Materials:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;trivy image --format cyclonedx --output sbom.json myapp:1.4.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a customer, auditor, or future-you ever asks "what's actually in this image," the answer is a file, not an archaeology project. CycloneDX format slots into dependency-track and similar tools if you ever go further.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest catch
&lt;/h2&gt;

&lt;p&gt;Scanners find known vulnerabilities in packages. They will not find your application-level bugs, your overly permissive IAM policy, or the SSH key your intern committed in a &lt;em&gt;different&lt;/em&gt; repo. Trivy in CI is a seatbelt, not a self-driving car — but it's a seatbelt that takes thirty minutes to install and has saved me from shipping a critical OpenSSL CVE more than once.&lt;/p&gt;

&lt;p&gt;Ship the gate first. Worry about the rest of the DevSecOps checklist after the pipeline stops you from doing something dumb automatically — that's the whole point of automation.&lt;/p&gt;

</description>
      <category>devsecops</category>
      <category>security</category>
      <category>docker</category>
      <category>devops</category>
    </item>
    <item>
      <title>Kubernetes Cookbook Part 11: Network Policies, the Firewall You Forgot to Turn On</title>
      <dc:creator>FlatlinerAtheist | CLI-NERDS</dc:creator>
      <pubDate>Mon, 16 Nov 2026 06:16:46 +0000</pubDate>
      <link>https://dev.to/clinerds/kubernetes-cookbook-part-11-network-policies-the-firewall-you-forgot-to-turn-on-53h4</link>
      <guid>https://dev.to/clinerds/kubernetes-cookbook-part-11-network-policies-the-firewall-you-forgot-to-turn-on-53h4</guid>
      <description>&lt;p&gt;Here's a scenario that should make you uncomfortable: in a default Kubernetes cluster, every pod can talk to every other pod. Your public-facing web app can reach the database directly. A random test container can poke the kubelet. If one pod gets compromised — and one will, eventually — the attacker lands in a network with zero internal walls.&lt;/p&gt;

&lt;p&gt;Kubernetes has a built-in answer, and almost nobody turns it on: &lt;strong&gt;NetworkPolicy&lt;/strong&gt;. It's a firewall for your pods, declared the same way you declare everything else. This is Part 11 of the &lt;a href="https://clinerds.com/article/kubernetes-cookbook-local-cluster" rel="noopener noreferrer"&gt;Kubernetes Cookbook&lt;/a&gt; — and it's the one I wish I'd read before my first cluster grew past three apps.&lt;/p&gt;

&lt;h2&gt;
  
  
  The mental model: allow-all by default
&lt;/h2&gt;

&lt;p&gt;The most important thing to understand: &lt;strong&gt;NetworkPolicy is opt-in, and doing nothing means allow everything.&lt;/strong&gt; Applying zero network policies is not "no firewall" — it's "firewall with a permanent allow-all rule."&lt;/p&gt;

&lt;p&gt;The moment you apply &lt;em&gt;any&lt;/em&gt; NetworkPolicy to a pod, that pod flips from allow-everything to allow-only-what-the-policy-says. This is the same pattern as &lt;a href="https://clinerds.com/article/kubernetes-cookbook-security-rbac" rel="noopener noreferrer"&gt;RBAC&lt;/a&gt;: Kubernetes never takes permissions away until you explicitly grant scoped ones.&lt;/p&gt;

&lt;p&gt;One critical warning before the YAML: &lt;strong&gt;a NetworkPolicy is only as real as your CNI plugin.&lt;/strong&gt; The API object exists on every cluster, but something has to enforce it — Calico, Cilium, and Weave do; some minimal CNIs silently ignore policies, and your pods stay wide open while you sleep soundly. Check your CNI's docs first. If you're running kind or a bare-metal kubeadm cluster with a minimal CNI, verify enforcement before trusting it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step one: default-deny everything
&lt;/h2&gt;

&lt;p&gt;Start by denying all ingress in a namespace. Nothing changes functionally yet — until you add allow rules, which is exactly the discipline you want:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;networking.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;default-deny-ingress&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;production&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;        &lt;span class="c1"&gt;# applies to EVERY pod in the namespace
&lt;/span&gt;  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Ingress&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;podSelector: {}&lt;/code&gt; matching everything surprises people the first time. An empty selector means "all pods," not "no pods." To verify your CNI actually enforces this, run a quick test — spin up a busybox pod and curl another pod's IP. If the connection still succeeds, your CNI is ignoring policies. Better to learn that now than during an incident.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step two: allow only the traffic you need
&lt;/h2&gt;

&lt;p&gt;Now the useful part. Say you have web → api → database. The web pods should accept traffic from the ingress controller, the api should accept from web only, and the database should accept from api on 5432 only:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;networking.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api-accepts-web-only&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;production&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api&lt;/span&gt;
  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Ingress&lt;/span&gt;
  &lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;web&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8080&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;networking.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;database-accepts-api-only&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;production&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;database&lt;/span&gt;
  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Ingress&lt;/span&gt;
  &lt;span class="na"&gt;ingress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5432&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The beauty here: &lt;code&gt;from&lt;/code&gt; uses the same label selectors you already know from &lt;a href="https://clinerds.com/article/kubernetes-cookbook-deployments" rel="noopener noreferrer"&gt;Deployments&lt;/a&gt; and &lt;a href="https://clinerds.com/article/kubernetes-cookbook-services" rel="noopener noreferrer"&gt;Services&lt;/a&gt;. You're not learning a new identity system — you're pointing at pods the way Kubernetes already points at them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step three: don't forget egress — and DNS
&lt;/h2&gt;

&lt;p&gt;Blocking inbound traffic is half the story. If a compromised pod can still &lt;code&gt;curl&lt;/code&gt; anywhere on the internet, it can exfiltrate data happily. Lock down egress too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;database&lt;/span&gt;
  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Egress&lt;/span&gt;
  &lt;span class="na"&gt;egress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;   &lt;span class="c1"&gt;# still thinking about this one? see below
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's the trap everyone hits — myself included, in the form of a database that mysteriously stopped resolving names: &lt;strong&gt;the moment you add an egress policy, DNS breaks.&lt;/strong&gt; Pods talk to &lt;code&gt;kube-dns&lt;/code&gt; on UDP 53 constantly, and a default-deny egress kills that too. You must explicitly allow DNS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;  &lt;span class="na"&gt;egress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;namespaceSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;kubernetes.io/metadata.name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kube-system&lt;/span&gt;
      &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;k8s-app&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kube-dns&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;53&lt;/span&gt;
      &lt;span class="na"&gt;protocol&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;UDP&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;53&lt;/span&gt;
      &lt;span class="na"&gt;protocol&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;TCP&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;namespaceSelector&lt;/code&gt; + &lt;code&gt;podSelector&lt;/code&gt; combo restricts DNS to the actual kube-dns pods in kube-system — not just "any pod claiming to serve DNS." After that, add your specific egress rules (database → nothing, api → database and external APIs, and so on).&lt;/p&gt;

&lt;h2&gt;
  
  
  How I roll this out without an outage
&lt;/h2&gt;

&lt;p&gt;Don't write default-deny for the whole namespace in week one — you'll spend the weekend debugging why monitoring "randomly" stopped working. This is the order that worked on my clusters:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Observe first.&lt;/strong&gt; Deploy policies in a permissive audit mindset: allow with &lt;code&gt;to: [{}]&lt;/code&gt; / &lt;code&gt;from: [{}]&lt;/code&gt; placeholders, and watch your traffic logs (Cilium has great flow visibility; Calico has flow logs) to learn what actually talks to what.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lock the crown jewels first.&lt;/strong&gt; Database and anything holding secrets get strict ingress policies immediately — they're the highest-value targets and usually have the &lt;em&gt;fewest&lt;/em&gt; legitimate clients.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Egress last, service by service.&lt;/strong&gt; Start with the database (should have almost no egress), then the API tier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep a break-glass path.&lt;/strong&gt; A labeled "ops" namespace with wide-open access, documented in your runbook, saves you at 2 AM.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Common traps, quickly
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;podSelector&lt;/code&gt; is namespace-local.&lt;/strong&gt; A policy selecting pods in namespace A can't reach pods in namespace B with a plain &lt;code&gt;podSelector&lt;/code&gt; — you need &lt;code&gt;namespaceSelector&lt;/code&gt; alone, or combined.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not all CNIs support &lt;code&gt;ipBlock&lt;/code&gt; consistently&lt;/strong&gt;, and cloud load balancer health checks often need CIDR-based exceptions. Test before assuming.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The empty-selector confusion cuts both ways:&lt;/strong&gt; &lt;code&gt;podSelector: {}&lt;/code&gt; = all pods, but a policy with &lt;code&gt;ingress: []&lt;/code&gt; (empty list) = deny all ingress to selected pods. Subtle, brutal difference.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The bottom line
&lt;/h2&gt;

&lt;p&gt;NetworkPolicy is the cheapest security upgrade in Kubernetes: no new tools, no agents, no license — just YAML you could write this afternoon. But it's defense that only exists if your CNI enforces it, and it only works if you actually roll it out. Start with default-deny-ingress on your most sensitive namespace today. The flat network you've been living in is a choice, and it's reversible.&lt;/p&gt;

&lt;p&gt;In Part 12, we'll package all of this up properly with Helm — because copy-pasting eleven parts' worth of YAML by hand is its own kind of outage waiting to happen.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>security</category>
      <category>containers</category>
    </item>
    <item>
      <title>pgvector: Vector Search in PostgreSQL Without a New Database</title>
      <dc:creator>FlatlinerAtheist | CLI-NERDS</dc:creator>
      <pubDate>Tue, 10 Nov 2026 07:06:09 +0000</pubDate>
      <link>https://dev.to/clinerds/pgvector-vector-search-in-postgresql-without-a-new-database-4l8a</link>
      <guid>https://dev.to/clinerds/pgvector-vector-search-in-postgresql-without-a-new-database-4l8a</guid>
      <description>&lt;p&gt;Every few months the industry discovers a new kind of database. This year it's vector databases — specialized stores for embeddings, the numerical fingerprints that power "semantic search," recommendations, and all the AI features landing in every product you use. The pitch is always the same: spin up this new service, sync your data into it, and pay for another always-on thing.&lt;/p&gt;

&lt;p&gt;Before you do that: if you already run PostgreSQL, you probably don't need a new database at all.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/pgvector/pgvector" rel="noopener noreferrer"&gt;pgvector&lt;/a&gt; is a Postgres extension that adds vector types, distance operators, and approximate-nearest-neighbor indexes to the database you're already running. I've now used it in production for semantic search over ~200k documents, and this post is everything I wish someone had told me on day one — the setup, the indexes, and the two traps that cost me a weekend.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem in one paragraph
&lt;/h2&gt;

&lt;p&gt;Classic search matches &lt;em&gt;words&lt;/em&gt;: you type "disk full," you get documents containing "disk full." Semantic search matches &lt;em&gt;meaning&lt;/em&gt;: type "out of storage," and it finds the disk-full article too. Embeddings make this work — you send text to a model, it returns a few hundred floating-point numbers representing the meaning, and texts with similar meanings get similar numbers. Storing and querying those numbers at scale is the whole job. Postgres does it fine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup is insultingly easy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="no"&gt;EXTENSION&lt;/span&gt; &lt;span class="k"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="kt"&gt;vector&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt;        &lt;span class="kt"&gt;bigint&lt;/span&gt; &lt;span class="no"&gt;GENERATED&lt;/span&gt; &lt;span class="no"&gt;ALWAYS&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;title&lt;/span&gt;     &lt;span class="kt"&gt;text&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;body&lt;/span&gt;      &lt;span class="kt"&gt;text&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;embedding&lt;/span&gt; &lt;span class="kt"&gt;vector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1536&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;vector(1536)&lt;/code&gt; matches the output width of OpenAI's &lt;code&gt;text-embedding-3-small&lt;/code&gt; — the most common embedding model and a fine default. Whatever model you pick, the column width must match its output dimension, or inserts will fail loudly.&lt;/p&gt;

&lt;p&gt;Insert and search:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- insert (embedding generated by your app via the provider's API)&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;embedding&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Disk full'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'When df shows 100%...'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'[0.012, -0.034, ...]'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- find the 5 most similar documents to a query embedding&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;embedding&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'[0.011, -0.032, ...]'&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;distance&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;embedding&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'[0.011, -0.032, ...]'&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;&amp;lt;=&amp;gt;&lt;/code&gt; operator is cosine distance — pgvector ships &lt;code&gt;&amp;lt;-&amp;gt;&lt;/code&gt; (L2), &lt;code&gt;&amp;lt;#&amp;gt;&lt;/code&gt; (inner product), and &lt;code&gt;&amp;lt;=&amp;gt;&lt;/code&gt; (cosine). For normalized embeddings, inner product and cosine rank identically, and cosine is the safe default for text search.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part everyone skips: indexes
&lt;/h2&gt;

&lt;p&gt;Without an index, every query is a full table scan with a distance computation per row. Fine at 1,000 rows. Ugly at 100,000. Painful at a million.&lt;/p&gt;

&lt;p&gt;pgvector gives you two approximate index types. Today, you want HNSW:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt;
&lt;span class="k"&gt;USING&lt;/span&gt; &lt;span class="n"&gt;hnsw&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;embedding&lt;/span&gt; &lt;span class="n"&gt;vector_cosine_ops&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ef_construction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;HNSW (Hierarchical Navigable Small World) is a graph index — fast to query, great recall, and it doesn't require the data to be present at creation time. The older ivfflat index needs a representative dataset &lt;em&gt;before&lt;/em&gt; you build it, or its clusters are garbage; that requirement surprises people exactly once. Just use HNSW.&lt;/p&gt;

&lt;p&gt;Two knobs matter at query time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;hnsw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ef_search&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;-- higher = better recall, slower&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Default &lt;code&gt;ef_search&lt;/code&gt; is 40, which is a good starting point. If results feel wrong, raise it before you touch anything else. Accuracy problems are almost always recall problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trap #1: the distance threshold nobody agrees on
&lt;/h2&gt;

&lt;p&gt;The query above returns the 5 nearest documents — even if none of them are remotely relevant. Your application needs a cutoff, and here pgvector's docs go silent. There is no universal number because it depends on your embedding model and your data. What worked for me: take 100 queries where you know the right answer, plot the distance of the correct hit, and pick a threshold just past the worst case. Mine landed at &lt;code&gt;0.30&lt;/code&gt; for that model and dataset. Yours will differ. Measure it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trap #2: embeddings generated with different models don't mix
&lt;/h2&gt;

&lt;p&gt;I learned this the expensive way. Early on, I regenerated embeddings with a newer model for &lt;em&gt;some&lt;/em&gt; rows and left others alone. Cosine distance between two different embedding spaces is meaningless — your queries will return confident nonsense from the mismatched rows, intermittently, which is the worst kind of bug. Add a column to record which model produced each embedding, and if you ever switch models, re-embed everything in one pass:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt; &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="k"&gt;COLUMN&lt;/span&gt; &lt;span class="n"&gt;embed_model&lt;/span&gt; &lt;span class="kt"&gt;text&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="s1"&gt;'text-embedding-3-small'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Where do embeddings come from?
&lt;/h2&gt;

&lt;p&gt;Any embedding API works — OpenAI, Voyage, Cohere. But if you've been following along with the &lt;a href="https://clinerds.com/article/ollama-local-llm-cheap-vps" rel="noopener noreferrer"&gt;local LLM setup&lt;/a&gt;, here's the part I find genuinely neat: Ollama runs embedding models locally too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama pull nomic-embed-text
curl http://localhost:11434/api/embeddings -d &lt;span class="s1"&gt;'{"model": "nomic-embed-text", "prompt": "how do I free up disk space"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That returns a 768-dimensional vector — so your &lt;code&gt;vector(...)&lt;/code&gt; column would be &lt;code&gt;vector(768)&lt;/code&gt; for this model — generated on your own hardware, for free, with the text never leaving your network. For a privacy-first stack, local embeddings plus pgvector is a complete semantic search pipeline with zero third parties.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do you actually need a dedicated vector database?
&lt;/h2&gt;

&lt;p&gt;Honest answer: probably not, at your scale. pgvector comfortably handles millions of vectors at single-digit millisecond query times, and it inherits everything Postgres gives you for free — transactions, point-in-time recovery, the &lt;a href="https://clinerds.com/article/postgresql-backup-restore-guide" rel="noopener noreferrer"&gt;backup strategy you already have&lt;/a&gt;, row-level security, and joins with your actual relational data. A dedicated vector store makes sense when you're doing tens of millions of vectors with extreme QPS, or when you need GPU-accelerated indexes. Everything short of that is a second database to run for no reason.&lt;/p&gt;

&lt;p&gt;The pattern I keep returning to: Postgres first, specialize only when Postgres measurably fails you. It has not failed me yet.&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>ai</category>
      <category>database</category>
      <category>opensource</category>
    </item>
    <item>
      <title>HashiCorp Went BSL. I Moved My Secrets to OpenBao.</title>
      <dc:creator>FlatlinerAtheist | CLI-NERDS</dc:creator>
      <pubDate>Tue, 10 Nov 2026 07:05:48 +0000</pubDate>
      <link>https://dev.to/clinerds/hashicorp-went-bsl-i-moved-my-secrets-to-openbao-2bg0</link>
      <guid>https://dev.to/clinerds/hashicorp-went-bsl-i-moved-my-secrets-to-openbao-2bg0</guid>
      <description>&lt;p&gt;Last year I did an infrastructure audit on a side project and found something embarrassing: eleven services, and secrets scattered across all of them. Database passwords in environment files with world-readable permissions, an API key pasted into a systemd unit, another one sitting in a commented-out line of an old compose file like a landmine.&lt;/p&gt;

&lt;p&gt;So I did the responsible thing and reached for HashiCorp Vault — the industry standard, the thing everyone puts on their résumé. And then I read the license again. Vault is BUSL now, the Business Source License. Not open source. Usable today, maybe, but the terms can change again tomorrow, and we've watched that movie before with Redis, Terraform, and Elastic.&lt;/p&gt;

&lt;p&gt;That's how I ended up at OpenBao. It took one afternoon to migrate, and it's been running quietly ever since. Here's the whole story, including the part where I explain what OpenBao actually is, because almost nobody outside the infra world has heard of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What OpenBao is (and why it exists)
&lt;/h2&gt;

&lt;p&gt;When HashiCorp relicensed Vault under the BSL, the community response was the Linux Foundation forking the last open-source codebase and continuing it under the original MPL-2.0 license. The fork is called &lt;a href="https://openbao.org" rel="noopener noreferrer"&gt;OpenBao&lt;/a&gt;, it's governed by a foundation rather than a single vendor, and the API is deliberately compatible with Vault. The CLI is even called &lt;code&gt;bao&lt;/code&gt; instead of &lt;code&gt;vault&lt;/code&gt;, which is a small touch I find charming — like the project politely declining to keep the brand's last name.&lt;/p&gt;

&lt;p&gt;The pitch in one sentence: &lt;em&gt;everything Vault CE did, OpenBao still does, under a license that can't be taken back.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Spin it up in dev mode
&lt;/h2&gt;

&lt;p&gt;The fastest way to see it work is dev mode — single command, in-memory storage, unsealed for you, for experiments only:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run --rm -p 8200:8200 openbao/openbao:latest server -dev -dev-root-token-id=root
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then in another terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;BAO_ADDR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://127.0.0.1:8200
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;BAO_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;root

bao secrets &lt;span class="nb"&gt;enable&lt;/span&gt; -path=secret kv-v2
bao kv put secret/myapp db-password=&lt;span class="s1"&gt;'s3cret!'&lt;/span&gt; api-key=&lt;span class="s1"&gt;'abc123'&lt;/span&gt;
bao kv get secret/myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There it is — your first secret out of the plaintext file and into something that encrypts at rest, audits every access, and hands out scoped tokens instead of the master key.&lt;/p&gt;

&lt;h2&gt;
  
  
  The real deployment
&lt;/h2&gt;

&lt;p&gt;Dev mode is a demo. Production looks more like this in compose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;openbao&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;openbao/openbao:latest&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;server&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"127.0.0.1:8200:8200"&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./bao-config.hcl:/openbao/config/config.hcl:ro&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;openbao-data:/openbao/data&lt;/span&gt;
    &lt;span class="na"&gt;cap_add&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;IPC_LOCK&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;

&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;openbao-data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With a minimal config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="n"&gt;storage&lt;/span&gt; &lt;span class="s2"&gt;"raft"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;path&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"/openbao/data"&lt;/span&gt;
  &lt;span class="n"&gt;node_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"node1"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;listener&lt;/span&gt; &lt;span class="s2"&gt;"tcp"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;address&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"0.0.0.0:8200"&lt;/span&gt;
  &lt;span class="n"&gt;tls_disable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="n"&gt;tls_cert_file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"/openbao/config/tls.crt"&lt;/span&gt;
  &lt;span class="n"&gt;tls_key_file&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"/openbao/config/tls.key"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;api_addr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://bao.mydomain.com:8200"&lt;/span&gt;
&lt;span class="n"&gt;cluster_addr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://127.0.0.1:8201"&lt;/span&gt;
&lt;span class="n"&gt;ui&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bind to localhost, put your reverse proxy in front for TLS — same pattern as &lt;a href="https://clinerds.com/article/self-hosted-docker-compose-stack" rel="noopener noreferrer"&gt;everything else we self-host&lt;/a&gt;. &lt;code&gt;IPC_LOCK&lt;/code&gt; matters; without it Bao can't lock memory and will warn you every boot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Init and unseal — the part that scares people
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;bao operator init&lt;/code&gt; once. You get back &lt;strong&gt;five unseal keys and a root token&lt;/strong&gt;, printed once, never again. This is Vault's famous (and infamous) design, unchanged in the fork: the master key is split via Shamir's secret sharing, and a threshold of key shares (default 3 of 5) is required to unseal after every restart.&lt;/p&gt;

&lt;p&gt;It's operationally annoying and cryptographically sound. My five shares live in different places — two with me, one in a password manager, one offline, one with a trusted friend who runs infrastructure and understands the ceremony. The root token goes in the password manager and never into an application.&lt;/p&gt;

&lt;p&gt;For day-to-day unsealing on a single-node home setup, you can configure an &lt;a href="https://openbao.org/docs/configuration/seal/" rel="noopener noreferrer"&gt;auto-unseal&lt;/a&gt; against a cloud KMS, or accept a manual &lt;code&gt;bao operator unseal&lt;/code&gt; after reboots like I do. My server reboots maybe four times a year. Typing three key shares four times a year is a fine price for secrets that stay encrypted even if the disk walks away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Migrating from Vault: easier than expected
&lt;/h2&gt;

&lt;p&gt;Because OpenBao kept the API compatible, migration is mostly renaming:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Environment variables: &lt;code&gt;VAULT_ADDR&lt;/code&gt; → &lt;code&gt;BAO_ADDR&lt;/code&gt;, &lt;code&gt;VAULT_TOKEN&lt;/code&gt; → &lt;code&gt;BAO_TOKEN&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;CLI: &lt;code&gt;vault kv ...&lt;/code&gt; → &lt;code&gt;bao kv ...&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;SDKs: the Go SDK paths carry over with the endpoint swapped&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I stood up OpenBao alongside my Vault instance, restored from a Raft snapshot, walked every service to new short-lived tokens, and shut Vault down a week later when the logs stayed quiet. The whole thing took an afternoon plus that week of paranoia. If you're coming from a fresh start rather than a migration, it's even simpler — there's nothing to translate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Should &lt;em&gt;you&lt;/em&gt; bother?
&lt;/h2&gt;

&lt;p&gt;Depends where your secrets live right now. If they're in &lt;code&gt;.env&lt;/code&gt; files and you have fewer than five services, the honest answer is: fix your file permissions first, then come back. OpenBao earns its keep when you have many services, many humans, or compliance reasons to want audit logs and per-service tokens with TTLs.&lt;/p&gt;

&lt;p&gt;And if you're choosing between Vault CE and OpenBao for a &lt;em&gt;new&lt;/em&gt; deployment — that one's easy. Same software, same skills, same API, but one of them can't have its license pulled out from under you in three years. I've been burned by that pattern enough times to stop volunteering for it.&lt;/p&gt;

&lt;p&gt;The boring, invisible, encrypts-your-secrets-and-audits-everything tool is exactly what infrastructure should be. OpenBao is that, minus the licensing asterisk. Set it up once, and your future 2 AM self — the one debugging why the app can't reach its database — will at least know where the password lives.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>security</category>
      <category>opensource</category>
      <category>vault</category>
    </item>
    <item>
      <title>Run AI Locally: Ollama on a Cheap VPS, No GPU Needed</title>
      <dc:creator>FlatlinerAtheist | CLI-NERDS</dc:creator>
      <pubDate>Tue, 10 Nov 2026 07:05:28 +0000</pubDate>
      <link>https://dev.to/clinerds/run-ai-locally-ollama-on-a-cheap-vps-no-gpu-needed-2f5j</link>
      <guid>https://dev.to/clinerds/run-ai-locally-ollama-on-a-cheap-vps-no-gpu-needed-2f5j</guid>
      <description>&lt;p&gt;My monthly AI bill crossed ₹4,000 last quarter, and I couldn't point at a single thing I had to show for it. Chat subscriptions, API credits for little scripting experiments, a writing assistant I used twice. Renting intelligence, one invoice at a time.&lt;/p&gt;

&lt;p&gt;So I did what I always do when a subscription annoys me: I tried to self-host it. And it turns out you can run genuinely useful language models on a cheap VPS with &lt;strong&gt;no GPU at all&lt;/strong&gt; — not fast, not frontier, but good enough for a surprising number of daily tasks, private, and priced at whatever you're already paying for the server.&lt;/p&gt;

&lt;p&gt;Here's the honest version of that experiment, including where it falls flat.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "no GPU" actually gets you
&lt;/h2&gt;

&lt;p&gt;The mental model that holds everything together: a 3-billion-parameter model quantized to 4-bit fits comfortably in ~2 GB of RAM and runs fine on a modern CPU. An 8-billion model wants ~5 GB and runs &lt;em&gt;acceptably&lt;/em&gt; — think "patient typing," not ChatGPT snappiness. Past that, without a GPU, you're waiting long enough that you'll stop using it.&lt;/p&gt;

&lt;p&gt;So the realistic tier list for CPU-only:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;3B models (llama3.2:3b, phi3.5, qwen2.5:3b)&lt;/strong&gt; — fast enough for summarizing, reformatting, explaining errors, drafting. My most-used size by far.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;7–8B models (llama3.1:8b, mistral, gemma2)&lt;/strong&gt; — noticeably smarter, noticeably slower. Fine when the answer matters more than the wait.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;13B+&lt;/strong&gt; — technically runs on a big enough box. Practically, you'll make tea.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;RAM is the whole game. A $6–10 VPS with 8 GB is the sweet spot; 4 GB works if you only run 3B models and keep the rest of the box lean.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install: one command, because of course it is
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://ollama.com" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt; has done for local models what Docker did for containers — made the happy path one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -fsSL https://ollama.com/install.sh &lt;span class="o"&gt;|&lt;/span&gt; sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That gives you the &lt;code&gt;ollama&lt;/code&gt; CLI and a systemd service listening on &lt;code&gt;127.0.0.1:11434&lt;/code&gt;. Pull and run a model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama run llama3.2:3b
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First run downloads the weights (a couple of GB), then you're chatting in the terminal. &lt;code&gt;ollama ps&lt;/code&gt; shows what's loaded, &lt;code&gt;ollama rm &amp;lt;model&amp;gt;&lt;/code&gt; frees the disk. The model catalog is huge — run &lt;code&gt;ollama search&lt;/code&gt; on newer versions or browse the site.&lt;/p&gt;

&lt;p&gt;Make it reachable from other machines on your network — and only your network:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo systemctl edit ollama
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="k"&gt;[Service]&lt;/span&gt;
&lt;span class="na"&gt;Environment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"OLLAMA_HOST=0.0.0.0:11434"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sudo systemctl restart ollama
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Warning, and I mean this:&lt;/strong&gt; do not expose port 11434 to the internet. There is no authentication. None. Ollama assumes a trusted network, and the internet is not one. If you want access from outside, put it behind a reverse proxy with TLS and basic auth — we have a full guide on &lt;a href="https://clinerds.com/article/nginx-reverse-proxy-explained" rel="noopener noreferrer"&gt;nginx reverse proxy setup&lt;/a&gt; — or better, wire it into your VPN. I use my existing WireGuard setup; zero new attack surface.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that makes it actually usable: a UI
&lt;/h2&gt;

&lt;p&gt;Chatting in a terminal is fun for exactly one evening. What makes local models part of your daily workflow is &lt;a href="https://github.com/open-webui/open-webui" rel="noopener noreferrer"&gt;Open WebUI&lt;/a&gt; — the friendliest self-hosted LLM frontend going, and it speaks to Ollama natively. One container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run -d -p 3000:8080 \
  --add-host=host.docker.internal:host-gateway \
  -e &lt;span class="nv"&gt;OLLAMA_BASE_URL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;http://host.docker.internal:11434 \
  -v open-webui:/app/backend/data \
  --name open-webui \
  --restart unless-stopped \
  ghcr.io/open-webui/open-webui:main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Point your browser at port 3000 and you're done. Multiple models, chat history, web search, document upload, user accounts — it feels like the hosted products, except the model and your prompts never leave your server.&lt;/p&gt;

&lt;p&gt;If your VPS is already running other containers, this slots into a docker-compose file in about ten lines. Same story as the rest of our self-hosted stack — &lt;a href="https://clinerds.com/article/self-hosted-docker-compose-stack" rel="noopener noreferrer"&gt;the full media server build&lt;/a&gt; uses the same pattern.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where local wins, and where it doesn't
&lt;/h2&gt;

&lt;p&gt;Wins, honestly earned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy.&lt;/strong&gt; Drafts, logs, half-formed thoughts — none of it leaves the box. For a privacy nerd who's been &lt;a href="https://clinerds.com/article/degoogle-android-phone-guide" rel="noopener noreferrer"&gt;deGoogling everything else&lt;/a&gt;, this closes a big gap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flat cost.&lt;/strong&gt; The VPS was already paid for. The marginal cost of a thousand prompts is electricity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No rate limits, no policy drift.&lt;/strong&gt; The model does what it did yesterday and will do tomorrow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Losses, just as honest:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It will not match the frontier.&lt;/strong&gt; Complex reasoning, long multi-step coding tasks, anything requiring current knowledge without RAG — the big hosted models win, and it's not close.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed.&lt;/strong&gt; First token takes a few seconds on CPU for 8B models. You adapt, but you notice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You own the uptime.&lt;/strong&gt; When it's down at 2 AM, that's your 2 AM.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My actual usage settled into a pattern: local for drafting, summarizing, reformatting, and "explain this log line" questions. Hosted for the hard ten percent. That split cut my AI spending by roughly three quarters — the subscription I kept gets used for things that genuinely need it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worth it?
&lt;/h2&gt;

&lt;p&gt;If you're already paying for a VPS and you like owning your tools: absolutely, the evening it takes to set up is paid back within a month. If you'd have to rent a server just for this, do the math against your actual API bill first — and remember the real prize here isn't the money.&lt;/p&gt;

&lt;p&gt;Every year there's a new must-rent service, and every year self-hosting gets easier. When AI stops being cheap — and pricing history says it will — the people who kept a local option warm will shrug and keep working. That's the bet I'm making, and so far it's a good one.&lt;/p&gt;

</description>
      <category>selfhosted</category>
      <category>ai</category>
      <category>docker</category>
      <category>opensource</category>
    </item>
    <item>
      <title>AI Crawlers Are Eating Your Bandwidth: Block, Slow, or Bill Them</title>
      <dc:creator>FlatlinerAtheist | CLI-NERDS</dc:creator>
      <pubDate>Tue, 10 Nov 2026 07:05:07 +0000</pubDate>
      <link>https://dev.to/clinerds/ai-crawlers-are-eating-your-bandwidth-block-slow-or-bill-them-51mn</link>
      <guid>https://dev.to/clinerds/ai-crawlers-are-eating-your-bandwidth-block-slow-or-bill-them-51mn</guid>
      <description>&lt;p&gt;Last month I opened my server metrics expecting the usual flat line and found something else instead: a third of my bandwidth was going to bots. Not Googlebot — I &lt;em&gt;want&lt;/em&gt; Googlebot. These were AI crawlers, and they were hitting my site harder than my actual readers.&lt;/p&gt;

&lt;p&gt;That was the moment I stopped treating robots.txt as a set-it-and-forget-it file. Here's what I found, and exactly what I did about it, because you will want to do it too — this problem is not specific to my little server.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bots nobody invited
&lt;/h2&gt;

&lt;p&gt;Something changed in the last couple of years, and it changed quietly. If you run any website with text on it, you are now part of the largest unpaid data extraction operation in history. The Q3 2026 crawler data is honestly wild: nearly half of identified AI crawler traffic declares itself as training-only, and the share keeps creeping up quarter over quarter. Your blog posts, your tutorials, your carefully written error messages that took an afternoon to debug — all of it is raw material.&lt;/p&gt;

&lt;p&gt;The usual suspects, so you know who to look for in your logs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GPTBot&lt;/strong&gt; — OpenAI's crawler. Actually one of the more polite ones; honors robots.txt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ClaudeBot&lt;/strong&gt; — Anthropic. Polite-ish, but it crawls &lt;em&gt;aggressively&lt;/em&gt; when it decides to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CCBot&lt;/strong&gt; — Common Crawl. The backbone dataset half the internet was trained on.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bytespider&lt;/strong&gt; — ByteDance. Famous for hammering sites at rates that look like a DDoS and infamous for ignoring robots.txt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PerplexityBot&lt;/strong&gt; — comes to answer questions in real time, sends almost no identifiable traffic back to you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amazonbot, cohere-ai, Meta-ExternalAgent&lt;/strong&gt; — the rest of the dinner party.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some of these behave. Several don't. And here's the uncomfortable part: &lt;strong&gt;robots.txt is a polite request, not a lock.&lt;/strong&gt; It works exactly as well as a "please do not enter" sign.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step one: see what you're dealing with
&lt;/h2&gt;

&lt;p&gt;Before changing anything, measure. I grabbed my nginx access log and ran it through GoAccess — we have a full walkthrough in the &lt;a href="https://clinerds.com/article/how-to-analyze-real-time-apache-and-nginx-logs-using-goaccess" rel="noopener noreferrer"&gt;real-time log analysis article&lt;/a&gt;, but the short version is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;goaccess /var/log/nginx/access.log -o report.html --log-format=COMBINED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sort by bandwidth. The AI crawlers will be sitting there in the top ten, often above real referrers. Do this once and you will never unsee it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step two: robots.txt, for the ones that listen
&lt;/h2&gt;

&lt;p&gt;Keep robots.txt — some crawlers genuinely honor it, and it's a signal of your intent if you ever need to argue about it. Mine currently looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User-agent: GPTBot
Disallow: /

User-agent: CCBot
Disallow: /

User-agent: Bytespider
Disallow: /

User-agent: Amazonbot
Disallow: /

User-agent: cohere-ai
Disallow: /

User-agent: Google-Extended
Disallow: /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note what I allow: Googlebot, Bing, ClaudeBot, PerplexityBot. I made a deliberate choice to stay in search indexes and AI answer engines — being findable is how this site gets readers. I only block the pure training crawlers. That's my line; yours might be different, and it should be a &lt;em&gt;decision&lt;/em&gt;, not an accident.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step three: the lock — nginx doesn't negotiate
&lt;/h2&gt;

&lt;p&gt;For the bots that ignore the sign on the door, you enforce at the front door. In nginx, a &lt;code&gt;map&lt;/code&gt; in the http block, then one &lt;code&gt;if&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="c1"&gt;# /etc/nginx/conf.d/ai-bots.conf (or inside http {} in nginx.conf)
&lt;/span&gt;&lt;span class="k"&gt;map&lt;/span&gt; $&lt;span class="n"&gt;http_user_agent&lt;/span&gt; $&lt;span class="n"&gt;ai_bot&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;~*&lt;/span&gt;&lt;span class="nc"&gt;GPTBot&lt;/span&gt;        &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;~*&lt;/span&gt;&lt;span class="nc"&gt;ClaudeBot&lt;/span&gt;     &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;~*&lt;/span&gt;&lt;span class="nc"&gt;CCBot&lt;/span&gt;         &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;~*&lt;/span&gt;&lt;span class="nc"&gt;Bytespider&lt;/span&gt;    &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;~*&lt;/span&gt;&lt;span class="nc"&gt;PerplexityBot&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;~*&lt;/span&gt;&lt;span class="nc"&gt;Amazonbot&lt;/span&gt;     &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;~*&lt;/span&gt;&lt;span class="n"&gt;cohere&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ai&lt;/span&gt;     &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then in the &lt;code&gt;server {}&lt;/code&gt; block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;$&lt;span class="n"&gt;ai_bot&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;429&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;429 Too Many Requests&lt;/code&gt; is deliberate. A hard &lt;code&gt;403&lt;/code&gt; tells them the resource exists but is forbidden; &lt;code&gt;429&lt;/code&gt; reads as "back off," and some crawler schedulers will actually reduce revisit frequency. Bytespider will not care either way, but it costs you almost nothing to serve a 429 — a blocked request is a few bytes instead of a full page crawl.&lt;/p&gt;

&lt;p&gt;One warning: match user agents carefully. &lt;code&gt;~*ClaudeBot&lt;/code&gt; matches any UA containing that string — which is fine, because legitimate Anthropic crawlers identify exactly that way, and nobody else has business using it. Don't write loose patterns like &lt;code&gt;~*bot&lt;/code&gt; or you'll block Googlebot and nuke your search presence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step four (optional, and my favorite): send them an invoice
&lt;/h2&gt;

&lt;p&gt;Blocking felt good for about a day. Then I realized the absurdity of the situation: these companies are extracting value from my server, on my electricity, and their end product is a chatbot that tells people not to visit my site. So I went one step further.&lt;/p&gt;

&lt;p&gt;AI crawlers that hit my site now get served a &lt;code&gt;402 Payment Required&lt;/code&gt; page — a proper, styled page with a payment link, explaining that training access costs money and here's where to buy a license. It's a statement more than a business model. Not one of them has paid, shockingly. But the 402 sits in my logs like a tiny act of defiance, and every now and then a human finds the page, laughs, and shares it. That has driven more real traffic than any AI crawler ever sent me.&lt;/p&gt;

&lt;p&gt;You can do this by pointing the &lt;code&gt;return&lt;/code&gt; at a named location with a small HTML page, or just for fun:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;$&lt;span class="n"&gt;ai_bot&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;402&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What I'd do differently next time
&lt;/h2&gt;

&lt;p&gt;Start earlier. I ran unprotected for months, and the crawl patterns are sticky — once a training pipeline has your URL in a queue, it retries politely forever. Also, check your CDN/proxy logs if you sit behind Cloudflare: the origin log only shows what got through, and the real picture can be two or three times worse.&lt;/p&gt;

&lt;p&gt;And keep watching the logs quarterly. This ecosystem mutates. New bots appear with new user agents, old ones rebrand. My &lt;code&gt;map&lt;/code&gt; block has grown three entries since I first wrote it, and I expect it to keep growing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bottom line
&lt;/h2&gt;

&lt;p&gt;robots.txt is a suggestion. nginx is a decision. You don't have to fund the AI industry with your server, and you shouldn't — bandwidth you pay for should serve readers, not scrapers. Block the training crawlers, keep the search engines, and if you're feeling theatrical, send the rest an invoice.&lt;/p&gt;

</description>
      <category>security</category>
      <category>nginx</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
    <item>
      <title>SQLite in Production: A Practical Setup with Litestream Backups</title>
      <dc:creator>FlatlinerAtheist | CLI-NERDS</dc:creator>
      <pubDate>Mon, 02 Nov 2026 12:10:13 +0000</pubDate>
      <link>https://dev.to/clinerds/sqlite-in-production-a-practical-setup-with-litestream-backups-2kap</link>
      <guid>https://dev.to/clinerds/sqlite-in-production-a-practical-setup-with-litestream-backups-2kap</guid>
      <description>&lt;p&gt;SQLite often gets dismissed as a toy database, which surprises the many useful applications quietly running on it. For a small service with one application server, it can remove an entire database process, its network configuration, and a surprising amount of operational work.&lt;/p&gt;

&lt;p&gt;The catch is not whether SQLite can store production data. It can. The catch is whether your access pattern fits and whether you can restore it after a bad day. &lt;strong&gt;Litestream&lt;/strong&gt; helps with the second part by continuously replicating SQLite changes to object storage.&lt;/p&gt;

&lt;h2&gt;
  
  
  When SQLite is a sensible production choice
&lt;/h2&gt;

&lt;p&gt;SQLite runs inside your application process and stores the database on local disk. Reads do not cross a network, and writes use ACID transactions. This is excellent for blogs, small SaaS tools, internal apps, and single-node self-hosted services.&lt;/p&gt;

&lt;p&gt;It is less suitable when many application servers must write concurrently, you need horizontal write scaling, or clients require direct network access to the database. PostgreSQL remains the better general answer for those cases. Our &lt;a href="https://clinerds.com/article/mysql-vs-postgresql-2026" rel="noopener noreferrer"&gt;MySQL vs PostgreSQL comparison&lt;/a&gt; covers the server-database side of that decision.&lt;/p&gt;

&lt;p&gt;Choose SQLite because the architecture is genuinely small, not because avoiding PostgreSQL is a goal in itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure it like you mean it
&lt;/h2&gt;

&lt;p&gt;Enable write-ahead logging and a busy timeout when your application opens the database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;PRAGMA&lt;/span&gt; &lt;span class="n"&gt;journal_mode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;WAL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;PRAGMA&lt;/span&gt; &lt;span class="n"&gt;busy_timeout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;PRAGMA&lt;/span&gt; &lt;span class="n"&gt;foreign_keys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;WAL allows readers and a writer to work more comfortably together. A busy timeout tells SQLite to wait briefly when the database is locked instead of immediately failing. Foreign-key enforcement should be enabled per connection because SQLite does not assume you want it.&lt;/p&gt;

&lt;p&gt;Keep the database on a local disk. A network filesystem with weak locking or unreliable flush behavior can corrupt the assumptions SQLite depends on. Also give the application one well-designed write path; throwing dozens of competing writers at a single file is not a scalability strategy.&lt;/p&gt;

&lt;p&gt;Back up uploads and other application data too. Replicating only the database cannot recover files stored beside it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add continuous replication with Litestream
&lt;/h2&gt;

&lt;p&gt;Litestream watches SQLite's WAL and streams changes to an S3-compatible bucket or another supported destination. Install it using the official release instructions, create a private bucket, and give Litestream credentials limited to the backup location it needs.&lt;/p&gt;

&lt;p&gt;Provide credentials through a protected service environment rather than writing them into your application repository. Then run replication as a system service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;litestream replicate /var/lib/myapp/app.db &lt;span class="se"&gt;\&lt;/span&gt;
  s3://your-backup-bucket/myapp/app.db
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command stays running while it replicates. Under systemd or another supervisor, configure it to start with the application host and restart on failure. Monitor replication errors and object-storage access; a silently stopped backup process is just an expensive source of false confidence.&lt;/p&gt;

&lt;p&gt;Keep retention for older snapshots where your storage setup supports it. Replication faithfully copies the current state, including a mistaken &lt;code&gt;DELETE&lt;/code&gt;, so point-in-time recovery options matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practice the restore before you need it
&lt;/h2&gt;

&lt;p&gt;Stop the application or restore onto a separate test machine. Do not experiment on the only live database file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;litestream restore &lt;span class="nt"&gt;-o&lt;/span&gt; /var/lib/myapp-restored/app.db &lt;span class="se"&gt;\&lt;/span&gt;
  s3://your-backup-bucket/myapp/app.db
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the restored file and open it with the application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sqlite3 /var/lib/myapp-restored/app.db &lt;span class="s1"&gt;'PRAGMA integrity_check;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then verify real records, not just that a file appeared. A restore drill should include starting the app, signing in, and reading recent data.&lt;/p&gt;

&lt;p&gt;Remember that continuous replication has a small recovery window: changes after the last successfully replicated update may be lost. Measure it instead of promising zero data loss.&lt;/p&gt;

&lt;h2&gt;
  
  
  Boring can be a feature
&lt;/h2&gt;

&lt;p&gt;SQLite plus Litestream gives a single-node application a local database and an off-box recovery path without running a separate database cluster. That is a genuinely useful production architecture for the right workload.&lt;/p&gt;

&lt;p&gt;Know the single-writer limits, keep backups off the machine, and rehearse recovery. If the application eventually needs multiple write nodes or heavy concurrent writes, migrate deliberately. Until then, one reliable file and a tested restore may be all the database infrastructure you need.&lt;/p&gt;

</description>
      <category>database</category>
      <category>sqlite</category>
      <category>litestream</category>
      <category>backups</category>
    </item>
    <item>
      <title>pgvector for Beginners: Add Semantic Search to PostgreSQL</title>
      <dc:creator>FlatlinerAtheist | CLI-NERDS</dc:creator>
      <pubDate>Mon, 02 Nov 2026 12:09:53 +0000</pubDate>
      <link>https://dev.to/clinerds/pgvector-for-beginners-add-semantic-search-to-postgresql-4i4h</link>
      <guid>https://dev.to/clinerds/pgvector-for-beginners-add-semantic-search-to-postgresql-4i4h</guid>
      <description>&lt;p&gt;You already have PostgreSQL, backups, and a team that knows how to operate them. Then a new feature asks for semantic search, and suddenly the architecture diagram grows a separate vector database. For many applications, that extra system is unnecessary. &lt;strong&gt;pgvector&lt;/strong&gt; adds vector storage and similarity search to PostgreSQL itself.&lt;/p&gt;

&lt;p&gt;That means embeddings can live beside the documents, users, and permissions they belong to — with normal transactions, joins, and backups.&lt;/p&gt;

&lt;h2&gt;
  
  
  What an embedding does
&lt;/h2&gt;

&lt;p&gt;An embedding model turns text, an image, or another input into a list of numbers. Similar inputs tend to produce vectors that are close together in the model's mathematical space.&lt;/p&gt;

&lt;p&gt;A keyword search for “database keeps running out of connections” might not match a paragraph about “connection pool exhaustion.” Semantic search can, because it compares meaning represented by embeddings rather than exact words.&lt;/p&gt;

&lt;p&gt;The model matters. Store the model name with your data, use the same model for documents and queries, and expect to regenerate embeddings when changing models.&lt;/p&gt;

&lt;h2&gt;
  
  
  A tiny pgvector example
&lt;/h2&gt;

&lt;p&gt;Use a PostgreSQL distribution with pgvector installed, or try the project's Docker image. Enable the extension once per database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="n"&gt;EXTENSION&lt;/span&gt; &lt;span class="n"&gt;IF&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;EXISTS&lt;/span&gt; &lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This table uses three dimensions so the example stays readable. Real models usually produce hundreds or thousands; the declared size must match your model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="n"&gt;bigserial&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="nb"&gt;text&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;embedding&lt;/span&gt; &lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;embedding&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Postgres connection pool exhausted'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'[0.9,0.1,0.0]'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Configure a reverse proxy'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'[0.0,0.8,0.2]'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Tune PostgreSQL connections'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'[0.8,0.2,0.1]'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find the nearest rows using cosine distance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;embedding&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'[0.85,0.15,0.05]'&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;similarity&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;embedding&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'[0.85,0.15,0.05]'&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;&amp;lt;=&amp;gt;&lt;/code&gt; operator returns cosine distance, so &lt;code&gt;1 - distance&lt;/code&gt; expresses similarity. pgvector also supports L2 distance and inner product; use the metric recommended for your embedding model.&lt;/p&gt;

&lt;p&gt;In application code, pass the query embedding as a parameter. Do not build SQL by concatenating user input.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add an index when exact search becomes slow
&lt;/h2&gt;

&lt;p&gt;Without a vector index, PostgreSQL performs exact nearest-neighbor search. That gives perfect recall and can be completely reasonable for a small table.&lt;/p&gt;

&lt;p&gt;As the data grows, an HNSW index can trade a little recall for faster approximate search:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;documents_embedding_idx&lt;/span&gt;
&lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt;
&lt;span class="k"&gt;USING&lt;/span&gt; &lt;span class="n"&gt;hnsw&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;embedding&lt;/span&gt; &lt;span class="n"&gt;vector_cosine_ops&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The operator class must match the distance operator in your query. Check the plan and timing rather than assuming the index helps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;EXPLAIN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;ANALYZE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;BUFFERS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;embedding&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'[0.85,0.15,0.05]'&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Small tables may still prefer a sequential scan. On large production tables, build indexes concurrently and test recall against exact results. Our guide to &lt;a href="https://clinerds.com/article/postgresql-slow-queries-explain" rel="noopener noreferrer"&gt;debugging PostgreSQL queries with EXPLAIN&lt;/a&gt; explains how to read the plan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep keywords in the picture
&lt;/h2&gt;

&lt;p&gt;Semantic search is not automatically better at everything. Exact error codes, product names, and rare identifiers often work better with keyword search. PostgreSQL full-text search can cover that side, and you can combine keyword and vector rankings for hybrid search.&lt;/p&gt;

&lt;p&gt;You also retain normal relational filters. A search can stay inside a tenant, workspace, or permission boundary without synchronizing access rules into another database. Design and test those filters carefully: approximate indexes and heavy filtering can interact in surprising ways.&lt;/p&gt;

&lt;h2&gt;
  
  
  When pgvector is a good fit
&lt;/h2&gt;

&lt;p&gt;It is a strong default when PostgreSQL is already your primary database, your vector workload fits comfortably on it, and operational simplicity matters. It is especially useful for document search, recommendations, deduplication, and retrieval for AI features.&lt;/p&gt;

&lt;p&gt;A dedicated vector engine may be justified by extreme scale, specialized indexing, or a workload your benchmarks show PostgreSQL cannot handle. Make that decision with real data, not because every AI demo includes another service.&lt;/p&gt;

&lt;p&gt;Start with exact search, measure, and add HNSW when needed. You might discover that the simplest AI infrastructure improvement is using the database you already trust.&lt;/p&gt;

</description>
      <category>database</category>
      <category>postgres</category>
      <category>pgvector</category>
      <category>vectorsearch</category>
    </item>
    <item>
      <title>CrowdSec vs Fail2ban: Practical Brute-Force Protection for Your Server</title>
      <dc:creator>FlatlinerAtheist | CLI-NERDS</dc:creator>
      <pubDate>Mon, 02 Nov 2026 12:09:32 +0000</pubDate>
      <link>https://dev.to/clinerds/crowdsec-vs-fail2ban-practical-brute-force-protection-for-your-server-28a6</link>
      <guid>https://dev.to/clinerds/crowdsec-vs-fail2ban-practical-brute-force-protection-for-your-server-28a6</guid>
      <description>&lt;p&gt;Expose SSH or a website to the internet and the automated login attempts will find it. You do not need to read thousands of failed-password lines by hand, but you do need a sensible way to stop repetitive abuse. &lt;strong&gt;Fail2ban&lt;/strong&gt; and &lt;strong&gt;CrowdSec&lt;/strong&gt; both turn suspicious activity into firewall decisions.&lt;/p&gt;

&lt;p&gt;They overlap, but they are not quite the same product.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fail2ban: small, local, and predictable
&lt;/h2&gt;

&lt;p&gt;Fail2ban watches logs, matches patterns called filters, and bans an address through a firewall action when a jail reaches its threshold. It has been doing that job for years, and for a single Linux server that is often exactly what you need.&lt;/p&gt;

&lt;p&gt;On Debian or Ubuntu:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;fail2ban
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create &lt;code&gt;/etc/fail2ban/jail.local&lt;/code&gt; instead of editing the packaged defaults:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[DEFAULT]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="py"&gt;findtime&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;10m&lt;/span&gt;
&lt;span class="py"&gt;maxretry&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;5&lt;/span&gt;
&lt;span class="py"&gt;bantime&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;1h&lt;/span&gt;
&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nn"&gt;[sshd]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="py"&gt;enabled&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart it and inspect the jail:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart fail2ban
&lt;span class="nb"&gt;sudo &lt;/span&gt;fail2ban-client status sshd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adjust the backend only if your distribution does not read SSH logs correctly. Test from a system you control, and keep an active root or console session while changing firewall behavior so a bad rule cannot lock you out completely.&lt;/p&gt;

&lt;p&gt;Fail2ban is easy to reason about: this log, this pattern, this threshold, this ban. It does not require a central account or a crowd to be useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  CrowdSec: behavior detection plus shared intelligence
&lt;/h2&gt;

&lt;p&gt;CrowdSec also parses logs and detects behavior locally. Its architecture separates the detection engine from &lt;strong&gt;bouncers&lt;/strong&gt;, which enforce decisions in a firewall, reverse proxy, or another layer.&lt;/p&gt;

&lt;p&gt;That split is useful when you want one place to detect abuse and another to block it. CrowdSec can also consume community intelligence about addresses exhibiting malicious behavior elsewhere, while sharing signals according to its configuration. Treat that as an additional data source, not as proof that every listed address attacked you personally.&lt;/p&gt;

&lt;p&gt;Typical inspection commands are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;cscli alerts list
&lt;span class="nb"&gt;sudo &lt;/span&gt;cscli decisions list
&lt;span class="nb"&gt;sudo &lt;/span&gt;cscli metrics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The metrics view is particularly important: it shows which log sources are being read and which parsers are working. Installing a security agent without confirming that it parses your actual logs creates comforting dashboards and very little protection.&lt;/p&gt;

&lt;p&gt;Use the official installation documentation for your distribution, install the relevant collections for SSH or your web server, and add a firewall bouncer. Then generate a harmless test event or use CrowdSec's testing facilities rather than attacking your own public endpoint.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which one should you choose?
&lt;/h2&gt;

&lt;p&gt;Choose &lt;strong&gt;Fail2ban&lt;/strong&gt; when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have one or a few servers.&lt;/li&gt;
&lt;li&gt;SSH brute force and a small set of log patterns are the main concern.&lt;/li&gt;
&lt;li&gt;You want minimal moving parts and fully local decisions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Choose &lt;strong&gt;CrowdSec&lt;/strong&gt; when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You want a broader scenario ecosystem for web and service abuse.&lt;/li&gt;
&lt;li&gt;Detection and enforcement need to happen in different places.&lt;/li&gt;
&lt;li&gt;Community threat intelligence is valuable to your setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Running both against the same logs is possible, but it also creates overlapping bans and two systems to debug. For a small VPS, pick one and operate it well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Neither tool fixes weak security
&lt;/h2&gt;

&lt;p&gt;An IP ban is a reaction, not an authentication strategy. Disable SSH password login where practical, use keys, keep software updated, and restrict exposed ports. Our &lt;a href="https://clinerds.com/article/how-to-install-and-configure-fail2ban-in-centos-8-prevent-from-bruteforce-attack" rel="noopener noreferrer"&gt;Fail2ban installation guide&lt;/a&gt; and &lt;a href="https://clinerds.com/article/hardening-ssh" rel="noopener noreferrer"&gt;SSH hardening guide&lt;/a&gt; cover those fundamentals.&lt;/p&gt;

&lt;p&gt;Also watch false positives. A shared NAT address can represent many innocent users, and overly aggressive thresholds can ban your own office. Start with conservative rules, review alerts, and know how to unban an address.&lt;/p&gt;

&lt;p&gt;For most home servers, Fail2ban remains a perfectly good answer. For richer web detection and distributed enforcement, CrowdSec earns its extra complexity. The best choice is the one whose logs, decisions, and recovery commands you actually understand.&lt;/p&gt;

</description>
      <category>security</category>
      <category>crowdsec</category>
      <category>fail2ban</category>
      <category>ssh</category>
    </item>
    <item>
      <title>Passkeys Explained: A Practical Move Beyond Passwords</title>
      <dc:creator>FlatlinerAtheist | CLI-NERDS</dc:creator>
      <pubDate>Mon, 02 Nov 2026 12:09:11 +0000</pubDate>
      <link>https://dev.to/clinerds/passkeys-explained-a-practical-move-beyond-passwords-4850</link>
      <guid>https://dev.to/clinerds/passkeys-explained-a-practical-move-beyond-passwords-4850</guid>
      <description>&lt;p&gt;Passwords have two problems that never really go away: people reuse them, and fake login pages are good at stealing them. &lt;strong&gt;Passkeys&lt;/strong&gt; offer a different model. Instead of typing a shared secret into every website, your device proves it holds a private key that belongs to your account.&lt;/p&gt;

&lt;p&gt;That sounds technical, but using one usually feels like unlocking your phone. The important changes happen underneath.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a passkey actually is
&lt;/h2&gt;

&lt;p&gt;When you create a passkey, your device generates a pair of cryptographic keys for that specific site:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;private key&lt;/strong&gt; stays protected by your device or password manager.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;public key&lt;/strong&gt; goes to the website.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At login, the site sends a challenge. Your device signs it with the private key, and the site verifies the signature with the public key. The private key is never sent to the site.&lt;/p&gt;

&lt;p&gt;Your fingerprint, face, or device PIN unlocks access to the key locally. The website does not receive your fingerprint or face scan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why phishing works less well
&lt;/h2&gt;

&lt;p&gt;A password can be typed into the wrong website. A passkey is bound to the site's origin, so a credential created for &lt;code&gt;example.com&lt;/code&gt; is not used on &lt;code&gt;exarnple.com&lt;/code&gt;, no matter how convincing the page looks.&lt;/p&gt;

&lt;p&gt;This removes one of the most reliable tricks in account takeover. It also removes the password database's usual treasure: public keys stored by a service are not reusable login secrets.&lt;/p&gt;

&lt;p&gt;Passkeys do not make malware harmless, protect an already-compromised session, or stop someone from tricking you into approving a different action. They solve a specific problem very well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Synced passkeys and device-bound keys
&lt;/h2&gt;

&lt;p&gt;Many passkeys synchronize through an ecosystem or password manager, making them available on your phone and laptop. Others remain bound to a hardware security key or particular device.&lt;/p&gt;

&lt;p&gt;Synced passkeys are convenient and still use public-key cryptography. Device-bound credentials can be useful for stricter policies, but losing the device matters more. The right choice depends on the account and your recovery plan.&lt;/p&gt;

&lt;p&gt;Before turning passkeys on for an important account:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add them on more than one trusted device where the service supports it.&lt;/li&gt;
&lt;li&gt;Keep a hardware security key or another independent recovery method if possible.&lt;/li&gt;
&lt;li&gt;Store recovery codes somewhere safe and offline.&lt;/li&gt;
&lt;li&gt;Test signing in on a second device before removing an old login method.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Losing every device should not mean losing your digital life.&lt;/p&gt;

&lt;h2&gt;
  
  
  What websites need to implement
&lt;/h2&gt;

&lt;p&gt;Passkeys use the WebAuthn standard and platform authenticators. For developers, the browser API is only half the job. The server must generate unpredictable challenges, verify responses and origins, store credential public keys, and expire challenge state correctly.&lt;/p&gt;

&lt;p&gt;Use a maintained WebAuthn library rather than writing signature verification yourself. Keep the existing account-recovery and session-security controls, require HTTPS, and give users a way to name and revoke credentials.&lt;/p&gt;

&lt;p&gt;A sensible rollout offers passkeys alongside existing sign-in first. Watch successful registrations, sign-ins, and recovery requests before considering whether passwords can become optional. Users with older devices still need a workable path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do passkeys replace password managers?
&lt;/h2&gt;

&lt;p&gt;Not exactly. Many password managers can create and sync passkeys, so the two increasingly work together. You may still have passwords for older sites, SSH keys, encrypted archives, and other secrets. A manager remains useful — and if you want to run one yourself, our &lt;a href="https://clinerds.com/article/vaultwarden-self-hosted-password-manager" rel="noopener noreferrer"&gt;Vaultwarden guide&lt;/a&gt; is a practical starting point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Should you switch?
&lt;/h2&gt;

&lt;p&gt;For accounts that offer passkeys, yes: they are usually easier to use and much harder to phish than a password alone. Start with your email, password manager, cloud accounts, and developer platforms, because those can unlock many other services.&lt;/p&gt;

&lt;p&gt;Just do not confuse “no password” with “no recovery plan.” Add a passkey, add a backup path, and then enjoy typing fewer secrets into boxes.&lt;/p&gt;

</description>
      <category>security</category>
      <category>passkeys</category>
      <category>webauthn</category>
      <category>authentication</category>
    </item>
    <item>
      <title>Caddy vs Nginx: Choosing a Reverse Proxy You Can Actually Maintain</title>
      <dc:creator>FlatlinerAtheist | CLI-NERDS</dc:creator>
      <pubDate>Mon, 02 Nov 2026 12:08:50 +0000</pubDate>
      <link>https://dev.to/clinerds/caddy-vs-nginx-choosing-a-reverse-proxy-you-can-actually-maintain-2hkc</link>
      <guid>https://dev.to/clinerds/caddy-vs-nginx-choosing-a-reverse-proxy-you-can-actually-maintain-2hkc</guid>
      <description>&lt;p&gt;You have an app listening on port &lt;code&gt;3000&lt;/code&gt;, a domain pointed at your server, and one remaining job: put HTTPS in front of it. The two names you will see most often are &lt;strong&gt;Caddy&lt;/strong&gt; and &lt;strong&gt;Nginx&lt;/strong&gt;. Both are excellent reverse proxies. The better choice depends less on benchmark charts than on how you want to operate the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Caddy: HTTPS as the default
&lt;/h2&gt;

&lt;p&gt;Caddy's standout feature is automatic HTTPS. Give it a public domain with correct DNS and reachable ports 80 and 443, and it obtains and renews certificates for you.&lt;/p&gt;

&lt;p&gt;A complete reverse-proxy configuration can be this small:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;blog.example.com

reverse_proxy 127.0.0.1:3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reload it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;caddy reload &lt;span class="nt"&gt;--config&lt;/span&gt; /etc/caddy/Caddyfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the entire mental model: domain in, application behind it, certificate handled. Caddy also makes security-conscious defaults easy to keep because you are not maintaining a separate certificate bot and a pile of TLS boilerplate.&lt;/p&gt;

&lt;p&gt;For a new VPS, a homelab dashboard, or a handful of small applications, this simplicity is a real operational advantage. Fewer lines mean fewer places to make a mistake at midnight.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nginx: control and a huge ecosystem
&lt;/h2&gt;

&lt;p&gt;Nginx needs a little more configuration, but it is everywhere. Most teams already have someone who understands it, and its modules, caching controls, load balancing, and documentation cover almost every edge case.&lt;/p&gt;

&lt;p&gt;An equivalent site looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;blog.example.com&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;proxy_pass&lt;/span&gt; &lt;span class="s"&gt;http://127.0.0.1:3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Host&lt;/span&gt; &lt;span class="nv"&gt;$host&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Real-IP&lt;/span&gt; &lt;span class="nv"&gt;$remote_addr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Forwarded-For&lt;/span&gt; &lt;span class="nv"&gt;$proxy_add_x_forwarded_for&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;X-Forwarded-Proto&lt;/span&gt; &lt;span class="nv"&gt;$scheme&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You then add TLS and HTTP-to-HTTPS redirection, commonly with Certbot or another certificate automation tool. Our &lt;a href="https://clinerds.com/article/nginx-reverse-proxy-explained" rel="noopener noreferrer"&gt;Nginx reverse proxy guide&lt;/a&gt; and &lt;a href="https://clinerds.com/article/lets-encrypt-certbot-auto-renew" rel="noopener noreferrer"&gt;Let's Encrypt renewal guide&lt;/a&gt; walk through those pieces.&lt;/p&gt;

&lt;p&gt;Nginx is a natural choice when you need detailed caching rules, existing include files, specialized modules, or consistency with infrastructure your team already runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  The comparison that matters
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Configuration:&lt;/strong&gt; Caddy is shorter for common reverse-proxy and static-site setups. Nginx exposes more of the machinery explicitly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Certificates:&lt;/strong&gt; Caddy automates HTTPS in its normal configuration path. Nginx usually pairs with a separate ACME client.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Familiarity:&lt;/strong&gt; Nginx has an enormous installed base and years of examples. Caddy's documentation and Caddyfile are friendly, but unusual requirements may push you toward its JSON configuration or plugins.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance:&lt;/strong&gt; either can serve a typical blog or application without being the bottleneck. Your app, database, TLS termination pattern, caching, and server size usually matter more. Benchmark your own workload before rewriting a working proxy for a theoretical gain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Operations:&lt;/strong&gt; Caddy reduces routine certificate work. Nginx rewards teams that want precise control and already have proven configuration management.&lt;/p&gt;

&lt;h2&gt;
  
  
  A safe migration path
&lt;/h2&gt;

&lt;p&gt;Do not replace a healthy production proxy on a Friday because a comparison article told you to. Test the new configuration on a separate hostname or VM first.&lt;/p&gt;

&lt;p&gt;For either proxy:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Point a test DNS record at the server and wait for it to resolve publicly.&lt;/li&gt;
&lt;li&gt;Allow only the required web ports through the firewall.&lt;/li&gt;
&lt;li&gt;Check proxy headers so the application sees the real scheme and client address.&lt;/li&gt;
&lt;li&gt;Verify certificate renewal, not just the first certificate issuance.&lt;/li&gt;
&lt;li&gt;Test uploads, long requests, WebSockets if used, and redirect behavior.&lt;/li&gt;
&lt;li&gt;Move production only after a rollback path is clear.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  My practical recommendation
&lt;/h2&gt;

&lt;p&gt;Choose &lt;strong&gt;Caddy&lt;/strong&gt; for a new, straightforward self-hosted service when automatic HTTPS and a short configuration are the priority. Choose &lt;strong&gt;Nginx&lt;/strong&gt; when existing expertise, advanced routing, or a mature configuration already makes it the easier system to maintain.&lt;/p&gt;

&lt;p&gt;The best proxy is not the one with the loudest benchmark. It is the one you can configure correctly, renew automatically, and troubleshoot without dread.&lt;/p&gt;

</description>
      <category>networking</category>
      <category>caddy</category>
      <category>nginx</category>
      <category>reverseproxy</category>
    </item>
  </channel>
</rss>
