<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Stackyard]]></title><description><![CDATA[Stackyard]]></description><link>https://stackyard.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Dec 2026 20:41:19 GMT</lastBuildDate><atom:link href="https://stackyard.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[HTTPS for the first homelab app with Caddy and Uptime Kuma]]></title><description><![CDATA[A new Linux host can run a container in minutes and still be awkward to open from a laptop. The hostname may only work on the server, the app may be…]]></description><link>https://stackyard.hashnode.dev/https-for-the-first-homelab-app-with-caddy-and-uptime-kuma</link><guid isPermaLink="true">https://stackyard.hashnode.dev/https-for-the-first-homelab-app-with-caddy-and-uptime-kuma</guid><category><![CDATA[Caddy]]></category><category><![CDATA[self hosting]]></category><category><![CDATA[Homelab]]></category><category><![CDATA[Uptime-Kuma]]></category><category><![CDATA[Docker]]></category><dc:creator><![CDATA[Stackyard]]></dc:creator><pubDate>Sat, 28 Nov 2026 19:35:31 GMT</pubDate><content:encoded><![CDATA[<p>A new Linux host can run a container in minutes and still be awkward to open from a laptop. The hostname may only work on the server, the app may be listening on every interface, and the browser will complain about TLS. This walk-through uses Caddy 2.11 as a reverse proxy and Uptime Kuma 2 as the first app. The files are in <a href="https://github.com/stackyardhq/stackyard-starter">https://github.com/stackyardhq/stackyard-starter</a>. I made them (Stackyard). The same account also sells a larger Compose pack and a printable guide; this article only uses the free repo.</p>
<h2>What you end up with</h2>
<p>Caddy publishes ports 80, 443 and UDP 443 on the host. Uptime Kuma stays on the Compose network at port 3001. Caddy serves <code>https://kuma.&lt;DOMAIN&gt;</code> and, with the default <code>TLS_MODE=internal</code>, uses its local CA. You install that CA's public root on clients. Kuma's first-run page should then load without a certificate warning.</p>
<p>You need one Linux host, Docker Engine with the Compose plugin (<code>up --wait</code>), and free host ports 80 and 443. A way to resolve <code>kuma.&lt;DOMAIN&gt;</code> — a DNS record or a hosts-file line — is enough for a browser. <code>curl --resolve</code> is enough to test from the Docker host itself.</p>
<h2>Start the stack</h2>
<p>From the <code>compose/</code> directory:</p>
<pre><code class="language-bash">cp -i .env.example .env
# Set DOMAIN to the base name only, for example lab.home.arpa
# Leave TLS_MODE=internal
docker compose up -d --wait
docker compose ps
</code></pre>
<p>On a Debian test host with Docker 26.1 and Compose 5.8, first start took about a minute. Both services reported healthy. Uptime Kuma 2.5.12 then waited on its database setup page.</p>
<h2>Check HTTPS from the Docker host</h2>
<pre><code class="language-bash">host=kuma.lab.home.arpa   # kuma. plus your DOMAIN
docker compose cp caddy:/data/caddy/pki/authorities/local/root.crt ./stackyard-ca.crt

curl --noproxy '*' -sS --resolve "$host:80:127.0.0.1" \
  -o /dev/null -w '%{http_code} %{redirect_url}\n' "http://$host/"

curl --noproxy '*' -fsS --cacert ./stackyard-ca.crt \
  --resolve "$host:443:127.0.0.1" -w '\n' "https://$host/_caddy/health"

curl --noproxy '*' -fsSL --cacert ./stackyard-ca.crt \
  --resolve "$host:443:127.0.0.1" -o /dev/null \
  -w 'Kuma returned HTTP %{http_code} (%{content_type})\n' "https://$host/"
</code></pre>
<p>The results on the test host were a 308 redirect to <code>https://kuma.lab.home.arpa/</code>, the text <code>Caddy is up</code>, and HTTP 200 with <code>text/html</code> from Kuma.</p>
<p>If the CA file is missing or you get a 502, look at <code>docker compose logs --tail=50 caddy kuma</code>.</p>
<h2>Open it in a browser</h2>
<p>Point <code>kuma.&lt;DOMAIN&gt;</code> at the host's LAN address. Copy <code>stackyard-ca.crt</code> to the client and import it as a trusted root in the trust store the browser uses. Share only this public certificate, not Caddy's data directory (that directory also holds the CA private key and is root-owned on a typical run).</p>
<p>Kuma should then show its first-run database chooser. SQLite is enough for a single host. Create the admin account before you consider opening the name on the public internet.</p>
<h2>Add a second name</h2>
<p>Append a site block to <code>compose/caddy/Caddyfile</code>. This answers with a short string so you can test DNS and TLS before adding an app:</p>
<pre><code class="language-caddyfile">notes.{$DOMAIN} {
	import tls-{$TLS_MODE:internal}
	respond "Notes route is ready"
}
</code></pre>
<p>Validate and reload:</p>
<pre><code class="language-bash">docker compose exec -T caddy caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile &amp;&amp;
  docker compose exec -T caddy caddy reload --config /etc/caddy/Caddyfile --adapter caddyfile
</code></pre>
<p>To proxy an app, add it to <code>compose.yaml</code> on the default network and replace the <code>respond</code> line with <code>reverse_proxy notes:8080</code> (use the container port).</p>
<h2>Public certificates</h2>
<p>Create the Kuma admin on the LAN first. Set <code>DOMAIN</code> to a name you control, point public DNS for <code>kuma.&lt;DOMAIN&gt;</code> at the host, and forward TCP 80 and 443 if the host is behind a router. Keep port 80 open for HTTP-01 renewals. Set <code>TLS_MODE=public</code> and run <code>docker compose up -d --wait</code> so Caddy picks up the new environment. Live Let's Encrypt issuance was not tested.</p>
<h2>Backups</h2>
<p>Compose bind-mounts <code>data/kuma/</code>, <code>data/caddy/</code> and <code>data/caddy-config/</code> under <code>compose/</code>. Stop the stack before you archive those directories so Kuma's database is idle. Use <code>sudo tar</code> — Caddy's files are typically root-owned. The archive contains the CA private key; keep it private. A restore is a stop, extract into a clean <code>compose/</code> directory, and <code>docker compose up -d --wait</code>. This backup is unencrypted and takes both services offline. I did not run a full restore drill on the test host.</p>
<h2>The repo, and what is not in it</h2>
<p>The files, a one-page pdfLaTeX lab-report starter, and a first-run screenshot are in <a href="https://github.com/stackyardhq/stackyard-starter">https://github.com/stackyardhq/stackyard-starter</a>, MIT-licensed. A free three-page first-week checklist is at <a href="https://ohellebust.gumroad.com/l/dwggcc">https://ohellebust.gumroad.com/l/dwggcc</a>.</p>
<p>This stack does not include single sign-on or an automated backup tool. If you want Authelia in front of Caddy and a restic backup/restore path that was tested on a fresh unzip, that is the paid Homelab Core Stack: <a href="https://ohellebust.gumroad.com/l/ziqhmh">https://ohellebust.gumroad.com/l/ziqhmh</a>. A 16-page printable troubleshooting guide is at <a href="https://ohellebust.gumroad.com/l/vckaxv">https://ohellebust.gumroad.com/l/vckaxv</a>. A fuller lab-report class, with English and Bokmål examples, is at <a href="https://ohellebust.gumroad.com/l/jahkd">https://ohellebust.gumroad.com/l/jahkd</a>. The free repo is meant to be complete for the smaller job; those packs are optional.</p>
<p>This article was drafted with AI assistance and checked against the Docker run described above.</p>
]]></content:encoded></item></channel></rss>