<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jeffrey Pine Hein</title>
	<atom:link href="https://jphein.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://jphein.com</link>
	<description>Just plain helpful.</description>
	<lastBuildDate>Sat, 21 Nov 2026 06:12:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.5</generator>

<image>
	<url>https://jphein.com/wp-content/uploads/2020/08/jphein-logo-cropped-100x100.png</url>
	<title>Jeffrey Pine Hein</title>
	<link>https://jphein.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">109828812</site>	<item>
		<title>How my booking page got popped, and what I changed</title>
		<link>https://jphein.com/how-my-booking-page-got-popped/</link>
					<comments>https://jphein.com/how-my-booking-page-got-popped/#respond</comments>
		
		<dc:creator><![CDATA[Jeffrey Hein]]></dc:creator>
		<pubDate>Sat, 21 Nov 2026 04:02:20 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<guid isPermaLink="false">https://jphein.com/?p=12551</guid>

					<description><![CDATA[Short version: a booking page I run was compromised within a day of going live, through a known bug I had already been warned about. The attackers walked off with a password that could send and read my email. Here is how it happened, what they did with it, and what I changed so it [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><em>Short version: a booking page I run was compromised within a day of going live, through a known bug I had already been warned about. The attackers walked off with a password that could send and read my email. Here is how it happened, what they did with it, and what I changed so it doesn&#8217;t happen the same way twice.</em></p>



<h2 class="wp-block-heading">The setup</h2>



<p class="wp-block-paragraph">On November 4 I put a self-hosted booking page online for my consulting work, in a hurry: someone had asked that morning to book a call with me that same day, and I wanted a page they could use before the day was out. It runs Cal.com, an open-source scheduling app, in a container I build myself for an ARM server in the cloud. Like most apps of its kind it needs a few secrets to work: a database password, signing keys, a Google OAuth client so it can put bookings on my calendar, and an SMTP login so it can email confirmations.</p>



<p class="wp-block-paragraph">That last one is where I made the mistake that mattered. For the SMTP login I used a Gmail app password for my own address, as a stopgap: the plan was to swap it for a separate sending account, or a narrower credential, once the page was up and the booking was done. An app password is a full-strength credential: it sends mail as you, and it also reads mail as you over IMAP. A booking tool only needs to send. I gave it the whole mailbox, and &#8220;temporary&#8221; lasted exactly as long as it took someone to find it.</p>



<h2 class="wp-block-heading">The bug</h2>



<p class="wp-block-paragraph">The image I built was based on Cal.com&#8217;s docker repository at its v5.9.10 tag. That tag pins the application as a git submodule, and the pinned commit was older than Cal.com&#8217;s own v5.9.10 release. The practical difference: my image shipped Next.js 15.5.4, which carries the vulnerable React Server Components code behind CVE-2025-55182, better known as React2Shell (Next.js tracks its own side of it as CVE-2025-66478). It is an unauthenticated remote code execution bug in App Router deployments: one crafted request and the attacker runs code inside your server. The fixed Next.js is 15.5.7; the built image&#8217;s package manifest said 15.5.4. It is on CISA&#8217;s Known Exploited Vulnerabilities list, and it is being mass-exploited by automated crews scanning the whole internet.</p>



<p class="wp-block-paragraph">I did not get unlucky. I got scanned, like everyone else, and I was the one with the hole.</p>



<h2 class="wp-block-heading">What they did</h2>



<ul class="wp-block-list">
<li><strong>Nov 5, 00:12 UTC</strong>, about a day after go-live: a dropper landed in the container. It installed itself as a fake system service named <code>kworkerd</code> and pulled an encrypted payload from a command-and-control host.</li>
<li><strong>Nov 6, 08:19 UTC</strong>: the app&#8217;s environment was dumped to a file. Database URL, signing keys, the Google OAuth client secret, and that Gmail app password.</li>
<li><strong>Nov 6, 13:46 PST</strong>: an email titled &#8220;SMTP health check&#8221; went out <em>from my own address</em> to a throwaway mailbox. That is a credential checker: a script that logs in with a stolen password and mails itself proof that it works, so the credential can be sold or used later.</li>
</ul>



<p class="wp-block-paragraph">That &#8220;SMTP health check&#8221; sitting in my Sent folder was the tell. I was not looking for it; I noticed a message I had not written. About 30 hours passed between the recorded environment dump and the moment I pulled the page offline, and the exposure may have started earlier, when the container was first compromised.</p>



<h2 class="wp-block-heading">Why my tooling didn&#8217;t save me</h2>



<p class="wp-block-paragraph">This is the part I most wanted to understand, because I <em>have</em> a nightly vulnerability scan across every container I run, and it <em>did</em> flag this. From the first night the booking page existed, the report had a row for CVE-2025-55182. Four things conspired to make that row invisible:</p>



<ol class="wp-block-list">
<li>The daily summary only called out findings that were <em>new</em> since the previous run. The React2Shell row was new exactly once, on a night when two malware false positives got the attention. After that it was part of &#8220;the standing count&#8221;.</li>
<li>The summary folded every known-exploited bug into one number: &#8220;16 KEV on 10 containers&#8221;. An unauthenticated RCE on a public host read the same as a compression-library bug in a container with no network access, which I had consciously accepted while waiting for a vendor fix.</li>
<li>Nobody, me included, triaged the findings one by one. &#8220;0 new&#8221; felt like &#8220;fine&#8221;.</li>
<li>Neither the build nor the deploy checked anything. The image was pushed and started without a scan in the path.</li>
</ol>



<p class="wp-block-paragraph">A detector that fires once and then goes quiet is a detector you will learn to ignore. Mine was working exactly as designed, and the design was wrong.</p>



<h2 class="wp-block-heading">Containment</h2>



<p class="wp-block-paragraph">Once the Sent mail was understood, the order was: take the page offline, cut the container from the network, block the command-and-control address at both the cloud host and my home router, snapshot the container for forensics, dump the database, then rotate. Every credential I identified in that environment was revoked or rotated: the Google OAuth client was deleted and replaced, the app password was revoked, the database and signing keys were regenerated, and the image was rebuilt with the patched Next.js and redeployed only after the rotation.</p>



<p class="wp-block-paragraph">Then the longer tail: a new password and fresh recovery settings on the Google account, sign-out of every session, review of every account that can reset itself by emailing me, and a careful pass through the mailbox itself for anything that should not sit in a third party&#8217;s hands. Three people had booked through the page during those days; their names and email addresses were in the database the attackers could reach, and I am telling each of them directly.</p>



<h2 class="wp-block-heading">What I still don&#8217;t know</h2>



<p class="wp-block-paragraph">Whether anyone actually read my mail. I have evidence of harvesting and of one SMTP test, which is itself a use of the credential; I cannot establish whether the mailbox was read beyond that. Google&#8217;s logs for this edition do not record app-password IMAP sign-ins. &#8220;I can&#8217;t find it&#8221; is not the same as &#8220;it did not happen&#8221;, so I am treating the whole window as if the mailbox was readable, because it was.</p>



<p class="wp-block-paragraph">So I built an instrument: a deliberately vulnerable copy of the same booking app on a throwaway server, with a decoy mailbox and its own throwaway password, logging everything that touched it. Over four days of lure, five different toolkits stole the decoy mail password a combined 425 times. For 87 hours none of them logged in to the decoy mailbox or tried to send mail with it. I checked the instrument against itself: a test login of my own was recorded correctly, so that zero is a measured zero, not a blind one. Twenty minutes before I tore it down, one login from a network none of the earlier visitors had used authenticated over SMTP and sent nothing: a credential checker like the one that left a message in my own Sent folder, and evidence of checking, not of reading. It is a self-hosted decoy rather than a Gmail account, and none of it proves what happened to my own mailbox. What it shows is the shape of these kits: harvest, verify, move on. I am still treating my own window as exposed; I now have a reason, rather than a hope, to think it was not read.</p>



<h2 class="wp-block-heading">What changed</h2>



<ul class="wp-block-list">
<li><strong>Least privilege for mail.</strong> No personal credential goes into a service again. The booking page now sends through a send-only identity with nothing readable behind it, and its calendar access runs as a dedicated account, not mine.</li>
<li><strong>A build gate.</strong> Every image is built once, scanned with a pinned, checksum-verified scanner, cross-checked against the CISA KEV feed, and fails closed if the scan is empty, partial, or stale. Only the scanned image gets pushed.</li>
<li><strong>A deploy gate.</strong> The deploy scripts for my public hosts run that check again before starting a container.</li>
<li><strong>Per-finding triage.</strong> The nightly report now puts every known-exploited bug in a bucket: fixable now, waiting on upstream, no fix yet, or accepted with an expiry date. Anything untriaged leads the report and turns the dashboard red until a human looks at it. Hosts that were never scanned say so instead of reading clean.</li>
<li><strong>Watching Sent.</strong> A mail in my own Sent folder that I did not write is now treated as a security signal: a poll flags it for review within minutes instead of leaving it to be noticed by accident.</li>
</ul>



<h2 class="wp-block-heading">The lessons, in the order I would want someone else to hear them</h2>



<ol class="wp-block-list">
<li>Never hand an app a credential that can do more than the app needs, not even for a day. &#8220;It&#8217;s just for sending email, and I&#8217;ll swap it out later&#8221; is exactly how a full mailbox walks out the door. The narrow credential takes ten minutes to make; make it first.</li>
<li>A version tag on a packaging repository is not the version of the software inside it. Check what actually got built.</li>
<li>A finding you have seen before is still a finding. Summaries that count instead of list will hide the one that matters.</li>
<li>Put the scanner in the path, not beside it. A report nobody has to act on is a report nobody acts on.</li>
<li>Know what your own account looks like from the outside. The thing that caught this was a human reading their Sent folder.</li>
<li>A same-day ask is not a reason to skip the gate. The page went up in hours because one person wanted to book that afternoon; the gate I skipped would have taken minutes. A calendar link in an email would have served them just as well that day.</li>
</ol>



<p class="wp-block-paragraph">I run a lot of infrastructure for a one-person shop, and most of it is automated. The automation did its job here; it reported the bug. What was missing was the part that refuses to let a known-exploited hole sit on a public host for four days without a human saying &#8220;yes, I accept that&#8221;, and the part of me that would have waited an hour before putting something new on the internet for a stranger. Both exist now.</p>



<h2 class="wp-block-heading">Update, November 12: the scanner was right again</h2>



<p class="wp-block-paragraph">Since I wrote the lessons above, my nightly scan, now running against the vulnerability corpus a security friend had recommended, flagged a kernel bug rated critical, with a fix out from Ubuntu. It saw the bug on every host and filed each one into the fix queue with a seven-day deadline. That is exactly what it was built to do, and it was the wrong behaviour for this bug: a critical flaw on a host with public ports got the same calm seven-day row as a low-risk library on a box nobody can reach, and a fixed kernel that was installed but not yet booted was not a finding at all. One public server sat two days with the fix on disk and the old kernel running.</p>



<p class="wp-block-paragraph">So lesson three has a sharper form. Counting findings hides the one that matters; <em>severity without exposure</em> hides it too. The scanner now has to know which of my hosts face the internet, and a critical finding on one of those is an alarm that reaches me, not a row that waits its turn. A kernel update is not done until the fixed kernel is the one running. And I took one more piece of that friend&#8217;s advice: an adversarial reviewer now reads every infrastructure change as it is built, not after it is live.</p>



<p class="wp-block-paragraph"><em>Thanks to the security professional who read the first draft and told me, in so many words, that it should never have been deployed, and to two friends in the guild who had suggested parts of this before I needed them. They were right, and the gates above are their arguments turned into code.</em></p>
]]></content:encoded>
					
					<wfw:commentRss>https://jphein.com/how-my-booking-page-got-popped/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">12551</post-id>	</item>
		<item>
		<title>What the crews did with my decoy: seven days on a honeypot</title>
		<link>https://jphein.com/what-the-crews-did-with-my-decoy/</link>
					<comments>https://jphein.com/what-the-crews-did-with-my-decoy/#respond</comments>
		
		<dc:creator><![CDATA[Jeffrey Hein]]></dc:creator>
		<pubDate>Sun, 15 Nov 2026 14:59:39 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<guid isPermaLink="false">https://jphein.com/?p=12565</guid>

					<description><![CDATA[November 14, 2026. This is the follow-up to How my booking page got popped, and what I changed. That post ends with a question I could not answer: once the attackers had a password that could read my mail, did they read it? I built an instrument to find out. This is what it saw [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><em>November 14, 2026. This is the follow-up to </em><em><a href="/how-my-booking-page-got-popped/">How my booking page got popped, and what I changed</a></em><em>. That post ends with a question I could not answer: once the attackers had a password that could read my mail, did they read it? I built an instrument to find out. This is what it saw in seven days.</em></p>



<h2 class="wp-block-heading">What I set up</h2>



<p class="wp-block-paragraph">Short version: a decoy. A second copy of the same booking app, with the same known bug deliberately left in, on a throwaway cloud server that had nothing of mine on it and no way to reach anything of mine. Then I waited for crews using the same bug to find it, and watched what they did with what they found.</p>



<p class="wp-block-paragraph">The parts, in plain terms:</p>



<ul class="wp-block-list">
<li><strong>The lure.</strong> The vulnerable image, byte for byte the one that had been exploited on my real booking page, running as a fictional &#8220;Appointments Desk&#8221; on its own hostname. Sign-ups off, telemetry off, one fictional admin user.</li>



<li><strong>The bait.</strong> The app&#8217;s configuration held twenty settings shaped exactly like the real ones, with none of the real values: a decoy mail login for a decoy mailbox on a decoy mail server I ran for the purpose, random database and signing keys, a fake Google OAuth client that matches nothing, and a canary: an Amazon cloud access key that belongs to a tripwire service (<a href="https://canarytokens.org/">Canarytokens</a>, free from Thinkst), not to me. Use that key anywhere in the world and I get told where from.</li>



<li><strong>The cage.</strong> The server could not talk to the internet at all, except to the two addresses the original malware had used to fetch its payload and send its loot, and even those were watched. No mail could leave it. Nothing on it pointed at anything I own.</li>



<li><strong>The instruments.</strong> Every command the app ran, every connection in or out, every DNS lookup, every login attempt on the decoy mail server, and the web proxy&#8217;s log, pulled off the box every five minutes to a machine at home. A watcher compared the box against a baseline on each pull and had a kill switch that could cut the server off at the network edge in seconds if anything looked like it was escaping the cage.</li>



<li><strong>The clock.</strong> Seven days from the moment the server was built on November 7, then an automatic teardown that revoked the decoy credentials and destroyed the servers. That happened this afternoon. The lure itself, after reviews and two aborted publishes, was live for the last four of those days.</li>
</ul>



<p class="wp-block-paragraph">Everything above was reviewed by a second, independent model before each step, and the first two attempts to publish the lure were stopped by my own kill switch because a check failed. I would rather be killed by my own safety than leak something real. The lure finally went live on the evening of November 10 and, after one false alarm from the watcher took it down for an hour, stayed up until the teardown.</p>



<h2 class="wp-block-heading">What arrived</h2>



<p class="wp-block-paragraph">The internet found it without any help from me. In the first hour the bare address, before it even had a name, took 974 connection attempts from scanners. Once the name resolved, the traffic sorted itself into four kinds.</p>



<p class="wp-block-paragraph"><strong>Scanners.</strong> The background noise of the public internet: probes for <code>.env</code> files, WordPress APIs, old PHP bugs, Exchange, Jira, git directories. By Friday morning the lure had seen about 2,650 outside requests from more than 316 addresses, and 87 of them were just for <code>.env</code>. One security-research scanner found the bug within six hours of go-live, confirmed it with a harmless check, and presumably listed the host on its public index, which likely brought the next visitors.</p>



<p class="wp-block-paragraph"><strong>The harvester.</strong> Nine hours after go-live, a single carefully built request from an address on Scaleway&#8217;s network exploited the bug and ran a reconnaissance script inside the app. It returned a compact report: what the machine was, and every environment variable the app process could see, 41 of them, including the decoy mail password. It did not drop malware, did not open a shell, did not come back. It was a harvester: take the credentials and move on. Over the week the same kit, recognisable by its request shape and its Python HTTP library, ran from five more addresses on hosting networks in the United States, Germany, Indonesia and Singapore, 141 times in all. By the last day it was running every few minutes.</p>



<p class="wp-block-paragraph"><strong>The credential hunter.</strong> The most interesting visitor. Sixteen hours after go-live, a different crew used the same bug to run real shell commands on the server, 36 of them in five seconds. The commands tell you what they wanted: dump the environment, read every file in the app directory, and then, specifically, go looking for the credential files of AI coding agents: the OpenAI Codex CLI&#8217;s token file and Claude Code&#8217;s settings file. Those files did not exist on the lure. The crew came back on a schedule, every two and a half hours, seventeen times over three days, running the identical kit each time. Then it stopped. Each run read the decoy mail password again. By the end it had read it 272 times without once using it.</p>



<p class="wp-block-paragraph">A fourth kit, from a different European hosting range, arrived on the Friday with a broader shopping list: shell histories, Kubernetes service tokens, cloud credentials, the environment. It read the decoy environment eight times. A fifth, on the final day, read it four more times.</p>



<p class="wp-block-paragraph"><strong>The mail server.</strong> The decoy mailbox sat on its own server, reachable from anywhere, logging every connection. It got what every mail server gets: TLS cipher scans running through every protocol version from SSL 3 up, a relay probe that tried to send mail through it without logging in, three attempts to log in with a plaintext password that the server refused, and a handful of scanners that announce themselves by name before they even say hello. None of that touched the decoy account.</p>



<h2 class="wp-block-heading">Where it came from</h2>



<p class="wp-block-paragraph">Every address that exploited the bug or tried the credentials was registered to a hosting or cloud network rather than a residential provider: Scaleway in France, DigitalOcean in the United States, Contabo in Germany, a Utah-based VPS reseller, Tencent Cloud in Singapore, a fibre provider in Indonesia, and smaller ranges in Romania, Bulgaria, Denmark and the Caribbean. Network ownership says where a machine sits, not who rents it or where the operator is. I am not naming individual addresses: they are rented, they rotate, and the next tenant is not the attacker.</p>



<h2 class="wp-block-heading">Did they use the password?</h2>



<p class="wp-block-paragraph">This is the question the whole instrument was built to answer, so here is the careful version.</p>



<p class="wp-block-paragraph"><strong>For 87 hours, no.</strong> Five different kits stole the decoy mail password a combined 425 times, and in that time the instruments recorded no login to the mailbox and no attempt to send mail with it. I had a positive control for the login path: in the middle of the window I logged in to the decoy mailbox myself from home, and the instruments recorded that login correctly. So the zero is a zero on a path that was proven to record logins, with the usual caveat that a control proves the path it exercised, not every path all week.</p>



<p class="wp-block-paragraph"><strong>Then, twenty minutes before the teardown, yes.</strong> At 3:10 pm Pacific on November 14, something logged in to the decoy mail server over SMTP with the stolen password, from an address on a Danish hosting network that none of the earlier visitors had used. It authenticated successfully and sent nothing. That pattern is consistent with a credential checker, a script that confirms which stolen logins still work; whether the list was sold, shared or simply re-run by the same operator from a new machine, I cannot tell from one login. What I can say is that 87 hours after the first theft the password was tried from somewhere new, and that nothing ever tried to read the mailbox over IMAP.</p>



<p class="wp-block-paragraph"><strong>And the canary sang.</strong> In the same half hour, the tripwire cloud key that had been sitting in the stolen environment all week was reported used twelve times by the tripwire service, from two hosting ranges in Utah and Missouri. At the same moment the lure itself resolved the names of Amazon&#8217;s token service, its secrets manager, its storage service, and Bedrock, Amazon&#8217;s hosted AI-model API. A name lookup is not an API call, and the tripwire tells me the key was presented, not what was asked; but together they say someone took the key from the stolen environment and tried it, from the lure and from their own machines, with AI-model access among the first things on the list. The key can do nothing; it exists to report that it was tried.</p>



<p class="wp-block-paragraph">Put together: the crews working this bug harvest credentials wholesale, and the credentials move. A mail password sat unused for three and a half days and then was tried from a network none of the harvesters had used. A cloud key was tried the same afternoon, with AI services among the names looked up. Nothing read the decoy mailbox.</p>



<h2 class="wp-block-heading">What it cannot tell me</h2>



<p class="wp-block-paragraph">The honest caveat. My real credential was a Gmail app password; the decoy was a login on a small self-hosted mail server. An SMTP check is comparable between the two, and that is the part the decoy caught. But a Gmail credential is a far more valuable prize, the kind that invites someone to download the whole mailbox over IMAP, and a self-hosted decoy is a weaker lure for that specific behaviour. So &#8220;nobody read the decoy mailbox&#8221; is evidence, not proof, about my own. The way to answer the IMAP question properly would be a decoy Gmail account, which needs a phone number to create and is a decision for another day.</p>



<p class="wp-block-paragraph">I also only saw what came through the front door. The crews could have shared the harvested environment with each other out of my sight; the Danish login and the canary hits suggest exactly that. And seven days is seven days. The crew that returned seventeen times on a schedule stopped on day four; I do not know why.</p>



<h2 class="wp-block-heading">What I learned</h2>



<ul class="wp-block-list">
<li><strong>Exploitation is industrial, and the product is credentials.</strong> Nobody defaced anything, nobody mined, nobody persisted. They read the environment and left. The harvesting kits ran unattended, on schedules, from rented machines, and the same bug was hit by at least six distinct toolkits in a week.</li>



<li><strong>AI-agent credentials are now on the shopping list.</strong> One kit&#8217;s first move after the environment dump was to look for Codex and Claude Code token files. If you run coding agents on a server, their credential files are a target with a name.</li>



<li><strong>Stolen credentials are verified later, elsewhere.</strong> Three and a half days of silence meant nothing. The check came from a network that had never touched the lure.</li>



<li><strong>Canary keys work.</strong> A fake cloud key cost nothing, sat quietly for a week, and then told me the minute and the networks from which someone tried it, with AI services among the names the lure looked up at the same moment.</li>



<li><strong>Build tooling can be a defence by accident.</strong> Six of the twenty settings, including the cloud key and the database password, were never captured by the in-process harvester, because the app&#8217;s build system strips undeclared environment variables from the server process. The shell-command kit got them anyway, by reading the process that launches the app. Defence in depth is real, and so are its gaps.</li>



<li><strong>Fail-closed instruments have a cost.</strong> My watcher killed the lure once on a transient network hiccup. I took the false positive, fixed the retry, and put it back. I would make the same trade again.</li>
</ul>



<h2 class="wp-block-heading">What I changed because of it</h2>



<p class="wp-block-paragraph">The booking-page post lists the changes the breach itself forced: least privilege for mail, a build gate that refuses images with known-exploited bugs, a deploy gate, per-finding triage, and a watch on my own Sent folder. The decoy added these:</p>



<ul class="wp-block-list">
<li><strong>No agent credential files on any server.</strong> Coding-agent tokens live on my workstation and in the password manager, never in a home directory on a host that serves the public.</li>



<li><strong>Canary keys wherever they are cheap.</strong> Tripwire credentials now sit in places a harvester would read. A quiet canary costs nothing; a loud one is the earliest warning I have.</li>



<li><strong>Treat harvested-but-unused as used.</strong> If an environment is ever dumped, every credential in it is rotated the same day, whether or not anything has been seen using it. The 87-hour delay is exactly the window in which &#8220;nothing happened yet&#8221; is the wrong conclusion.</li>



<li><strong>Checks that print one line, on a timer.</strong> The week taught me how much I was reading by hand. The nightly scans, the certificate expiries, the edge load, the password-manager state: each now has a scheduled check that prints one line with a number, a time and a verdict, and a page that goes amber when a line is stale. The instrument is only useful if someone, or something, reads it on time.</li>



<li><strong>A documented, rehearsed teardown.</strong> The decoy&#8217;s credentials were revoked and its servers destroyed by a timer, with proof read back, not by someone remembering to do it. That is now the standard for anything I stand up on purpose to be attacked.</li>
</ul>



<p class="wp-block-paragraph">Seven days of cage, four of lure, six toolkits, 425 thefts of a password that opened nothing, one login from Denmark, and a canary that sang. I did not get my answer about my own mailbox, and I probably never will. I did get a very clear picture of who was on the other side of that bug, what they wanted, and how long the quiet lasts before the stolen thing moves. That was worth a week and a few dollars of rented cloud.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jphein.com/what-the-crews-did-with-my-decoy/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">12565</post-id>	</item>
		<item>
		<title>How to Run a Modern Kernel on Ubuntu LTS with the HWE Stack</title>
		<link>https://jphein.com/how-to-run-a-modern-kernel-on-ubuntu-lts-with-the-hwe-stack/</link>
					<comments>https://jphein.com/how-to-run-a-modern-kernel-on-ubuntu-lts-with-the-hwe-stack/#respond</comments>
		
		<dc:creator><![CDATA[Jeffrey Hein]]></dc:creator>
		<pubDate>Sun, 29 Mar 2026 18:11:12 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<guid isPermaLink="false">https://jphein.com/?p=12277</guid>

					<description><![CDATA[If you&#8217;re running Ubuntu LTS and hitting hardware bugs — USB devices crashing, missing driver support, Wi-Fi not working — your first instinct might be to upgrade to the latest Ubuntu release. But there&#8217;s a better option that keeps the stability of LTS while giving you a much newer kernel: the HWE (Hardware Enablement) stack. [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">If you&#8217;re running Ubuntu LTS and hitting hardware bugs — USB devices crashing, missing driver support, Wi-Fi not working — your first instinct might be to upgrade to the latest Ubuntu release. But there&#8217;s a better option that keeps the stability of LTS while giving you a much newer kernel: the <strong>HWE (Hardware Enablement) stack</strong>.</p>



<p class="wp-block-paragraph">I run Ubuntu 24.04 LTS on my daily-driver workstation. It shipped with kernel 6.8. After upgrading to the HWE kernel (6.17), two USB bugs I&#8217;d been fighting for months — one cosmetic, one that required hard reboots — were fixed without changing anything else about my system.</p>



<h2 class="wp-block-heading">What Is the HWE Kernel?</h2>



<p class="wp-block-paragraph">Every Ubuntu LTS release ships with a <strong>GA (General Availability) kernel</strong> — the version that was current when the release was finalized. For Ubuntu 24.04 LTS, that&#8217;s kernel 6.8. This kernel receives security patches for the full 5-year LTS lifecycle, but it doesn&#8217;t get new features, new drivers, or improvements to existing subsystems.</p>



<p class="wp-block-paragraph">The <strong>HWE kernel</strong> is a newer kernel backported from a later Ubuntu release, packaged and tested for your LTS version. Canonical rolls these out roughly every 6 months, following each interim Ubuntu release. You get:</p>



<ul class="wp-block-list">
<li>New and updated hardware drivers</li>



<li>Kernel subsystem improvements (USB, GPU, networking, storage)</li>



<li>Bug fixes that haven&#8217;t been backported to the GA kernel</li>



<li>The same LTS userspace — your libraries, init system, package repos, and everything else stays on 24.04</li>
</ul>



<p class="wp-block-paragraph">Think of it as upgrading the engine in your car without changing anything else. Same dashboard, same seats, same fuel system — just a newer engine that handles the road better.</p>



<h2 class="wp-block-heading">How to Install It</h2>



<p class="wp-block-paragraph">One command:</p>



<pre class="wp-block-code"><code>sudo apt install linux-generic-hwe-24.04</code></pre>



<p class="wp-block-paragraph">Then reboot. That&#8217;s it. Verify with:</p>



<pre class="wp-block-code"><code>$ uname -r
6.17.0-19-generic</code></pre>



<p class="wp-block-paragraph">The GA kernel stays installed as a fallback — you can select it from the GRUB menu (&#8220;Advanced options for Ubuntu&#8221;) if the HWE kernel causes any issues. To go back permanently:</p>



<pre class="wp-block-code"><code>sudo apt install linux-generic
sudo apt remove linux-generic-hwe-24.04</code></pre>



<h2 class="wp-block-heading">What It Fixed for Me</h2>



<p class="wp-block-paragraph">I wrote about the full investigation in <a href="https://jphein.com/?p=12253">The USB Bug Trilogy</a>. Here&#8217;s the short version of what the HWE kernel resolved.</p>



<h3 class="wp-block-heading">Razer Kiyo Pro xHCI Death Spiral — Fixed</h3>



<p class="wp-block-paragraph">My Razer Kiyo Pro webcam (1532:0e05) had a firmware bug that would <strong>crash the entire xHCI USB host controller</strong>, disconnecting every USB device — keyboard, mouse, audio, everything. The only recovery was a hard reboot.</p>



<p class="wp-block-paragraph">On kernel 6.8, a stress test crashed the controller consistently around round 25. I wrote <a href="https://github.com/jphein/kiyo-xhci-fix">three kernel patches</a> and a userspace watchdog to work around it.</p>



<p class="wp-block-paragraph">On kernel 6.17, <strong>the same stress test passes 50/50 rounds with 0ms delay — completely stock, no patches or workarounds applied.</strong> The kernel now does two things the older version didn&#8217;t:</p>



<ol class="wp-block-list">
<li><strong>Automatic LPM disable</strong> — When the Kiyo responds slowly to Link Power Management transitions, the kernel dynamically disables U1 LPM instead of cascading to controller death: <code>Hub-initiated U1 disabled due to long timeout 16800us</code></li>



<li><strong>Improved xHCI error recovery</strong> — Endpoint stalls no longer escalate into controller resets. The error is contained to the device.</li>
</ol>



<p class="wp-block-paragraph">The kernel is now doing at runtime what my <code>USB_QUIRK_NO_LPM</code> patch was trying to do statically — detecting that the device can&#8217;t handle LPM and disabling it automatically.</p>



<h3 class="wp-block-heading">Phantom I/O Wait Counter Leak — Improved</h3>



<p class="wp-block-paragraph">A USB card reader (Genesys Logic 05e3:0751) was causing the kernel&#8217;s <code>procs_blocked</code> counter to leak during the boot-time async SCSI scan, making every monitoring tool report 40-60% iowait when there was actually zero disk I/O happening. On 6.8, the leaked count was 4-6. On 6.17, it dropped to 4 — partial improvement, but the bug is still present. I&#8217;ve filed it as <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2146707">Ubuntu bug #2146707</a>.</p>



<h2 class="wp-block-heading">When to Use HWE vs. GA</h2>



<p class="wp-block-paragraph"><strong>Use HWE when:</strong></p>



<ul class="wp-block-list">
<li>You have hardware that&#8217;s newer than your LTS release (bought a laptop or GPU after the release date)</li>



<li>You&#8217;re hitting driver bugs or missing hardware support</li>



<li>You need kernel subsystem improvements (USB, Bluetooth, Wi-Fi, GPU)</li>



<li>You&#8217;re running a desktop or workstation (Ubuntu Desktop installs HWE by default since 20.04)</li>
</ul>



<p class="wp-block-paragraph"><strong>Stick with GA when:</strong></p>



<ul class="wp-block-list">
<li>You&#8217;re running a production server where maximum stability matters more than hardware support</li>



<li>Your hardware works perfectly on the GA kernel</li>



<li>You rely on out-of-tree kernel modules (DKMS modules) that might not build against newer kernels</li>



<li>You&#8217;re in a regulated environment that requires a specific kernel version</li>
</ul>



<p class="wp-block-paragraph">Note: Ubuntu Desktop has shipped with the HWE kernel by default since 20.04. If you installed from the desktop ISO, you might already be on HWE. Check with <code>dpkg -l | grep linux-generic-hwe</code>.</p>



<h2 class="wp-block-heading">HWE Lifecycle</h2>



<p class="wp-block-paragraph">The HWE kernel follows a rolling update model within the LTS lifecycle:</p>



<figure class="wp-block-table"><table><thead><tr><th>Ubuntu 24.04 LTS</th><th>GA Kernel</th><th>HWE Kernel</th></tr></thead><tbody><tr><td>Release (Apr 2024)</td><td>6.8</td><td>6.8</td></tr><tr><td>24.04.1 (Aug 2024)</td><td>6.8</td><td>6.8</td></tr><tr><td>24.04.2 (Feb 2025)</td><td>6.8</td><td>6.11+</td></tr><tr><td>24.04.3 (Aug 2025)</td><td>6.8</td><td>6.14+</td></tr><tr><td>24.04.4 (Feb 2026)</td><td>6.8</td><td>6.17+</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">The GA kernel stays at 6.8 for the entire 5-year support period. The HWE kernel steps forward every ~6 months, pulling from the next interim release. Both receive security patches.</p>



<h2 class="wp-block-heading">The Tradeoff</h2>



<p class="wp-block-paragraph">There&#8217;s always a tradeoff between newer kernels and stability. A newer kernel means newer code paths that have had less production exposure. In my case, the tradeoff was obvious — a kernel that crashes my entire USB bus on a stock webcam isn&#8217;t &#8220;stable&#8221; in any meaningful sense. The HWE kernel was strictly better.</p>



<p class="wp-block-paragraph">But your situation might be different. If your hardware works fine on the GA kernel, there&#8217;s no reason to chase a newer one. The best kernel is the one that runs your hardware without problems.</p>



<p class="wp-block-paragraph">For me, <code>sudo apt install linux-generic-hwe-24.04</code> turned a webcam that required three kernel patches and a watchdog daemon into one that just works. Sometimes the fix really is that simple.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jphein.com/how-to-run-a-modern-kernel-on-ubuntu-lts-with-the-hwe-stack/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">12277</post-id>	</item>
		<item>
		<title>The USB Bug Trilogy: Phantom I/O, Camera Crashes, and Kernel Accounting Lies</title>
		<link>https://jphein.com/the-usb-bug-trilogy-phantom-i-o-camera-crashes-and-kernel-accounting-lies/</link>
					<comments>https://jphein.com/the-usb-bug-trilogy-phantom-i-o-camera-crashes-and-kernel-accounting-lies/#respond</comments>
		
		<dc:creator><![CDATA[Jeffrey Hein]]></dc:creator>
		<pubDate>Sun, 29 Mar 2026 13:59:54 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<guid isPermaLink="false">https://jphein.com/the-usb-bug-trilogy-phantom-i-o-camera-crashes-and-kernel-accounting-lies/</guid>

					<description><![CDATA[I run a homelab with a dozen VLANs, 20+ monitored hosts, and a desktop workstation that doubles as my daily driver for development and gaming. Over the past few months I&#8217;ve hit four separate USB bugs on Linux that each took hours to diagnose — and they&#8217;re all related to how the Linux kernel handles [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I run a homelab with a dozen VLANs, 20+ monitored hosts, and a desktop workstation that doubles as my daily driver for development and gaming. Over the past few months I&#8217;ve hit four separate USB bugs on Linux that each took hours to diagnose — and they&#8217;re all related to how the Linux kernel handles USB devices. Here&#8217;s what happened, what I learned, and the fixes.</p>



<h2 class="wp-block-heading">Bug 1: The Phantom I/O Wait — A USB Card Reader That Corrupts Kernel Accounting</h2>



<p class="wp-block-paragraph">I noticed my system was reporting 40-60% iowait in <code>top</code> and <code>vmstat</code>, with load averages spiking to 4-5 on an 8-core machine. My NVMe drive should be handling anything I throw at it. Something was wrong.</p>



<p class="wp-block-paragraph">Running <code>iotop</code> showed <strong>zero actual disk I/O</strong>. Not a single byte being read or written. Yet the kernel insisted that processes were blocked waiting on I/O.</p>



<pre><code>$ vmstat 1 3
procs -----------memory---------- ---swap-- -----io---- -system-- -------cpu-------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 1  4      0 7810420 1361964 3957988    0    0     0     0  8303 23388 17  2 61 21  0
 0  4      0 7869484 1361964 3958112    0    0     0     0 12885 18690 13  3 50 35  0</code></pre>



<p class="wp-block-paragraph">The <code>b=4</code> column means 4 processes in uninterruptible sleep (D state). But when I checked:</p>



<pre><code>$ ps -eo pid,state,comm | awk '$2 == "D"'
(nothing)</code></pre>



<p class="wp-block-paragraph">Zero processes in D state. The kernel&#8217;s <code>procs_blocked</code> counter in <code>/proc/stat</code> was stuck at 4, permanently inflating the iowait percentage. Every monitoring tool that reads <code>/proc/stat</code> — <code>top</code>, <code>vmstat</code>, <code>htop</code>, Grafana node_exporter — was showing phantom I/O wait.</p>



<h3 class="wp-block-heading">The Culprit</h3>



<p class="wp-block-paragraph">Initially I blamed a <strong>Genesys Logic USB card reader</strong> (05e3:0751) connected through a VIA Labs USB hub (a KVM-style switch with two upstream ports and a button to toggle between hosts). But after extensive testing, the leak turned out to have <strong>two sources</strong>: the USB card reader AND four empty AHCI/SATA ports (ata3-6) on the motherboard. Both go through the same boot-time async SCSI scan path, and both leak the <code>nr_iowait</code> counter.</p>



<p class="wp-block-paragraph">During boot, each synchronous SCSI probe command goes through <code>blk_execute_rq()</code> → <code>io_schedule_timeout()</code>, which sets <code>current->in_iowait = 1</code> and increments the kernel&#8217;s <code>nr_iowait</code> counter. The matching decrement is missed during the boot-time async scan — leaking one count per command. The counter is stuck until reboot.</p>



<p class="wp-block-paragraph">Critically, unbinding and rebinding the USB card reader after boot triggers the <strong>exact same code path</strong> but does <strong>not</strong> leak — proving the bug is specific to the early boot async scanning environment, not the probe logic itself.</p>



<h3 class="wp-block-heading">What I Tried</h3>



<ul class="wp-block-list">
<li><strong>Kernel upgrade from 6.8 to 6.17</strong> (Ubuntu HWE) — leaked count dropped from 4-6 to 4, partial improvement</li>
<li><strong>Booting with an SD card inserted</strong> — still leaked</li>
<li><strong>Booting without the USB hub</strong> — clean <code>b=0</code>, but the counter leaked as soon as I plugged the hub back in</li>
<li><strong><code>usb-storage.quirks=05e3:0751:i</code></strong> — card reader properly ignored (confirmed in dmesg), but <code>procs_blocked</code> still 4 — the AHCI empty ports also leak</li>
<li><strong><code>scsi_mod.scan=sync</code></strong> — no effect</li>
<li><strong><code>usb-storage.quirks=05e3:0751:u</code></strong> (ignore UAS) — no effect, device doesn&#8217;t support UAS anyway</li>
<li><strong><code>usb-storage.delay_use=10</code></strong> — no effect, the delay just postpones the same buggy probe path</li>
<li><strong><code>libata.force=3:disable,4:disable,5:disable,6:disable</code></strong> — dropped <code>procs_blocked</code> from 4 to 2, confirming AHCI ports as a leak source</li>
</ul>



<h3 class="wp-block-heading">Update: Root Cause Identified via ftrace</h3>



<p class="wp-block-paragraph">Using ftrace with stack traces, I traced the exact code path that leaks the counter. Every SCSI probe command goes through:</p>



<pre><code>io_schedule_timeout
 ← __wait_for_common
  ← wait_for_completion_io_timeout
   ← blk_execute_rq
    ← scsi_execute_cmd
     ← scsi_probe_lun
      ← do_scan_async
       ← async_run_entry_fn</code></pre>



<p class="wp-block-paragraph">The <code>io_schedule_timeout()</code> call sets <code>current->in_iowait = 1</code> and increments the kernel&#8217;s <code>nr_iowait</code> counter. During normal operation, the matching decrement happens when the IO completes. But during the boot-time async SCSI scan, the decrement is missed — leaking one count per probe command.</p>



<p class="wp-block-paragraph">The critical evidence: <strong>unbinding and rebinding the USB card reader after boot triggers the exact same code path but does NOT leak the counter.</strong> This proves the bug is specific to the boot-time async scanning environment, not the probe logic itself.</p>


<p class="wp-block-paragraph"><strong>Update: Two leak sources identified.</strong> Further testing revealed that ignoring the card reader (<code>quirks=:i</code>) still left <code>procs_blocked=4</code> — the four empty AHCI/SATA ports on the motherboard also leak through the same async scan path. Adding <code>libata.force=3:disable,4:disable,5:disable,6:disable</code> dropped the count from 4 to 2, confirming two independent sources. Both the USB and AHCI SCSI probe paths share the same buggy boot-time <code>io_schedule_timeout</code> accounting.</p>



<p class="wp-block-paragraph">I&#8217;ve filed this as <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2146707">Ubuntu bug #2146707</a> with full ftrace data and a suggested diagnostic kernel patch.</p>



<h3 class="wp-block-heading">The Fix</h3>



<p class="wp-block-paragraph">There isn&#8217;t a clean one yet. The <code>procs_blocked</code> counter leak is a kernel bug that persists from at least 6.8 through 6.17. Your options are:</p>



<p class="wp-block-paragraph"><strong>Option 1: Reduce the leak with kernel parameters:</strong></p>



<pre><code># Edit /etc/default/grub, add to GRUB_CMDLINE_LINUX_DEFAULT:
#   usb-storage.quirks=05e3:0751:i        (ignores the card reader)
#   libata.force=3:disable,4:disable,...   (reduces AHCI leak)
# Then regenerate GRUB:
sudo update-grub</code></pre>



<p class="wp-block-paragraph">This won&#8217;t fully eliminate the leak (in my testing it dropped from 4 to 2), but it helps. Disabling unused SATA ports in BIOS may also help.</p>



<p class="wp-block-paragraph"><strong>Option 2: Accept the cosmetic iowait</strong> — <code>iotop</code> is your source of truth for actual I/O activity. The phantom counter doesn&#8217;t affect real performance.</p>



<h3 class="wp-block-heading">Bonus: Re-enabling the Card Reader On Demand</h3>



<p class="wp-block-paragraph">Since the warm reprobe (after boot) doesn&#8217;t leak the counter, you can safely enable the card reader when you need it. The <code>usb-storage.quirks</code> parameter is writable at runtime:</p>



<pre><code>#!/bin/bash
# card-reader.sh — toggle Genesys Logic card reader on/off
# Boot uses quirks=:i to prevent the phantom iowait bug.
# Warm reprobe after boot is safe — does NOT leak the counter.

VENDOR="05e3"
PRODUCT="0751"

find_device() {
    for dev in /sys/bus/usb/devices/*; do
        [ "$(cat "$dev/idVendor" 2>/dev/null)" = "$VENDOR" ] &&
        [ "$(cat "$dev/idProduct" 2>/dev/null)" = "$PRODUCT" ] &&
        basename "$dev" && return 0
    done
    return 1
}

case "$1" in
    on)
        DEV=$(find_device) || { echo "Card reader not found"; exit 1; }
        # Clear the ignore quirk
        echo "${VENDOR}:${PRODUCT}:" | sudo tee /sys/module/usb_storage/parameters/quirks
        # Rebind the driver
        echo "${DEV}:1.0" | sudo tee /sys/bus/usb/drivers/usb-storage/bind
        echo "Card reader enabled"
        ;;
    off)
        DEV=$(find_device) || { echo "Card reader not found"; exit 1; }
        echo "${DEV}:1.0" | sudo tee /sys/bus/usb/drivers/usb-storage/unbind
        echo "${VENDOR}:${PRODUCT}:i" | sudo tee /sys/module/usb_storage/parameters/quirks
        echo "Card reader disabled"
        ;;
    *)  echo "Usage: $0 {on|off}" ;;
esac</code></pre>



<h3 class="wp-block-heading">How to Reproduce the ftrace Diagnosis</h3>



<p class="wp-block-paragraph">If you&#8217;re seeing phantom iowait and suspect a USB mass storage device, here&#8217;s how to trace it. As root:</p>



<pre><code># 1. Check for the phantom counter
grep procs_blocked /proc/stat      # nonzero?
ps -eo pid,state,comm | awk '$2 == "D"'  # no D-state processes?

# 2. Set up ftrace
cd /sys/kernel/debug/tracing
echo 0 > tracing_on
echo > trace
echo function > current_tracer
echo io_schedule >> set_ftrace_filter
echo io_schedule_timeout >> set_ftrace_filter
echo blk_execute_rq >> set_ftrace_filter
echo scsi_execute_cmd >> set_ftrace_filter
echo 1 > options/func_stack_trace
echo 1 > tracing_on

# 3. Trigger a reprobe of the suspect device
echo &lt;interface&gt; > /sys/bus/usb/drivers/usb-storage/unbind
sleep 3
echo &lt;interface&gt; > /sys/bus/usb/drivers/usb-storage/bind
sleep 5

# 4. Stop and check
echo 0 > tracing_on
grep procs_blocked /proc/stat      # did it increase?
cat trace > /tmp/scsi_trace.txt    # save for analysis</code></pre>



<p class="wp-block-paragraph">If <code>procs_blocked</code> increases after the reprobe, the trace will show you exactly which SCSI commands are leaking the counter. If it stays the same (as it did for me), that narrows the bug to the boot-time async scan path.</p>



<p class="wp-block-paragraph"><strong>The lesson:</strong> If your Linux system shows high iowait but <code>iotop</code> shows zero disk activity, check for USB mass storage devices. The SCSI probe path can permanently corrupt the kernel&#8217;s I/O accounting during boot.</p>



<h2 class="wp-block-heading">Bug 2: The Camera That Kills All USB — Razer Kiyo Pro xHCI Death Spiral</h2>



<p class="wp-block-paragraph">My Razer Kiyo Pro webcam (1532:0e05, firmware 8.21) has a much more dramatic failure mode: it can <strong>crash the entire xHCI host controller</strong>, disconnecting every USB device on the bus — keyboard, mouse, audio interface, everything. The only recovery is a hard reboot.</p>



<p class="wp-block-paragraph">The failure has two independent triggers, and the kernel&#8217;s built-in error recovery makes both of them worse.</p>



<h3 class="wp-block-heading">Trigger 1: Link Power Management Resume Failure</h3>



<p class="wp-block-paragraph">The Kiyo Pro fails to reinitialize after USB Link Power Management (LPM) transitions. When the kernel tries to wake the camera from a low-power state, it produces <code>EPIPE</code> (-32) errors on UVC <code>SET_CUR</code> operations. The stalled endpoint triggers an xHCI stop-endpoint timeout, and the kernel declares the entire controller dead.</p>



<h3 class="wp-block-heading">Trigger 2: Rapid Control Transfer Overflow</h3>



<p class="wp-block-paragraph">Approximately 25 rapid consecutive UVC <code>SET_CUR</code> operations overwhelm the camera&#8217;s firmware. The standard UVC error-recovery query (<code>GET_CUR</code> after <code>EPIPE</code>) amplifies the failure by sending a second transfer to the already-stalling device. The kernel detects the fault, resets the controller, the reset triggers another fault, and the system enters a death spiral.</p>



<p class="wp-block-paragraph">Testing confirmed that disabling LPM alone is insufficient — a stress test with <code>NO_LPM</code> active still caused delayed controller death 13 minutes later via TRB warning escalation.</p>



<h3 class="wp-block-heading">Update: Partially Improved in Kernel 6.17, But Still Crashes</h3>



<p class="wp-block-paragraph">After installing the HWE (Hardware Enablement) kernel on Ubuntu 24.04 LTS (<code>sudo apt install linux-generic-hwe-24.04</code>), which brought me to <strong>6.17.0-19-generic</strong>, I retested without any patches or workarounds applied.</p>



<p class="wp-block-paragraph">Initially the <code>v4l2-ctl</code> stress test appeared to pass 50/50 rounds, but further testing revealed that udev workarounds (autosuspend disable, avoid_reset_quirk) were still active. With <strong>all workarounds removed</strong>, the stress test crashes at round 44 with repeated endpoint stalls. On 6.8, the same test crashed around round 25 — so 6.17 is slightly more resilient but still vulnerable.</p>



<p class="wp-block-paragraph">However, <strong>starting a video call still triggers the full hc_died() cascade on 6.17</strong>. The crash path is different — it involves LPM transitions during isochronous stream setup rather than rapid control transfers:</p>



<pre><code>usb 2-3.4: disable of device-initiated U1 failed.
usb 2-3.4: Failed to set U2 timeout to 0x0,error code -110
uvcvideo 2-3.4:1.1: usb_set_interface Failed to disable LPM
usb 2-3.4: Failed to query (SET_CUR) UVC control 11 on unit 3: -71 (exp. 1).
[errors escalate from -71 EPROTO to -110 ETIMEDOUT]
usb 2-3.4: 3:1: cannot set freq 48000 to ep 0x82
xhci_hcd 0000:00:14.0: xHCI host not responding to stop endpoint command
xhci_hcd 0000:00:14.0: xHCI host controller not responding, assume dead
xhci_hcd 0000:00:14.0: HC died; cleaning up</code></pre>



<p class="wp-block-paragraph">The trigger is the LPM U1/U2 transition when the kernel sets up the video stream. The kernel tries to disable LPM, that fails, the firmware locks up, and every subsequent transfer times out until the controller is declared dead. The kernel patches (especially <code>USB_QUIRK_NO_LPM</code>) are still needed to prevent this.</p>



<h3 class="wp-block-heading">Workarounds for Older Kernels (6.8 and Earlier)</h3>



<p class="wp-block-paragraph">If you&#8217;re stuck on an older kernel, you&#8217;ll need multiple layers of defense:</p>



<ol class="wp-block-list">
<li><strong>Kernel module quirk</strong> — <code>snd-usb-audio</code> quirk flags to skip sample rate readback and defer audio interface setup: <code>options snd-usb-audio quirk_flags=0x4000001</code></li>
<li><strong>Kernel patches</strong> — Three patches submitted to <code>linux-usb@vger.kernel.org</code>:
<ul>
<li><code>USB_QUIRK_NO_LPM</code> for device 1532:0e05</li>
<li>A new <code>UVC_QUIRK_CTRL_THROTTLE</code> that rate-limits <code>SET_CUR</code> transfers (50ms minimum interval) and skips error-code queries after <code>EPIPE</code></li>
<li>Razer Kiyo Pro device entry combining throttle, disable-autosuspend, and no-reset-resume quirks</li>
</ul></li>
<li><strong>Udev rule</strong> — Sets <code>avoid_reset_quirk=1</code> to prevent USB errors from cascading to the xHCI controller</li>
<li><strong>Userspace watchdog</strong> — A systemd service that monitors kernel logs for xHCI fatal errors and performs escalating recovery: rebind the port, then reset the controller, then reload the driver. If all three fail, it stops — no retry loops, no death spirals.</li>
</ol>



<h3 class="wp-block-heading">Quick Runtime Workaround (Older Kernels)</h3>



<p class="wp-block-paragraph">If you have a Razer Kiyo Pro on kernel 6.8 or earlier and just want it to stop crashing your USB bus:</p>



<pre><code># Disable LPM for the Kiyo at runtime
echo "1532:0e05:k" | sudo tee /sys/module/usbcore/parameters/quirks

# Make it permanent
echo 'options usbcore quirks=1532:0e05:k' | sudo tee /etc/modprobe.d/razer-kiyo-usb.conf
sudo update-initramfs -u</code></pre>



<p class="wp-block-paragraph">This only addresses the LPM trigger. Full protection on older kernels requires the <code>CTRL_THROTTLE</code> kernel patch. <strong>The best fix is upgrading to kernel 6.17 or later.</strong></p>



<h2 class="wp-block-heading">Bug 3: The Initial Discovery — Tracker Meets a Slow USB Drive</h2>



<p class="wp-block-paragraph">The investigation that led me down this rabbit hole started with a much simpler problem. I plugged in an old 128GB LITEON SATA SSD in a USB enclosure (Realtek RTL9201 bridge) to grab some files. Within minutes, my system ground to a halt — <strong>real</strong> iowait this time, 50-60%, with the NVMe feeling sluggish.</p>



<p class="wp-block-paragraph">GNOME&#8217;s <code>tracker-miner-fs-3</code> had automatically started indexing the drive. The old SSD contained a full Ubuntu installation — hundreds of thousands of files under <code>/usr</code>, <code>/lib</code>, <code>/snap</code>. Tracker was hammering it with random reads, and the slow SATA-over-USB interface was bottlenecking everything.</p>



<p class="wp-block-paragraph">Killing tracker and unmounting the drive should have fixed it. But when I ran <code>udisksctl unmount</code>, the USB enclosure physically disconnected mid-cache-sync:</p>



<pre><code>sd 6:0:0:0: [sdc] Synchronize Cache(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK</code></pre>



<p class="wp-block-paragraph">This left 6 SCSI error handler threads stuck in uninterruptible sleep — and that&#8217;s when the phantom <code>procs_blocked</code> counter leak began. The threads eventually recovered, but the kernel&#8217;s accounting never decremented. This is the same class of bug as the card reader issue, just triggered through a different path (disconnect during cache flush vs. probe of removable media).</p>



<h2 class="wp-block-heading">Bug 4: The Webcam Mic That Vanishes — Logitech StreamCam PipeWire Conflict</h2>



<p class="wp-block-paragraph">The Logitech StreamCam (046d:0893) is a USB 3.0 webcam that exposes both UVC video and UAC audio interfaces. On Ubuntu with Wayland and PipeWire, it mostly works — until you try to use it for streaming.</p>



<h3 class="wp-block-heading">The Problem</h3>



<p class="wp-block-paragraph">After switching from X11 to Wayland with PipeWire (for screen capture in OBS), the StreamCam mic worked fine in veadotube. But the moment I added a PipeWire screen capture source in OBS, the mic stopped working in <strong>both</strong> OBS and veadotube. WirePlumber logged:</p>



<pre><code>Failed to call Lookup: GDBus.Error:org.freedesktop.portal.Error.NotFound: No entry for camera</code></pre>



<p class="wp-block-paragraph">The issue is a conflict between PipeWire&#8217;s camera portal and the audio routing. When OBS requests screen capture through the PipeWire portal, WirePlumber&#8217;s session management interferes with the existing audio node connections to the StreamCam. The mic&#8217;s PipeWire node gets orphaned — it still exists, but no application can connect to it.</p>



<h3 class="wp-block-heading">Additional Issues</h3>



<p class="wp-block-paragraph">The StreamCam also exposed two other quirks:</p>



<ul class="wp-block-list">
<li><strong>USB reset permission denied</strong> — <code>usbreset "Logitech StreamCam"</code> fails as a normal user. The fallback is toggling the sysfs <code>authorized</code> flag to force a re-enumeration: <code>echo 0 > /sys/bus/usb/devices/*/authorized && echo 1 > /sys/bus/usb/devices/*/authorized</code></li>
<li><strong>Wrong V4L2 node in OBS</strong> — The StreamCam exposes two video nodes: <code>/dev/video0</code> (main capture) and <code>/dev/video1</code> (metadata). OBS can pick the wrong one, resulting in no video. Always use <code>/dev/video0</code>.</li>
</ul>



<h3 class="wp-block-heading">The Fix</h3>



<p class="wp-block-paragraph">Restart the entire PipeWire stack to clear stale node connections:</p>



<pre><code># Restart PipeWire stack (fixes mic routing)
systemctl --user restart pipewire pipewire-pulse wireplumber

# If that doesn't work, reset the USB device first
pkexec usbreset "Logitech StreamCam"
sleep 1
systemctl --user restart pipewire pipewire-pulse wireplumber</code></pre>



<p class="wp-block-paragraph">I wrote a <a href="https://github.com/jphein/streamcam-fixes">fix-mic.sh script</a> that automates this: it tests if the mic is working, and if not, resets the USB device and restarts PipeWire. It runs automatically as part of my streaming startup script.</p>



<h2 class="wp-block-heading">The Common Thread</h2>



<p class="wp-block-paragraph">All four bugs live in the space where <strong>USB hardware</strong> meets <strong>Linux&#8217;s kernel subsystems</strong> — SCSI, xHCI, UVC, UAC, and PipeWire. Each layer has its own error handling and recovery logic, and when a USB device misbehaves, these layers can interact in unexpected ways.</p>



<p class="wp-block-paragraph">The specific issues:</p>



<ul class="wp-block-list">
<li><strong>SCSI probe accounting</strong> — The scheduler&#8217;s iowait counter can be permanently corrupted during boot-time async SCSI scanning — affects both USB mass storage and AHCI/SATA devices (<a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2146707">bug #2146707</a>)</li>
<li><strong>xHCI error recovery</strong> — The kernel&#8217;s &#8220;fix it by resetting everything&#8221; approach can create death spirals with devices that have buggy firmware</li>
<li><strong>USB disconnect handling</strong> — Cache sync operations on devices that physically disappear leave orphaned kernel accounting state</li>
<li><strong>PipeWire session conflicts</strong> — USB devices that expose multiple interfaces (video + audio) can have their audio routing broken when PipeWire&#8217;s portal system manages video capture separately</li>
</ul>



<h2 class="wp-block-heading">Recommendations</h2>



<p class="wp-block-paragraph">If you&#8217;re running Linux with USB peripherals (especially on a workstation or homelab):</p>



<ol class="wp-block-list">
<li><strong>Install <code>iotop</code></strong> — It reads per-process I/O accounting, which is more accurate than <code>/proc/stat</code>. When <code>top</code> shows high iowait but <code>iotop</code> shows zero, you know it&#8217;s a phantom counter.</li>
<li><strong>Check <code>usb-storage</code> quirks</strong> — If you have USB card readers or enclosures causing issues, the <code>usb-storage.quirks</code> boot parameter is your friend.</li>
<li><strong>Disable LPM for problem cameras (older kernels)</strong> — On kernels before 6.17, many USB cameras have firmware bugs exposed by Linux&#8217;s aggressive power management. The <code>usbcore quirks</code> parameter can disable LPM per-device. On 6.17+, the kernel handles this automatically.</li>
<li><strong>Keep your kernel updated</strong> — Kernel 6.17 (available on Ubuntu 24.04 LTS via <code>sudo apt install linux-generic-hwe-24.04</code>) improves xHCI error handling for control transfers, but the Razer Kiyo Pro crash during video calls still occurs. The kernel patches are still needed for full protection.</li>
<li><strong>Use <code>udisksctl power-off</code></strong> before physically unplugging USB drives — this prevents the cache sync race condition that can leak kernel accounting state.</li>
<li><strong>Restart PipeWire after USB webcam issues</strong> — If your webcam&#8217;s mic stops working (especially after adding screen capture sources in OBS), run <code>systemctl --user restart pipewire pipewire-pulse wireplumber</code>. PipeWire&#8217;s portal system can orphan audio nodes when managing video and audio from the same USB device.</li>
</ol>



<p class="wp-block-paragraph">The Linux USB subsystem handles thousands of device combinations, and most of them work flawlessly. But when they don&#8217;t, the failure modes can be subtle and deeply confusing — phantom I/O wait, cascading controller resets, kernel counters that lie to every monitoring tool on your system, and audio routing that silently breaks. Understanding the layers underneath USB devices — SCSI, xHCI, UVC, PipeWire — is the key to diagnosing these issues.</p>



<p class="wp-block-paragraph">All of the patches and scripts mentioned here are available on GitHub: <a href="https://github.com/jphein/kiyo-xhci-fix">kiyo-xhci-fix</a> (Razer Kiyo Pro patches and watchdog) and <a href="https://github.com/jphein/streamcam-fixes">streamcam-fixes</a> (Logitech StreamCam mic fix).</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jphein.com/the-usb-bug-trilogy-phantom-i-o-camera-crashes-and-kernel-accounting-lies/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">12253</post-id>	</item>
		<item>
		<title>How a Google Nest Hub Took Down My Entire Network</title>
		<link>https://jphein.com/how-a-google-nest-hub-took-down-my-entire-network/</link>
					<comments>https://jphein.com/how-a-google-nest-hub-took-down-my-entire-network/#respond</comments>
		
		<dc:creator><![CDATA[Jeffrey Hein]]></dc:creator>
		<pubDate>Wed, 25 Mar 2026 13:40:24 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<guid isPermaLink="false">https://jphein.com/?p=12240</guid>

					<description><![CDATA[I run a homelab with 12 VLANs, an OpenWrt firewall, and about 70 devices. Last night I enabled Cloudflare&#8217;s proxy (the \&#8221;orange cloud\&#8221;) on my domain realm.watch and woke up to find every device on my network had lost its IPv4 address. Phones, laptops, servers, IoT devices — all down. Here&#8217;s what happened and how [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I run a homelab with 12 VLANs, an OpenWrt firewall, and about 70 devices. Last night I enabled Cloudflare&#8217;s proxy (the \&#8221;orange cloud\&#8221;) on my domain <code>realm.watch</code> and woke up to find <strong>every device on my network had lost its IPv4 address</strong>. Phones, laptops, servers, IoT devices — all down. Here&#8217;s what happened and how I tracked it down.</p>



<h2 class="wp-block-heading">The Symptom</h2>



<p class="wp-block-paragraph">After enabling CF proxy, devices on my admin VLAN (10.0.6.0/24) stopped renewing their DHCPv4 leases. My workstation was being handed a DHCPv6 address instead. Disabling the orange cloud immediately fixed it. Toggling it back on broke things again — reproducible every time.</p>



<h2 class="wp-block-heading">The Investigation</h2>



<p class="wp-block-paragraph">My first instinct was to blame my own infrastructure. I checked:</p>



<ul class="wp-block-list">
<li><strong>OpenWrt&#8217;s odhcpd</strong> on my firewall (gatekeeper) — disabled RA on all interfaces, confirmed via tcpdump it wasn&#8217;t sending any Router Advertisements</li>
<li><strong>dnsmasq on my hypervisor</strong> — stopped it entirely, RAs continued</li>
<li><strong>My realm-portal Alpine VM</strong> — confirmed it was receiving RAs, not sending them</li>
<li><strong>libvirt&#8217;s dnsmasq</strong> — only on virbr0 (isolated bridge), not on the VLAN bridge</li>
</ul>



<p class="wp-block-paragraph">None of my infrastructure was the source. So I ran a targeted tcpdump on the VLAN 6 bridge:</p>



<pre><code>tcpdump -i br-lan.6 'icmp6 and ip6[40]=134'</code></pre>



<p class="wp-block-paragraph">And there it was — a device I didn&#8217;t expect:</p>



<pre><code>fe80::1c3c:3716:1534:2392 > ff02::1: ICMP6, router advertisement
  Flags [managed, other stateful, ipv6 only]
  router lifetime 0s
  prefix: fd39:c3aa:8cfe:6bb8::/64, valid 1800s
  route: fd40:b451:5824:1::/64, lifetime 1800s</code></pre>



<h2 class="wp-block-heading">The Culprit: A Google Nest Hub</h2>



<p class="wp-block-paragraph">The source MAC was <code>24:e5:0f:d7:01:1d</code> — a Google device. I hit its local API:</p>



<pre><code>curl http://10.0.6.124:8008/setup/eureka_info</code></pre>



<p class="wp-block-paragraph">It was my <strong>Kitchen hub</strong> — a Google Nest Hub sitting on the counter. It was acting as a <strong>Thread/Matter border router</strong>, broadcasting IPv6 Router Advertisements with the <code>ipv6 only</code> flag (RFC 8781). This flag tells every device on the network: \&#8221;IPv6 is sufficient, you don&#8217;t need IPv4.\&#8221;</p>



<h2 class="wp-block-heading">Why Cloudflare Proxy Triggered It</h2>



<p class="wp-block-paragraph">When you enable CF proxy on a domain, Cloudflare automatically publishes AAAA (IPv6) records alongside the A record. This introduces IPv6 DNS activity on the LAN — clients start making IPv6 lookups, generating multicast traffic. The Nest Hub&#8217;s Thread border router detected this IPv6 activity and responded by broadcasting Router Advertisements telling every device on the network to go IPv6-only.</p>



<p class="wp-block-paragraph">The effect was immediate and reproducible: orange cloud on → RAs start → DHCPv4 leases expire → network down. Orange cloud off → IPv6 DNS activity drops → RAs stop → devices recover.</p>



<h2 class="wp-block-heading">The Fix</h2>



<p class="wp-block-paragraph">Three layers of defense:</p>



<ol class="wp-block-list">
<li><strong>Firewall block</strong> — Added persistent nftables rules on my OpenWrt firewall to drop Router Advertisements from this MAC address:<br><code>nft add rule inet fw4 forward ether saddr 24:e5:0f:d7:01:1d meta l4proto icmpv6 icmpv6 type nd-router-advert drop</code></li>
<li><strong>Moved the device</strong> — Deauthed the Nest Hub from the admin SSID and moved it to the IoT VLAN where its RAs can&#8217;t affect critical infrastructure</li>
<li><strong>Disabled RA/DHCPv6</strong> on all firewall interfaces as an additional safety net</li>
</ol>



<h2 class="wp-block-heading">Lessons Learned</h2>



<ul class="wp-block-list">
<li><strong>Consumer smart home devices can break your entire network.</strong> A Google Nest Hub acting as a Thread/Matter border router was sending rogue Router Advertisements that poisoned DHCPv4 for every device on the VLAN.</li>
<li><strong>The \&#8221;ipv6 only\&#8221; RA flag (RFC 8781) is dangerous on mixed networks.</strong> It tells clients to stop using IPv4 entirely. One misbehaving device can take down your whole network.</li>
<li><strong>Segment your IoT devices.</strong> Smart speakers, hubs, and Thread/Matter devices should never be on the same VLAN as your servers and workstations.</li>
<li><strong>Enabling Cloudflare proxy can have surprising LAN-side effects</strong> by introducing AAAA records and increasing IPv6 activity, which can trigger latent issues with devices that react to IPv6 traffic.</li>
<li><strong>Google Cast devices expose a local API on port 8008</strong> (<code>/setup/eureka_info</code>) that returns device identity without authentication — invaluable for identifying mystery devices.</li>
<li><strong>Use RA Guard or firewall rules</strong> to block unauthorized Router Advertisements. Only your actual router should be sending RAs.</li>
</ul>



<p class="wp-block-paragraph">The whole investigation took about an hour. The hardest part was accepting that my own infrastructure wasn&#8217;t the problem — it was a \$100 smart display on the kitchen counter.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jphein.com/how-a-google-nest-hub-took-down-my-entire-network/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">12240</post-id>	</item>
		<item>
		<title>Building a Home File Server with Ubuntu, RAID, Docker, and Tailscale</title>
		<link>https://jphein.com/building-a-home-file-server-with-ubuntu-raid-docker-and-tailscale/</link>
					<comments>https://jphein.com/building-a-home-file-server-with-ubuntu-raid-docker-and-tailscale/#respond</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Sun, 22 Mar 2026 07:14:29 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[file-server]]></category>
		<category><![CDATA[homelab]]></category>
		<category><![CDATA[immich]]></category>
		<category><![CDATA[jellyfin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[navidrome]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[self-hosted]]></category>
		<category><![CDATA[tailscale]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://jphein.com/building-a-home-file-server-with-ubuntu-raid-docker-and-tailscale/</guid>

					<description><![CDATA[Building a headless Ubuntu file server doesn&#8217;t require fancy hardware or expensive NAS appliances. In this guide, I&#8217;ll walk through how I turned an old Sandy Bridge desktop into a reliable home file server running RAID 1, LVM, and a full suite of self-hosted media services — all accessible from anywhere via Tailscale VPN. The [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Building a headless Ubuntu file server doesn&#8217;t require fancy hardware or expensive NAS appliances. In this guide, I&#8217;ll walk through how I turned an old Sandy Bridge desktop into a reliable home file server running RAID 1, LVM, and a full suite of self-hosted media services — all accessible from anywhere via Tailscale VPN.</p>
<p><!-- more --></p>
<h2>The Hardware</h2>
<p>This build starts with modest hardware — a retired desktop with an Intel Sandy Bridge quad-core CPU, no discrete GPU, and a mix of drives:</p>
<table>
<thead>
<tr>
<th>Component</th>
<th>Detail</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>CPU</strong></td>
<td>Intel Sandy Bridge, 4 cores, AES-NI</td>
</tr>
<tr>
<td><strong>RAM</strong></td>
<td>8GB DDR3</td>
</tr>
<tr>
<td><strong>Boot Drive</strong></td>
<td>112G WD SSD</td>
</tr>
<tr>
<td><strong>Disk 1</strong></td>
<td>932G Toshiba HDD</td>
</tr>
<tr>
<td><strong>Disk 2</strong></td>
<td>1.82T Seagate HDD</td>
</tr>
<tr>
<td><strong>Disk 3</strong></td>
<td>932G Western Digital HDD</td>
</tr>
<tr>
<td><strong>GPU</strong></td>
<td>Intel HD 2000/3000 (integrated only)</td>
</tr>
</tbody>
</table>
<p>No discrete GPU means no hardware transcoding — but that&#8217;s fine. We&#8217;ll configure everything for direct play and disable ML features that need GPU acceleration.</p>
<h2>Storage Architecture</h2>
<p>The storage layout uses two strategies: <strong>RAID 1</strong> for active data that needs redundancy, and <strong>LVM</strong> for bulk archive storage.</p>
<pre><code>┌─────────────────────────────────────────────────────────┐
│                      /mnt/raid (923G)                   │
│                     RAID 1 — "mirror"                   │
│   ┌─────────────────────┐  ┌─────────────────────┐     │
│   │  sda2 (923G)        │  │  sdc3 (923G)        │     │
│   │  Toshiba DT01ACA100 │  │  WD WD10EZEX        │     │
│   └─────────────────────┘  └─────────────────────┘     │
└─────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────┐
│                   /mnt/storage (1.82T)                  │
│                  LVM — VG "lvm" / LV "storage"          │
│   ┌─────────────────────────────────────────────┐       │
│   │  sdb (1.82T) — Seagate ST2000VM003          │       │
│   └─────────────────────────────────────────────┘       │
└─────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────┐
│                    sdd — Boot Drive                     │
│                  112G WD SSD (ext4 + EFI)               │
└─────────────────────────────────────────────────────────┘</code></pre>
<p><strong>RAID 1</strong> mirrors two drives so active data (documents, photos, music, videos, projects) survives a single drive failure. <strong>LVM</strong> on the 1.82T Seagate holds archives and backups — data that either exists elsewhere or can be re-downloaded.</p>
<p>The key principle: <strong>irreplaceable data goes on RAID, regenerable data goes on LVM.</strong> This guides every storage decision on the server.</p>
<p>Setting up the RAID array was straightforward since it was a pre-existing array from 2019:</p>
<pre><code>sudo mdadm --assemble /dev/md0 /dev/sda2 /dev/sdc3
sudo mount /dev/md0 /mnt/raid</code></pre>
<p>The LVM volume just needed activation:</p>
<pre><code>sudo lvchange -ay lvm/storage
sudo mount /dev/lvm/storage /mnt/storage</code></pre>
<p>Both volumes auto-mount via <code>/etc/fstab</code> with the <code>nofail</code> flag, so the system boots even if a data disk fails.</p>
<h2>File Sharing: NFS + Samba</h2>
<p>The server exports both volumes over <strong>NFS v4.2</strong> (for Linux clients) and <strong>SMB3</strong> (for Windows and macOS).</p>
<h3>NFS v4.2</h3>
<p>NFSv4.2 is the cleanest option for Linux-to-Linux file sharing. The server uses a pseudo-root at <code>/srv/nfs</code> with bind mounts:</p>
<pre><code># /etc/exports
/srv/nfs        10.0.6.0/24(rw,sync,fsid=0,crossmnt,no_subtree_check)
/srv/nfs/raid   10.0.6.0/24(rw,sync,no_subtree_check)
/srv/nfs/storage 10.0.6.0/24(rw,sync,no_subtree_check)</code></pre>
<p>Clients mount with a single line:</p>
<pre><code>sudo mount -t nfs4 -o vers=4.2,noatime,nodiratime disks.local:/ /mnt/disks</code></pre>
<h3>Samba / SMB3</h3>
<p>For Windows and macOS clients, Samba serves the same volumes with SMB3 encryption and macOS Time Machine compatibility via the <code>fruit</code> VFS module. A dedicated <code>family</code> share gives household members access to shared music and documents.</p>
<h2>Docker Media Stack</h2>
<p>The heart of this build is a Docker Compose stack running eight self-hosted services behind a Caddy reverse proxy:</p>
<table>
<thead>
<tr>
<th>Service</th>
<th>Purpose</th>
<th>URL</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Jellyfin</strong></td>
<td>Video streaming</td>
<td>jellyfin.jphe.in</td>
</tr>
<tr>
<td><strong>Navidrome</strong></td>
<td>Music streaming (Subsonic API)</td>
<td>navidrome.jphe.in</td>
</tr>
<tr>
<td><strong>Immich</strong></td>
<td>Photo management &amp; phone backup</td>
<td>immich.jphe.in</td>
</tr>
<tr>
<td><strong>Syncthing</strong></td>
<td>Bidirectional file sync</td>
<td>syncthing.jphe.in</td>
</tr>
<tr>
<td><strong>Nextcloud</strong></td>
<td>Calendar, contacts &amp; webmail</td>
<td>nextcloud.jphe.in</td>
</tr>
<tr>
<td><strong>Outline</strong></td>
<td>Wiki &amp; knowledge base</td>
<td>outline.jphe.in</td>
</tr>
<tr>
<td><strong>Vaultwarden</strong></td>
<td>Password manager (Bitwarden-compatible)</td>
<td>vault.jphe.in</td>
</tr>
</tbody>
</table>
<h3>Jellyfin — Direct Play Only</h3>
<p>Without a discrete GPU, Jellyfin is configured for <strong>direct play only</strong> — no transcoding. This means clients need to support the media formats natively. In practice, most modern clients (phones, smart TVs, web browsers) handle H.264/H.265 just fine.</p>
<p>If a file won&#8217;t play on a particular client, I pre-transcode it on my workstation with <code>ffmpeg</code> before adding it to the library.</p>
<h3>Navidrome — Lightweight Music Streaming</h3>
<p>Navidrome is impressively lightweight — about 30MB of RAM to serve an entire music library. It speaks the Subsonic API, so any Subsonic-compatible client works: Symfonium on Android, play:Sub on iOS, or Sublime Music on Linux.</p>
<h3>Immich — Self-Hosted Google Photos</h3>
<p>Immich provides a Google Photos-like experience for photo management and mobile backup. Since we have no GPU, the machine learning features (face detection, CLIP search) are disabled — but the core photo browsing, timeline, and mobile auto-upload work perfectly.</p>
<h4>Immich Storage Layout</h4>
<p>Getting Immich&#8217;s storage right took some iteration. The key insight: <strong>phone uploads are irreplaceable originals and need RAID redundancy, but thumbnails and transcoded videos are regenerable and can live on cheaper storage.</strong></p>
<p>The final layout uses Docker bind mounts to split data across volumes:</p>
<pre><code>volumes:
  # Base upload directory on LVM (thumbnails, transcodes, backups)
  - /mnt/storage/immich-data:/usr/src/app/upload
  # Phone uploads overlaid onto RAID for redundancy
  - /mnt/raid/immich-upload:/usr/src/app/upload/upload
  - /mnt/raid/immich-library:/usr/src/app/upload/library
  # External photo libraries (read-only)
  - /mnt/raid/photos:/usr/src/app/external-raid:ro</code></pre>
<p>Docker processes volume mounts in order, so the bind mounts for <code>upload/</code> and <code>library/</code> overlay onto the base LVM mount. This gives us:</p>
<table>
<thead>
<tr>
<th>Data Type</th>
<th>Location</th>
<th>Why</th>
</tr>
</thead>
<tbody>
<tr>
<td>Phone uploads (originals)</td>
<td>/mnt/raid (RAID 1)</td>
<td>Irreplaceable, needs redundancy</td>
</tr>
<tr>
<td>Thumbnails</td>
<td>/mnt/storage (LVM)</td>
<td>Regenerable from originals</td>
</tr>
<tr>
<td>Encoded video</td>
<td>/mnt/storage (LVM)</td>
<td>Regenerable from originals</td>
</tr>
<tr>
<td>DB backups</td>
<td>/mnt/storage (LVM)</td>
<td>Separate backup chain handles this</td>
</tr>
<tr>
<td>Postgres database</td>
<td>/mnt/raid (RAID 1)</td>
<td>Bind mount at /mnt/raid/docker/immich-db</td>
</tr>
</tbody>
</table>
<p><strong>Lesson learned the hard way:</strong> Docker named volumes live under <code>/var/lib/docker/volumes/</code> on the root filesystem — typically a small boot SSD. If Immich starts processing thousands of photos, thumbnails and transcoded videos can eat 20+ GB fast. Always use bind mounts to explicit paths on your data drives.</p>
<h4>Fixing Bad EXIF Dates</h4>
<p>Old photos from cameras with dead batteries or no real-time clock often have EXIF dates like January 1, 1980 or December 26, 1970. Immich sorts by EXIF date, so these photos end up in the wrong decade.</p>
<p>For JPEGs, <code>exiftool</code> can fix the dates on disk:</p>
<pre><code>exiftool -overwrite_original -DateTimeOriginal="2018:04:01 12:00:00" photo.JPG</code></pre>
<p>For formats that don&#8217;t support EXIF writes (like AVI), fix the dates directly in Immich&#8217;s Postgres database:</p>
<pre><code>docker exec immich-db psql -U postgres -d immich -c \
  "UPDATE asset_exif SET \"dateTimeOriginal\" = '2023-05-01 12:00:00'
   WHERE \"assetId\" IN (SELECT id FROM asset WHERE \"originalPath\" LIKE '%folder-name%');"</code></pre>
<h3>Nextcloud — Calendar, Contacts &amp; Webmail</h3>
<p>Nextcloud fills the last major gap in the self-hosted stack: <strong>CalDAV</strong> for calendar sync and <strong>CardDAV</strong> for contacts, plus a built-in webmail client that connects to existing email accounts via IMAP/SMTP.</p>
<p>The architecture mirrors Immich — Nextcloud Apache container backed by Postgres 16 and Redis, all on RAID bind mounts. CalDAV/CardDAV client autodiscovery requires <code>/.well-known/caldav</code> and <code>/.well-known/carddav</code> redirects in Caddy, per <a href="https://www.rfc-editor.org/rfc/rfc6764">RFC 6764</a>:</p>
<pre><code>nextcloud.jphe.in {
    redir /.well-known/carddav /remote.php/dav 301
    redir /.well-known/caldav /remote.php/dav 301
    reverse_proxy nextcloud:80
}</code></pre>
<p>With these redirects, phone and desktop calendar/contacts clients only need the hostname — no manual URL entry required. One critical environment variable: <code>OVERWRITEPROTOCOL=https</code> tells Nextcloud it&#8217;s behind a TLS-terminating proxy, so it generates correct <code>https://</code> links instead of <code>http://</code>.</p>
<h3>Outline — Team Wiki</h3>
<p>Outline provides a clean, fast wiki for shared documentation and knowledge management. It&#8217;s the self-hosted alternative to Notion — Markdown-native, real-time collaborative editing, and a powerful search.</p>
<p>Rather than adding yet another authentication system, Outline uses <strong>Nextcloud as an OIDC provider</strong>. Anyone with a Nextcloud account can log into Outline — no separate credentials needed. This is configured by registering an OAuth2 client in Nextcloud&#8217;s admin settings and pointing Outline&#8217;s OIDC environment variables at Nextcloud&#8217;s authorization endpoints.</p>
<p>File uploads (images, attachments) are stored directly on the RAID filesystem rather than requiring an S3-compatible object store like MinIO. For a personal/family wiki, local storage is simpler and perfectly adequate — Outline supports this with <code>FILE_STORAGE=local</code>.</p>
<h3>Vaultwarden — Self-Hosted Password Manager</h3>
<p>Vaultwarden is a lightweight, Rust-based implementation of the Bitwarden API. It runs on minimal resources and is fully compatible with all Bitwarden clients — browser extensions, mobile apps, and the <code>bw</code> CLI tool.</p>
<p>The database lives on RAID for redundancy, and automated daily backups provide an additional safety net (more on that below).</p>
<h3>Syncthing — Project Sync</h3>
<p>Syncthing keeps my <code>~/Projects</code> directory synchronized between my workstation and the server&#8217;s RAID array. It&#8217;s bidirectional, peer-to-peer, and encrypted — no cloud service involved.</p>
<h2>HTTPS with Caddy + Cloudflare DNS</h2>
<p>Every service gets its own subdomain with automatic Let&#8217;s Encrypt certificates. Caddy handles this with the Cloudflare DNS-01 challenge — no ports 80/443 need to be exposed to the internet.</p>
<p>One gotcha: the upstream <code>caddy-dns/cloudflare</code> module rejects Cloudflare&#8217;s newer <code>cfut_</code>-prefixed API tokens. I used a <a href="https://github.com/caddy-dns/cloudflare/pull/123">patched fork</a> that fixes this.</p>
<p>The Caddyfile is clean — each service is just a few lines:</p>
<pre><code>jellyfin.jphe.in {
    reverse_proxy jellyfin:8096
}</code></pre>
<h3>Caddy Timeout Tuning for Large Uploads</h3>
<p>If you&#8217;re uploading large videos through Immich (or any service behind Caddy), the default proxy timeouts will kill the connection mid-upload. The fix is to increase both the request body size limit and the proxy transport timeouts:</p>
<pre><code>immich.jphe.in {
    request_body {
        max_size 20GB
    }
    reverse_proxy immich:2283 {
        transport http {
            read_timeout 600s
            write_timeout 600s
        }
    }
}</code></pre>
<p>Caddy supports hot-reloading — <code>caddy reload</code> applies config changes without dropping existing connections.</p>
<h2>Remote Access with Tailscale</h2>
<p>All the <code>*.jphe.in</code> DNS records point to the server&#8217;s <strong>Tailscale IP</strong> (100.x.x.x), not a public IP. This means:</p>
<ul>
<li>From home (LAN): The OpenWrt router intercepts <code>*.jphe.in</code> queries and resolves them to the local IP (10.0.6.120)</li>
<li>From anywhere else: DNS resolves to the Tailscale IP, and traffic flows through the Tailscale mesh</li>
</ul>
<p>No port forwarding. No dynamic DNS. No exposing services to the internet. Just install Tailscale on your devices and everything works.</p>
<h2>Server Tuning</h2>
<p>A few targeted optimizations make a noticeable difference on this hardware:</p>
<h3>Kernel / sysctl</h3>
<table>
<thead>
<tr>
<th>Setting</th>
<th>Value</th>
<th>Why</th>
</tr>
</thead>
<tbody>
<tr>
<td>vm.swappiness</td>
<td>10</td>
<td>Prefer file cache over swap</td>
</tr>
<tr>
<td>vm.dirty_ratio</td>
<td>40</td>
<td>Allow large write batches before flushing</td>
</tr>
<tr>
<td>vm.vfs_cache_pressure</td>
<td>50</td>
<td>Keep directory/inode caches longer</td>
</tr>
<tr>
<td>net.ipv4.tcp_congestion_control</td>
<td>bbr</td>
<td>Google&#8217;s BBR for faster throughput</td>
</tr>
<tr>
<td>net.core.rmem_max / wmem_max</td>
<td>16MB</td>
<td>Large TCP buffers for big file transfers</td>
</tr>
</tbody>
</table>
<h3>Storage I/O</h3>
<p>HDDs get the <code>mq-deadline</code> scheduler with 2MB readahead and write caching enabled. The SSD boot drive uses <code>none</code> (passthrough). Head parking is disabled on the HDDs (<code>hdparm -B254</code>) to avoid the click-of-death wear pattern.</p>
<h3>SSH</h3>
<p>SSH is tuned to use hardware-accelerated AES-GCM ciphers (the Sandy Bridge CPU has AES-NI), and reverse DNS lookups are disabled for faster connections.</p>
<p><strong>Terminal compatibility tip:</strong> If you use Kitty terminal, remote servers won&#8217;t have the <code>xterm-kitty</code> terminfo entry. Tools like <code>top</code>, <code>htop</code>, and <code>nano</code> will break. Fix it by installing the terminfo on the server:</p>
<pre><code>infocmp -x xterm-kitty | ssh disks "mkdir -p ~/.terminfo && tic -x -o ~/.terminfo /dev/stdin"</code></pre>
<h2>Automated Backups</h2>
<p>The backup strategy has two layers: <strong>database dumps</strong> for application state, and <strong>BorgBackup</strong> for file-level deduplication.</p>
<h3>Database Backups (Daily at 2:30 AM)</h3>
<p>Every service with a database gets a daily dump to <code>/mnt/raid/backups/databases/</code>:</p>
<table>
<thead>
<tr>
<th>Service</th>
<th>DB Type</th>
<th>Method</th>
</tr>
</thead>
<tbody>
<tr>
<td>Immich</td>
<td>Postgres</td>
<td><code>pg_dump</code> (consistent snapshot)</td>
</tr>
<tr>
<td>Nextcloud</td>
<td>Postgres</td>
<td><code>pg_dump</code> (consistent snapshot)</td>
</tr>
<tr>
<td>Outline</td>
<td>Postgres</td>
<td><code>pg_dump</code> (consistent snapshot)</td>
</tr>
<tr>
<td>Vaultwarden</td>
<td>SQLite</td>
<td><code>sqlite3 .backup</code> (safe while running)</td>
</tr>
<tr>
<td>Jellyfin</td>
<td>SQLite</td>
<td><code>sqlite3 .backup</code></td>
</tr>
<tr>
<td>Navidrome</td>
<td>SQLite</td>
<td><code>sqlite3 .backup</code></td>
</tr>
</tbody>
</table>
<p>The dumps land on RAID so they&#8217;re included in the Borg backup that follows. Old dumps are pruned after 7 days.</p>
<p><strong>Why not just back up the database files directly?</strong> Postgres stores data across multiple files that must be consistent with each other. Copying them while Postgres is running can give you a corrupted snapshot. <code>pg_dump</code> produces a clean SQL dump regardless of database activity. SQLite has the same issue — the <code>.backup</code> command ensures a consistent copy.</p>
<h3>BorgBackup (Daily at 3:00 AM)</h3>
<p>BorgBackup runs 30 minutes after the database dumps, deduplicating critical data from RAID to the storage volume:</p>
<pre><code># Backs up: documents, keys, projects, database dumps, photos
# Retention: 7 daily, 4 weekly, 6 monthly
# Compression: zstd level 3
# Destination: /mnt/storage/backups/borg-raid</code></pre>
<p>Borg&#8217;s deduplication means incremental backups are fast and space-efficient — only changed blocks are stored. The entire backup history compresses to around 320MB of deduplicated storage.</p>
<h3>The Backup Chain</h3>
<pre><code>2:30 AM  Database dumps → /mnt/raid/backups/databases/
3:00 AM  Borg backup    → /mnt/raid/* → /mnt/storage/backups/borg-raid/
6:00 AM  Disk health    → SMART checks, logged to /var/log/disk-health.log</code></pre>
<p>This means the storage volume holds a complete, deduplicated history of everything on RAID — including consistent database snapshots.</p>
<h2>Cloud Backup with rclone</h2>
<p>Local backups protect against drive failure, but not against fire, theft, or disaster. For geographic redundancy, the server syncs critical data to cloud storage using <strong>rclone</strong>.</p>
<h3>The Setup</h3>
<p>rclone is configured with three cloud remotes:</p>
<table>
<thead>
<tr>
<th>Remote</th>
<th>Provider</th>
<th>Storage</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>box-personal</strong></td>
<td>Box (personal)</td>
<td>100GB</td>
</tr>
<tr>
<td><strong>box-techempower</strong></td>
<td>Box (work)</td>
<td>100GB</td>
</tr>
<tr>
<td><strong>gdrive</strong></td>
<td>Google Drive</td>
<td>25GB</td>
</tr>
</tbody>
</table>
<p>That&#8217;s 225GB of cloud storage across three accounts — enough for database dumps, documents, phone uploads, music, and a chunk of the photo library.</p>
<h3>Google Drive as a FUSE Mount</h3>
<p>Google Drive is mounted as a regular filesystem at <code>/mnt/gdrive</code> using rclone&#8217;s FUSE mount capability, managed by a systemd service:</p>
<pre><code>[Service]
Type=notify
User=jp
ExecStart=/usr/bin/rclone mount gdrive: /mnt/gdrive \
    --vfs-cache-mode full \
    --vfs-cache-max-size 2G \
    --dir-cache-time 72h \
    --allow-other</code></pre>
<p>The <code>--vfs-cache-mode full</code> setting caches files locally before serving them, so reads and writes behave like a normal filesystem. The <code>--allow-other</code> flag (plus <code>user_allow_other</code> in <code>/etc/fuse.conf</code>) lets other system users and services like Samba access the mount.</p>
<h3>OAuth on a Headless Server</h3>
<p>Box and Google Drive both use OAuth2 for authentication, which normally requires a web browser. Since the server is headless, the trick is to run <code>rclone config</code> on a workstation that has a browser, complete the OAuth flow there, then copy <code>~/.config/rclone/rclone.conf</code> to the server. The tokens persist in the config file and rclone handles refresh automatically.</p>
<h2>Disk Health Monitoring</h2>
<p><code>smartd</code> runs weekly short tests and monthly long tests on all drives. A custom health check script runs daily at 6am and logs to <code>/var/log/disk-health.log</code>. On a server with aging drives, early warning of failure is critical.</p>
<h2>Lessons Learned</h2>
<p>A few things I ran into during the build:</p>
<ol>
<li><strong>Old EFI partitions cause boot confusion.</strong> The BIOS was trying to boot a 2019-era GRUB installation from one of the data drives instead of the actual boot SSD. Clearing the old EFI entries fixed it.</li>
<li><strong>Always run <code>e2fsck</code> before operating on corrupt inodes.</strong> I tried to clean up files on a filesystem with corrupt inodes and triggered a kernel panic — VFS spinlock deadlock. The fix was to unmount and run <code>e2fsck -y</code> first.</li>
<li><strong>Docker volume permissions matter.</strong> Syncthing&#8217;s config volume was created as root but the container runs as UID 1000. Switching to a bind mount with explicit user mapping solved it.</li>
<li><strong>RAID cleanup freed massive space.</strong> The RAID array was 99% full. Moving backups and archives to the storage volume brought it down to 38% — from 917G used to 320G.</li>
<li><strong>No GPU doesn&#8217;t mean no media server.</strong> Direct play works great for most use cases. The GPU upgrade path is documented for when I eventually add one.</li>
<li><strong>Docker named volumes default to the root filesystem.</strong> Immich&#8217;s thumbnails and transcoded videos filled 23GB on the boot SSD before I noticed. Always use bind mounts for data-heavy containers, pointing to your bulk storage.</li>
<li><strong>Symlinks don&#8217;t work inside Docker volumes.</strong> A symlink on the host points to a path as seen <em>inside the container</em>. If the target path isn&#8217;t mounted in the container, the symlink leads nowhere. Use Docker bind mounts instead.</li>
<li><strong>Back up your databases, not just your files.</strong> BorgBackup captures files, but copying a live Postgres data directory gives you a potentially corrupt snapshot. I lost an entire Immich database (all photo metadata, albums, users) because there was no <code>pg_dump</code> backup. Now every database gets a daily dump before Borg runs.</li>
<li><strong>Separate irreplaceable from regenerable data.</strong> Phone photo uploads need RAID redundancy. Thumbnails and transcoded videos can be regenerated from originals and belong on cheaper storage. This distinction should drive your volume layout from day one.</li>
<li><strong>Caddy needs timeout tuning for large uploads.</strong> The default proxy timeouts are fine for web browsing but kill multi-gigabyte video uploads. Configure <code>read_timeout</code> and <code>write_timeout</code> explicitly for services that handle large files.</li>
<li><strong>Use <code>rsync</code>, not <code>mv</code>, across filesystems.</strong> <code>mv</code> between different filesystems is a silent copy+delete with no progress indicator and no resume on failure. <code>rsync -ah --progress</code> gives you visibility and idempotent restarts.</li>
</ol>
<h2>The Final Stack</h2>
<p>Here&#8217;s what the complete setup looks like:</p>
<table>
<thead>
<tr>
<th>Layer</th>
<th>Technology</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>OS</strong></td>
<td>Ubuntu 24.04 (headless)</td>
</tr>
<tr>
<td><strong>Storage</strong></td>
<td>mdadm RAID 1 + LVM</td>
</tr>
<tr>
<td><strong>File Sharing</strong></td>
<td>NFS v4.2 + Samba/SMB3</td>
</tr>
<tr>
<td><strong>Media</strong></td>
<td>Jellyfin + Navidrome + Immich</td>
</tr>
<tr>
<td><strong>PIM</strong></td>
<td>Nextcloud (CalDAV/CardDAV/Mail)</td>
</tr>
<tr>
<td><strong>Knowledge Base</strong></td>
<td>Outline (Nextcloud OIDC auth)</td>
</tr>
<tr>
<td><strong>Passwords</strong></td>
<td>Vaultwarden (Bitwarden-compatible)</td>
</tr>
<tr>
<td><strong>Sync</strong></td>
<td>Syncthing</td>
</tr>
<tr>
<td><strong>Reverse Proxy</strong></td>
<td>Caddy + Let&#8217;s Encrypt (DNS-01)</td>
</tr>
<tr>
<td><strong>Remote Access</strong></td>
<td>Tailscale mesh VPN</td>
</tr>
<tr>
<td><strong>Backups</strong></td>
<td>Daily DB dumps + BorgBackup + rclone cloud sync</td>
</tr>
<tr>
<td><strong>Cloud Storage</strong></td>
<td>rclone → Box (2×100GB) + Google Drive (25GB FUSE mount)</td>
</tr>
<tr>
<td><strong>Monitoring</strong></td>
<td>smartd + daily health checks</td>
</tr>
</tbody>
</table>
<p>Total cost: effectively $0 in new hardware. The server is quiet, draws minimal power, and serves media to every device in the house — plus anywhere I have Tailscale installed.</p>
<p>If you have an old desktop gathering dust, it&#8217;s more than capable of running this entire stack. The only thing I&#8217;d eventually add is a discrete GPU for Jellyfin transcoding and Immich ML — but honestly, direct play has been perfectly fine.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jphein.com/building-a-home-file-server-with-ubuntu-raid-docker-and-tailscale/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">12226</post-id>	</item>
		<item>
		<title>How to Route a VLAN Through a WireGuard VPN Exit Gateway with OpenWrt, AdGuard Home, and Azure</title>
		<link>https://jphein.com/how-to-route-a-vlan-through-a-wireguard-vpn-exit-gateway-with-openwrt-adguard-home-and-azure/</link>
					<comments>https://jphein.com/how-to-route-a-vlan-through-a-wireguard-vpn-exit-gateway-with-openwrt-adguard-home-and-azure/#respond</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Sun, 22 Mar 2026 06:45:18 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[adguard]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[OpenWRT]]></category>
		<category><![CDATA[vlan]]></category>
		<category><![CDATA[vpn]]></category>
		<category><![CDATA[wireguard]]></category>
		<guid isPermaLink="false">https://jphein.com/how-to-route-a-vlan-through-a-wireguard-vpn-exit-gateway-with-openwrt-adguard-home-and-azure/</guid>

					<description><![CDATA[The Goal Route an entire VLAN through a WireGuard tunnel to an Azure VM, so every device on that network exits the internet from a cloud IP — with ad blocking, DNS encryption, and a kill switch. No split tunneling, no DNS leaks, no IPv6 leaks. The result: connect to a dedicated &#8220;vpn&#8221; WiFi SSID [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>The Goal</h2>
<p>Route an entire VLAN through a WireGuard tunnel to an Azure VM, so every device on that network exits the internet from a cloud IP — with ad blocking, DNS encryption, and a kill switch. No split tunneling, no DNS leaks, no IPv6 leaks.</p>
<p>The result: connect to a dedicated &#8220;vpn&#8221; WiFi SSID at home, and all your traffic exits through Azure. Disconnect, and you are back on your normal internet. Simple for the user, robust underneath.</p>
<h2>Architecture</h2>
<pre>
Devices on VLAN 9 ("vpn" WiFi)
       ↓ (policy routing)
OpenWrt router (gatekeeper) ──WireGuard──→ Azure VM (gig)
       ↓                                      ↓
  AdGuard Home (LAN DNS)              AdGuard Home (VPN DNS)
  Cloudflare DoT upstream             Cloudflare DoT upstream
</pre>
<p><strong>Key components:</strong></p>
<ul>
<li><strong>gatekeeper</strong> — OpenWrt 24.10 router (x86, i7, 16GB RAM) handling all VLANs, firewall, and policy routing</li>
<li><strong>gig</strong> — Azure Ubuntu 24.04 VM acting as the WireGuard exit node</li>
<li><strong>VLAN 9</strong> — Dedicated VPN network (10.0.9.0/24) with its own WiFi SSID, DHCP, and firewall zone</li>
<li><strong>AdGuard Home</strong> — Network-wide ad blocking on both ends, with encrypted DNS upstream</li>
</ul>
<h2>Step 1: WireGuard Tunnel</h2>
<h3>Azure VM (gig)</h3>
<p>Install WireGuard and enable IP forwarding:</p>
<pre>
sudo apt install wireguard
sudo sysctl -w net.ipv4.ip_forward=1
echo "net.ipv4.ip_forward=1" | sudo tee -a /etc/sysctl.conf
</pre>
<p>Generate keys and create <code>/etc/wireguard/wg0.conf</code>:</p>
<pre>
[Interface]
Address = 10.5.34.1/24
ListenPort = 51820
PrivateKey = &lt;server-private-key&gt;
PostUp = iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
# gatekeeper
PublicKey = &lt;gatekeeper-public-key&gt;
AllowedIPs = 10.5.34.10/32
</pre>
<p>Enable and start:</p>
<pre>
sudo systemctl enable wg-quick@wg0
sudo systemctl start wg-quick@wg0
</pre>
<p>Open UDP port 51820 in the Azure Network Security Group and in UFW:</p>
<pre>
sudo ufw allow 51820/udp
sudo ufw allow in on wg0 from 10.5.34.0/24
</pre>
<h3>OpenWrt Router (gatekeeper)</h3>
<p>Install WireGuard:</p>
<pre>
opkg update
opkg install wireguard-tools kmod-wireguard
</pre>
<p>Configure the interface via UCI:</p>
<pre>
uci set network.wireguardgig=interface
uci set network.wireguardgig.proto=wireguard
uci set network.wireguardgig.private_key=&lt;gatekeeper-private-key&gt;
uci add_list network.wireguardgig.addresses=10.5.34.10/24
uci set network.wireguardgig.mtu=1420
uci set network.wireguardgig.metric=90

uci add network wireguard_wireguardgig
uci set network.@wireguard_wireguardgig[-1].public_key=&lt;server-public-key&gt;
uci set network.@wireguard_wireguardgig[-1].endpoint_host=&lt;your-vm-hostname&gt;
uci set network.@wireguard_wireguardgig[-1].endpoint_port=51820
uci set network.@wireguard_wireguardgig[-1].persistent_keepalive=25
uci add_list network.@wireguard_wireguardgig[-1].allowed_ips=0.0.0.0/0

uci commit network
/etc/init.d/network restart
</pre>
<p><strong>Important:</strong> Add a static route to pin the WireGuard endpoint through your real WAN, so the tunnel does not try to route itself through itself:</p>
<pre>
uci add network route
uci set network.@route[-1].interface=wan
uci set network.@route[-1].target=&lt;azure-vm-public-ip&gt;/32
uci set network.@route[-1].gateway=&lt;your-wan-gateway&gt;
uci commit network
</pre>
<h2>Step 2: VLAN 9 and Policy Routing</h2>
<p>Create a dedicated VPN network on VLAN 9. On OpenWrt:</p>
<pre>
# Bridge and VLAN interface
uci set network.vpn=interface
uci set network.vpn.proto=static
uci set network.vpn.ipaddr=10.0.9.1
uci set network.vpn.netmask=255.255.255.0
uci set network.vpn.device=br-lan.9
</pre>
<p>Set up policy routing so VLAN 9 traffic uses the WireGuard tunnel instead of the normal WAN:</p>
<pre>
# Default route through tunnel in table 2
uci add network route
uci set network.@route[-1].interface=wireguardgig
uci set network.@route[-1].target=0.0.0.0/0
uci set network.@route[-1].table=2

# Rule: traffic from VPN zone uses table 2
uci add network rule
uci set network.@rule[-1].src=10.0.9.0/24
uci set network.@rule[-1].lookup=2

uci commit network
/etc/init.d/network restart
</pre>
<p>Devices on VLAN 9 now exit through Azure. Devices on every other VLAN are unaffected.</p>
<h2>Step 3: Firewall — Kill Switch and Leak Prevention</h2>
<p>The firewall is critical. If the tunnel drops, VPN traffic must NOT fall back to the regular WAN.</p>
<pre>
# VPN zone — devices on VLAN 9
uci add firewall zone
uci set firewall.@zone[-1].name=vpn
uci set firewall.@zone[-1].input=REJECT
uci set firewall.@zone[-1].output=ACCEPT
uci set firewall.@zone[-1].forward=REJECT
uci add_list firewall.@zone[-1].network=vpn

# WAN guard zone — the WireGuard tunnel exit
uci add firewall zone
uci set firewall.@zone[-1].name=wanguard
uci set firewall.@zone[-1].input=REJECT
uci set firewall.@zone[-1].output=ACCEPT
uci set firewall.@zone[-1].forward=REJECT
uci add_list firewall.@zone[-1].network=wireguardgig
uci set firewall.@zone[-1].masq=1
uci set firewall.@zone[-1].mtu_fix=1

# Only forwarding: vpn → wanguard (kill switch)
uci add firewall forwarding
uci set firewall.@forwarding[-1].src=vpn
uci set firewall.@forwarding[-1].dest=wanguard

# Allow DNS and DHCP into VPN zone
# ... (DNS on port 53, DHCP on port 67)

# Drop all IPv6 from VPN zone
uci add firewall rule
uci set firewall.@rule[-1].name=VPN-Drop-IPv6
uci set firewall.@rule[-1].src=vpn
uci set firewall.@rule[-1].family=ipv6
uci set firewall.@rule[-1].proto=all
uci set firewall.@rule[-1].target=DROP

uci commit firewall
/etc/init.d/firewall restart
</pre>
<p>There is no <code>vpn → wan</code> forwarding. If the tunnel is down, traffic is dropped — not leaked.</p>
<h2>Step 4: DNS — No Leaks, With Ad Blocking</h2>
<p>DNS is the most common VPN leak. We handle it in layers.</p>
<h3>AdGuard Home on gig (VPN DNS)</h3>
<p>Install AdGuard Home on the Azure VM, listening only on the WireGuard address:</p>
<pre>
curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh
</pre>
<p>Configure via the web UI at <code>http://10.5.34.1:3000</code>:</p>
<ul>
<li>DNS listen address: <code>10.5.34.1:53</code></li>
<li>Upstream DNS: <code>tls://1.1.1.1</code> and <code>tls://1.0.0.1</code> (Cloudflare DNS-over-TLS)</li>
<li>Enable DNSSEC and optimistic caching</li>
<li>Enable the AdGuard DNS filter (~163K rules), AdAway, and Peter Lowe blocklists</li>
</ul>
<p>Both the web UI and DNS are bound to the WireGuard interface only — not accessible from the public internet.</p>
<h3>AdGuard Home on gatekeeper (LAN DNS)</h3>
<p>Install from opkg and configure to listen on <code>127.0.0.1:5353</code>, then point dnsmasq at it:</p>
<pre>
opkg install adguardhome

# Point dnsmasq at AdGuard Home instead of Stubby
uci add_list dhcp.@dnsmasq[0].server='127.0.0.1#5353'
uci set dhcp.@dnsmasq[0].noresolv=1
uci commit dhcp
/etc/init.d/dnsmasq restart
</pre>
<p>This replaces Stubby — AdGuard Home handles DNS-over-TLS upstream natively. The DNS chain becomes: <code>dnsmasq (:53) → AdGuard Home (:5353) → Cloudflare DoT</code>.</p>
<h3>DHCP: Force VPN Clients to Use Tunnel DNS</h3>
<pre>
uci set dhcp.vpn.dhcp_option='6,10.5.34.1'
uci commit dhcp
</pre>
<p>VPN clients receive <code>10.5.34.1</code> as their DNS server. Since this IP is on the WireGuard subnet, all DNS queries go through the tunnel to AdGuard Home on gig.</p>
<h3>DNS Intercept: Catch Hardcoded DNS</h3>
<p>Some devices (Chromecast, Android) ignore DHCP and hardcode DNS servers like 8.8.8.8. A firewall DNAT redirect catches them:</p>
<pre>
uci add firewall redirect
uci set firewall.@redirect[-1].target=DNAT
uci set firewall.@redirect[-1].name='Intercept DNS VPN'
uci set firewall.@redirect[-1].src=vpn
uci set firewall.@redirect[-1].src_dport=53
uci set firewall.@redirect[-1].dest=wanguard
uci set firewall.@redirect[-1].dest_ip=10.5.34.1
uci set firewall.@redirect[-1].dest_port=53
uci set firewall.@redirect[-1].proto='tcp udp'
uci commit firewall
/etc/init.d/firewall restart
</pre>
<p>Any DNS query leaving the VPN zone gets redirected to AdGuard Home on gig, through the tunnel. No exceptions.</p>
<h3>IPv6 Leak Prevention</h3>
<p>IPv6 can leak your real address even when IPv4 is tunneled. Disable it at four layers:</p>
<ol>
<li><strong>Sysctl:</strong> <code>net.ipv6.conf.br-lan/9.disable_ipv6=1</code></li>
<li><strong>DHCP:</strong> RA disabled, DHCPv6 disabled on VPN interface</li>
<li><strong>Firewall:</strong> DROP all IPv6 from VPN zone</li>
<li><strong>DHCP options:</strong> No IPv6 DNS servers advertised</li>
</ol>
<h2>Step 5: Performance Tuning</h2>
<p>Out of the box, the tunnel achieved ~305/332 Mbps (up/down). After tuning: ~390/453 Mbps.</p>
<h3>Both Sides</h3>
<ul>
<li><strong>BBR congestion control</strong> — Replaces CUBIC. Better throughput on high-latency links. <code>net.ipv4.tcp_congestion_control=bbr</code></li>
<li><strong>TCP buffer tuning</strong> — Scale rmem_max/wmem_max for the bandwidth-delay product</li>
<li><strong>ECN</strong> — Reduces retransmits. <code>net.ipv4.tcp_ecn=1</code></li>
<li><strong>MTU 1420</strong> — Standard for WireGuard over Ethernet</li>
</ul>
<h3>Azure VM (gig)</h3>
<ul>
<li><strong><code>fq</code> qdisc on eth0 and wg0</strong> — BBR needs a pacing-aware qdisc. Without it, BBR falls back to burst-based sending which causes buffer bloat</li>
<li><strong>TCP Fast Open</strong> — <code>net.ipv4.tcp_fastopen=3</code></li>
<li><strong>26MB socket buffers</strong> — Sized for the bandwidth-delay product of a ~12ms RTT gigabit link</li>
</ul>
<h3>OpenWrt Router (gatekeeper)</h3>
<ul>
<li><strong>CAKE SQM on the WAN link</strong> — 500/500 Mbps with <code>nat</code> and <code>ack-filter</code>. Prevents buffer bloat</li>
<li><strong>CAKE SQM on wireguardgig</strong> — Per-flow fairness inside the tunnel. Prevents one bulk download from starving interactive traffic</li>
<li><strong>RPS (Receive Packet Steering)</strong> — Spread softirq across all CPU cores. Persistent via <code>/etc/hotplug.d/net/99-rps</code></li>
</ul>
<h2>Step 6: Dedicated VPN WiFi SSID</h2>
<p>On an OpenWrt access point, create a 5GHz SSID that bridges to VLAN 9:</p>
<pre>
uci set wireless.vpn_5g=wifi-iface
uci set wireless.vpn_5g.device=radio2
uci set wireless.vpn_5g.mode=ap
uci set wireless.vpn_5g.ssid=vpn
uci set wireless.vpn_5g.encryption=psk2
uci set wireless.vpn_5g.key=&lt;your-password&gt;
uci set wireless.vpn_5g.network=vpn
uci commit wireless
wifi reload
</pre>
<p>The AP bridges the &#8220;vpn&#8221; SSID to VLAN 9. Connect to this SSID and all traffic routes through Azure.</p>
<h2>Verifying It Works</h2>
<p>From a device on the VPN WiFi:</p>
<pre>
# Check your exit IP — should be the Azure VM
curl ifconfig.me

# Check DNS — ad domains should be blocked
nslookup ads.google.com
# Expected: 127.0.0.1

# Check for DNS leaks at https://www.dnsleaktest.com
# Should show Cloudflare, not your ISP

# Check for IPv6 leaks at https://ipv6leak.com
# Should show no IPv6 connectivity
</pre>
<h2>Easy Ad Blocking Toggle</h2>
<p>AdGuard Home includes a web dashboard with a full query log. You can:</p>
<ul>
<li><strong>One-click whitelist</strong> any blocked domain from the query log</li>
<li><strong>Disable protection</strong> globally for 10 seconds, 30 seconds, 1 minute, etc.</li>
<li><strong>Per-client rules</strong> for different filtering per device</li>
</ul>
<p>Access the dashboards at:</p>
<ul>
<li>LAN: <code>http://&lt;router-ip&gt;:3000</code></li>
<li>VPN: <code>http://10.5.34.1:3000</code> (through the tunnel)</li>
</ul>
<p>For even quicker toggling, the <a href="https://adguard.com/en/adguard-browser-extension/overview.html">AdGuard Browser Extension</a> lets you disable filtering per-site from the toolbar.</p>
<h2>Summary</h2>
<table>
<tr>
<th>Layer</th>
<th>What</th>
</tr>
<tr>
<td>Tunnel</td>
<td>WireGuard, MTU 1420, BBR, 25s keepalive</td>
</tr>
<tr>
<td>Routing</td>
<td>VLAN 9 → policy route table 2 → wireguardgig</td>
</tr>
<tr>
<td>Kill switch</td>
<td>vpn → wanguard only, no vpn → wan forwarding</td>
</tr>
<tr>
<td>DNS</td>
<td>AdGuard Home on both ends, Cloudflare DoT upstream</td>
</tr>
<tr>
<td>DNS leak prevention</td>
<td>DHCP option 6 + DNAT intercept for hardcoded DNS</td>
</tr>
<tr>
<td>IPv6 leak prevention</td>
<td>Disabled at sysctl, DHCP, RA, and firewall</td>
</tr>
<tr>
<td>Ad blocking</td>
<td>~173K rules (AdGuard DNS + AdAway + Peter Lowe)</td>
</tr>
<tr>
<td>Performance</td>
<td>CAKE SQM, RPS, fq qdisc, tuned TCP buffers</td>
</tr>
<tr>
<td>Access</td>
<td>Dedicated 5GHz WiFi SSID — connect and go</td>
</tr>
</table>
<p>The whole setup was built and tuned in a single session with <a href="https://claude.com/claude-code">Claude Code</a> handling the configuration across both hosts simultaneously — SSH into the router and VM, running commands, testing, and fixing issues in real time.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jphein.com/how-to-route-a-vlan-through-a-wireguard-vpn-exit-gateway-with-openwrt-adguard-home-and-azure/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">12218</post-id>	</item>
		<item>
		<title>Hardening a WordPress Server with Claude Code</title>
		<link>https://jphein.com/hardening-a-wordpress-server-with-claude-code/</link>
					<comments>https://jphein.com/hardening-a-wordpress-server-with-claude-code/#respond</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Sun, 08 Mar 2026 16:23:35 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<guid isPermaLink="false">https://jphein.com/hardening-a-wordpress-server-with-claude-code/</guid>

					<description><![CDATA[The Problem I&#8217;ve been running jphein.com on a Google Cloud e2-micro instance since 2022. It started as a basic Docker Compose setup — WordPress, MySQL 5.7, and an nginx reverse proxy — with a backup script I wrote and mostly forgot about. Over time, things drifted: the auto-update script stopped working (silently!), legacy files accumulated, [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>The Problem</h2>
<p>I&#8217;ve been running jphein.com on a Google Cloud e2-micro instance since 2022. It started as a basic Docker Compose setup — WordPress, MySQL 5.7, and an nginx reverse proxy — with a backup script I wrote and mostly forgot about. Over time, things drifted: the auto-update script stopped working (silently!), legacy files accumulated, and MySQL 5.7 went end-of-life without me noticing.</p>
<p>I decided to use <a href="https://claude.com/claude-code">Claude Code</a> to audit and harden the entire setup. Here&#8217;s what we found and fixed in a single session.</p>
<h2>What Claude Code Found</h2>
<h3>Critical Issues</h3>
<ul>
<li><strong>Auto-update completely broken</strong> — The script ran Docker commands via cron, but the <code>jp</code> user wasn&#8217;t in the <code>docker</code> group. Every Sunday at 2am it would fail silently and report &#8220;completed successfully&#8221; because the pipe-to-while-read pattern swallowed all errors.</li>
<li><strong>MySQL 5.7 end-of-life</strong> — No security patches since October 2023. Running for over two years without updates.</li>
<li><strong>Restore script had a broken GRANT statement</strong> — <code>GRANT ALL ON wp_db.* TO @%</code> grants to nobody. If I ever needed to restore, the database user wouldn&#8217;t have access.</li>
<li><strong>MySQL port 3306 exposed to the internet</strong> — Docker bypasses UFW by default, so even though UFW didn&#8217;t have a rule for 3306, Docker&#8217;s own iptables chain was forwarding it publicly.</li>
</ul>
<h3>Security Gaps</h3>
<ul>
<li><strong>Zero HTTP security headers</strong> — No HSTS, no X-Frame-Options, no Content-Type-Options. The server was also broadcasting <code>X-Powered-By: PHP/8.3.30</code> to anyone who asked.</li>
<li><strong>Legacy files with hardcoded credentials</strong> — An old RDP launcher script (<code>acrobat</code>) containing a plaintext password was sitting in the web root since 2022, publicly accessible.</li>
<li><strong>WordPress port 8080 exposed</strong> — Same Docker-bypasses-UFW issue.</li>
</ul>
<h2>What We Fixed</h2>
<h3>Infrastructure</h3>
<ul>
<li><strong>MySQL 5.7 → 8.0.45</strong> — In-place upgrade. Required bumping <code>thread_stack</code> from 128K to 256K and removing deprecated <code>query_cache</code> settings. The upgrade ran automatically when the new container started.</li>
<li><strong>Custom WordPress Dockerfile</strong> — The old setup ran <code>apt-get install cron</code> on every container restart, which was slow and fragile (network-dependent). Now cron is baked into the image.</li>
<li><strong>Ports locked down</strong> — MySQL and WordPress ports bound to <code>127.0.0.1</code> in docker-compose. Port 8080 removed from UFW.</li>
</ul>
<h3>Security</h3>
<ul>
<li><strong>nginx security headers</strong> — Added Strict-Transport-Security, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, and Permissions-Policy. Stripped X-Powered-By.</li>
<li><strong>Removed 9 legacy files</strong> from the web root — test scripts, old LTSP launchers, a Duplicator backup, and the credential-leaking <code>acrobat</code> file.</li>
<li><strong>Removed 4 inactive plugins</strong> — Each unused plugin is unnecessary attack surface.</li>
</ul>
<h3>Reliability</h3>
<ul>
<li><strong>Rewrote auto-update script</strong> — Docker access pre-flight check, proper error capture (no more pipe-swallowing), warning tracking in email reports.</li>
<li><strong>Fixed restore script</strong> — Correct GRANT syntax with proper username and password.</li>
<li><strong>Added <code>set -uo pipefail</code></strong> to the backup script.</li>
<li><strong>Set up email alerts</strong> — Installed msmtp with Gmail SMTP so backup failures and update reports actually reach my inbox instead of printing to a log file nobody reads.</li>
</ul>
<h3>Housekeeping</h3>
<ul>
<li><strong>Trimmed backups from 12 to 6 months</strong> — Reduced GCS storage from 20 GB to 11 GB. Six months of daily restore points is plenty for a personal site.</li>
<li><strong>Cleaned Docker images, WP cache, old logs</strong> — Freed about 900 MB on disk.</li>
</ul>
<h2>Current Architecture</h2>
<pre>
Internet → Cloudflare → SWAG (nginx + Let's Encrypt)
                            ↓
                     WordPress (PHP 8.3, custom Dockerfile)
                            ↓
                     MySQL 8.0 (localhost only)

Backups: daily incremental to GCS via duplicity (6 months retention)
Updates: weekly via WP-CLI + Docker pull + apt upgrade
Alerts:  msmtp → Gmail
Access:  Tailscale only (no public SSH)
</pre>
<h2>Lessons Learned</h2>
<ol>
<li><strong>Silent failures are the worst kind.</strong> The auto-update script &#8220;worked&#8221; for months while doing nothing. Always check that your monitoring actually detects failures — pipe-to-while-read in bash swallows exit codes.</li>
<li><strong>Docker bypasses UFW.</strong> If you expose a port in docker-compose, it&#8217;s public regardless of your firewall rules. Always bind to <code>127.0.0.1</code> for services that don&#8217;t need external access.</li>
<li><strong>Test your restore.</strong> A backup you can&#8217;t restore from is worthless. My GRANT statement was broken — I would have discovered this at the worst possible time.</li>
<li><strong>EOL software is a ticking clock.</strong> MySQL 5.7 was EOL for over two years. Set a calendar reminder when your database engine reaches end-of-life.</li>
</ol>
<p>The whole audit and remediation took about an hour with Claude Code doing the heavy lifting — reading configs, running tests, making changes, and verifying everything worked after each step.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jphein.com/hardening-a-wordpress-server-with-claude-code/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">12207</post-id>	</item>
		<item>
		<title>How to Host WordPress for Free with GCP and Docker — The Complete Guide</title>
		<link>https://jphein.com/how-to-host-wordpress-for-free-with-gcp-and-docker/</link>
					<comments>https://jphein.com/how-to-host-wordpress-for-free-with-gcp-and-docker/#respond</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Tue, 24 Feb 2026 02:36:35 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<guid isPermaLink="false">https://jphein.com/how-to-host-wordpress-for-free-with-gcp-and-docker/</guid>

					<description><![CDATA[A practical guide to running a personal WordPress site on Google Cloud&#8217;s Always Free tier using Docker Compose, automatic SSL, security hardening, email alerts, and daily backups to cloud storage — all at zero cost. What you&#8217;ll end up with: WordPress + MySQL 8.0 + nginx/SSL running in Docker on a free GCP VM Automatic [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>A practical guide to running a personal WordPress site on Google Cloud&#8217;s Always Free tier using Docker Compose, automatic SSL, security hardening, email alerts, and daily backups to cloud storage — all at zero cost.</p>
<p><strong>What you&#8217;ll end up with:</strong></p>
<ul>
<li>WordPress + MySQL 8.0 + nginx/SSL running in Docker on a free GCP VM</li>
<li>Automatic HTTPS via Let&#8217;s Encrypt (auto-renewing)</li>
<li>Security headers, localhost-only port bindings, and a hardened nginx config</li>
<li>Daily incremental backups to a free GCS bucket (~6 months of history)</li>
<li>Email alerts when backups fail</li>
<li>Automated weekly updates for WordPress, Docker images, and OS packages</li>
<li>SSH locked down via Tailscale — port 22 closed to the public internet</li>
<li>~$0/month, indefinitely</li>
</ul>
<p><strong>What this costs:</strong> Nothing. GCP&#8217;s Always Free tier covers the VM, and the GCS bucket stays free as long as you keep it under 5 GB (backups for a small site are well under that).</p>
<hr />
<h2>Table of Contents</h2>
<ol>
<li><a href="#1-prerequisites">Prerequisites</a></li>
<li><a href="#2-create-the-gcp-vm">Create the GCP VM</a></li>
<li><a href="#3-lock-down-ssh-with-tailscale">Lock down SSH with Tailscale</a></li>
<li><a href="#4-tune-ubuntu-for-1-gb-ram">Tune Ubuntu for 1 GB RAM</a></li>
<li><a href="#5-point-your-domain-at-the-vm-with-cloudflare">Point your domain at the VM with Cloudflare</a></li>
<li><a href="#6-install-docker">Install Docker</a></li>
<li><a href="#7-create-the-site-directory">Create the site directory</a></li>
<li><a href="#8-write-the-config-files">Write the config files</a></li>
<li><a href="#9-start-the-stack">Start the stack</a></li>
<li><a href="#10-finish-wordpress-setup">Finish WordPress setup</a></li>
<li><a href="#11-set-up-email-alerts">Set up email alerts</a></li>
<li><a href="#12-set-up-backups">Set up backups</a></li>
<li><a href="#13-set-up-auto-updates">Set up auto-updates</a></li>
<li><a href="#14-maintenance">Maintenance</a></li>
<li><a href="#15-how-the-memory-budget-works">How the memory budget works</a></li>
<li><a href="#16-troubleshooting">Troubleshooting</a></li>
</ol>
<hr />
<h2 id="1-prerequisites">1. Prerequisites</h2>
<ul>
<li>A <strong>Google account</strong> (for GCP and Google Cloud Storage)</li>
<li>A <strong>domain name</strong> you control (e.g. from Namecheap, Google Domains, Cloudflare, etc.)</li>
<li>A <strong>Tailscale account</strong> — free at <a href="https://tailscale.com">tailscale.com</a> (up to 100 devices)</li>
<li>A <strong>Gmail account</strong> with an app password (for email alerts)</li>
<li>Basic comfort with a Linux terminal</li>
</ul>
<hr />
<h2 id="2-create-the-gcp-vm">2. Create the GCP VM</h2>
<p>GCP&#8217;s <strong>Always Free</strong> tier includes one <code>e2-micro</code> instance per month in certain US regions, forever — no credit card charges as long as you stay within the limits.</p>
<h3>Create the instance</h3>
<ol>
<li>Go to <a href="https://console.cloud.google.com">console.cloud.google.com</a> → <strong>Compute Engine</strong> → <strong>VM instances</strong> → <strong>Create instance</strong></li>
<li>Set:
<ul>
<li><strong>Name:</strong> anything (e.g. <code>wordpress-server</code>)</li>
<li><strong>Region:</strong> <code>us-east1</code>, <code>us-west1</code>, or <code>us-central1</code> (required for Always Free)</li>
<li><strong>Machine type:</strong> <code>e2-micro</code> (2 vCPU, 1 GB RAM)</li>
<li><strong>Boot disk:</strong> Ubuntu 22.04 LTS, 30 GB standard persistent disk</li>
</ul>
</li>
<li>Under <strong>Firewall</strong>, check both <strong>Allow HTTP traffic</strong> and <strong>Allow HTTPS traffic</strong></li>
<li>Click <strong>Create</strong></li>
</ol>
<blockquote>
<p>The 30 GB disk is within the Always Free 30 GB/month standard disk limit. Do not use SSD — only standard persistent disk is free.</p>
</blockquote>
<h3>Note your external IP</h3>
<p>Once created, copy the <strong>External IP</strong> from the VM list. You&#8217;ll need it for DNS.</p>
<h3>Open SSH for initial setup</h3>
<p>Click <strong>SSH</strong> in the GCP console to open a browser terminal. You&#8217;ll use this for the next step (installing Tailscale), after which you can close public SSH permanently.</p>
<hr />
<h2 id="3-lock-down-ssh-with-tailscale">3. Lock down SSH with Tailscale</h2>
<p>Port 22 open to the internet is the single most-scanned port on any public server. Tailscale gives you a private encrypted network between your devices — SSH stays open on that network and closed to everyone else.</p>
<h3>Install Tailscale on the VM</h3>
<p>In the GCP browser SSH terminal:</p>
<pre><code class="language-bash">curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
</code></pre>
<p><code>tailscale up</code> prints an authentication URL. Open it in your browser, log in with your Tailscale account, and the VM will appear in your Tailscale admin console.</p>
<p>Get the VM&#8217;s Tailscale IP (always in the <code>100.x.x.x</code> range):</p>
<pre><code class="language-bash">tailscale ip -4
</code></pre>
<h3>Install Tailscale on your local machine</h3>
<p>Download from <a href="https://tailscale.com/download">tailscale.com/download</a> for macOS, Windows, or Linux and sign in with the same account. Both devices will now be on your private Tailscale network.</p>
<h3>Test SSH over Tailscale before closing the public port</h3>
<p>From your local machine:</p>
<pre><code class="language-bash">ssh your-username@100.x.x.x   # use the Tailscale IP from above
</code></pre>
<p>Confirm this works before the next step.</p>
<h3>Close port 22 in GCP&#8217;s firewall</h3>
<p>In the GCP console:</p>
<ol>
<li>Go to <strong>VPC network → Firewall</strong></li>
<li>Find the rule named <code>default-allow-ssh</code> (allows TCP port 22 from <code>0.0.0.0/0</code>)</li>
<li>Click it → <strong>Delete</strong> (or <strong>Disable</strong> if you want to re-enable it later)</li>
</ol>
<p>Port 22 is now closed to the public internet. Your Tailscale SSH connection still works because Tailscale operates over UDP 41641 (or falls back to HTTPS), not port 22.</p>
<blockquote>
<p><strong>GCP console SSH still works.</strong> The browser SSH button in the GCP console uses IAP (Identity-Aware Proxy), which tunnels through Google&#8217;s internal network — it does not go through the public firewall rule you just removed.</p>
</blockquote>
<h3>Optional: restrict sshd to the Tailscale interface</h3>
<p>For maximum hardening, tell sshd to only listen on the Tailscale interface:</p>
<pre><code class="language-bash"># Find the Tailscale interface name (usually tailscale0)
ip link show | grep tailscale

# Add to /etc/ssh/sshd_config:
echo "ListenAddress 100.x.x.x" | sudo tee -a /etc/ssh/sshd_config

sudo systemctl restart ssh
</code></pre>
<p>Replace <code>100.x.x.x</code> with your actual Tailscale IP. After this, <code>ssh</code> to the public IP will simply time out even if the firewall rule were ever re-enabled.</p>
<hr />
<h2 id="4-tune-ubuntu-for-1-gb-ram">4. Tune Ubuntu for 1 GB RAM</h2>
<p>A fresh Ubuntu 22.04 install on GCP is not optimised for a memory-constrained server. These steps reclaim memory and prevent a few common failure modes before you install anything.</p>
<h3>Create a swap file</h3>
<p>The e2-micro has 1 GB of RAM. Without swap, a single memory spike from Docker pulling a new image or WordPress processing a large upload can OOM-kill a container. A swap file is cheap insurance.</p>
<pre><code class="language-bash"># Check whether swap already exists
swapon --show

# If nothing is listed, create a 4 GB swap file
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

# Make it permanent across reboots
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
</code></pre>
<h3>Reduce swappiness</h3>
<p>The default <code>vm.swappiness</code> of 60 tells the kernel to move pages to swap aggressively. On a server where you want RAM for active processes, 10 is better — use swap as a last resort, not a first choice:</p>
<pre><code class="language-bash">echo 'vm.swappiness=10' | sudo tee /etc/sysctl.d/99-tuning.conf
sudo sysctl -p /etc/sysctl.d/99-tuning.conf

# Verify
cat /proc/sys/vm/swappiness   # should print 10
</code></pre>
<h3>Cap the systemd journal size</h3>
<p>By default journald keeps logs until the disk is 10% full. On a 30 GB boot disk that means up to 3 GB of logs — a significant chunk of your free space. Cap it:</p>
<pre><code class="language-bash">sudo mkdir -p /etc/systemd/journald.conf.d

sudo tee /etc/systemd/journald.conf.d/size.conf > /dev/null <<'EOF'
[Journal]
SystemMaxUse=200M
RuntimeMaxUse=50M
EOF

sudo systemctl restart systemd-journald

# Vacuum logs that are already over the new limit
sudo journalctl --vacuum-size=200M
</code></pre>
<h3>Disable services you don't need</h3>
<p><strong>multipathd</strong> — manages multipath block devices (SANs, iSCSI). Irrelevant on a GCP VM:</p>
<pre><code class="language-bash">sudo systemctl disable --now multipathd
</code></pre>
<p><strong>rsyslog</strong> — a second logging daemon that duplicates what journald already does. Ubuntu installs both by default:</p>
<pre><code class="language-bash">sudo systemctl disable --now rsyslog
</code></pre>
<p><strong>LXD</strong> — a full VM and container manager installed via snap. Not needed when you're using Docker:</p>
<pre><code class="language-bash">sudo snap remove lxd
</code></pre>
<p>Removing LXD also removes the <code>core18</code> and <code>core20</code> snap bases it depended on, freeing several hundred MB of disk space.</p>
<h3>Set up UFW firewall</h3>
<p>UFW provides a local firewall layer in addition to GCP's network firewall — defense in depth:</p>
<pre><code class="language-bash">sudo ufw allow 22/tcp    # SSH (Tailscale access)
sudo ufw allow 80/tcp    # HTTP (Let's Encrypt + redirect)
sudo ufw allow 443/tcp   # HTTPS
sudo ufw allow 51820/udp # Tailscale (WireGuard)
sudo ufw enable
</code></pre>
<h3>Verify memory after tuning</h3>
<pre><code class="language-bash">free -h
sudo docker stats --no-stream   # run after Docker is installed
</code></pre>
<p>At idle you should see roughly 200 MB used by the OS, leaving ~750 MB for your containers.</p>
<hr />
<h2 id="5-point-your-domain-at-the-vm-with-cloudflare">5. Point your domain at the VM with Cloudflare</h2>
<p><a href="https://cloudflare.com">Cloudflare</a> is the recommended DNS provider for this setup. The free tier gives you DNS, DDoS protection, and a CDN — all at no cost. You just point your domain's nameservers at Cloudflare instead of your registrar.</p>
<h3>Add your site to Cloudflare</h3>
<ol>
<li>Sign up at <a href="https://cloudflare.com">cloudflare.com</a> and click <strong>Add a site</strong></li>
<li>Enter your domain and select the <strong>Free</strong> plan</li>
<li>Cloudflare will scan your existing DNS records. Review and continue.</li>
<li>Cloudflare gives you two nameservers, e.g.:<br />
   <code>arlo.ns.cloudflare.com<br />
   june.ns.cloudflare.com</code></li>
<li>Log into your domain registrar and replace its nameservers with the two Cloudflare ones</li>
<li>Click <strong>Done</strong> in Cloudflare — propagation takes a few minutes to a few hours</li>
</ol>
<h3>Add DNS records</h3>
<p>In the Cloudflare dashboard under <strong>DNS → Records</strong>, add:</p>
<pre><code>Type: A    Name: @    IPv4: YOUR_VM_IP
Type: A    Name: www  IPv4: YOUR_VM_IP
</code></pre>
<h3>Proxy toggle: orange cloud vs grey cloud</h3>
<p>Each DNS record has a <strong>Proxy status</strong> toggle — the orange cloud icon:</p>
<table>
<thead>
<tr>
<th>Setting</th>
<th>What it means</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Proxied</strong> (orange cloud)</td>
<td>Traffic flows through Cloudflare's CDN. Hides your VM's real IP, adds DDoS protection and caching. <strong>Recommended.</strong></td>
</tr>
<tr>
<td><strong>DNS only</strong> (grey cloud)</td>
<td>Cloudflare is just DNS. Traffic goes directly to your VM.</td>
</tr>
</tbody>
</table>
<p><strong>Use proxied (orange cloud).</strong> It's one of the main reasons to use Cloudflare.</p>
<blockquote>
<p>Let's Encrypt HTTP-01 validation works fine through the Cloudflare proxy — swag handles it automatically.</p>
</blockquote>
<h3>Set Cloudflare SSL/TLS mode to Full</h3>
<p>This is a required step when using the orange cloud proxy.</p>
<p>In Cloudflare: <strong>SSL/TLS → Overview</strong> → select <strong>Full</strong> (not Flexible, not Full Strict).</p>
<ul>
<li><strong>Flexible</strong> — Cloudflare encrypts to visitors but sends plain HTTP to your server. Broken with swag.</li>
<li><strong>Full</strong> — Cloudflare encrypts both legs. Works correctly with swag's Let's Encrypt cert.</li>
<li><strong>Full (Strict)</strong> — Same as Full but validates the origin cert against a CA. Also works, but requires the Let's Encrypt cert to be valid before you can turn this on.</li>
</ul>
<h3>Verify DNS before starting the stack</h3>
<p>Let's Encrypt needs the domain to resolve before it can issue a certificate:</p>
<pre><code class="language-bash">dig +short yourdomain.com
# Should return a Cloudflare IP (not your VM IP — that's expected when proxied)

# Test that port 80 reaches your server through Cloudflare
curl -I http://yourdomain.com
</code></pre>
<hr />
<h2 id="6-install-docker">6. Install Docker</h2>
<p>SSH into your VM and run:</p>
<pre><code class="language-bash"># Install dependencies
sudo apt update && sudo apt install -y ca-certificates curl gnupg

# Add Docker's official GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
    | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

# Add the Docker apt repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
    https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
    | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Install Docker Engine and Compose plugin
sudo apt update && sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

# Add your user to the docker group (needed for cron scripts)
sudo usermod -aG docker $USER

# Verify
sudo docker compose version
</code></pre>
<p><strong>Important:</strong> always use <code>docker compose</code> (with a space, V2). The old <code>docker-compose</code> hyphenated command is a separate, outdated Python tool that is incompatible with modern Docker image formats.</p>
<p><strong>Important:</strong> adding your user to the <code>docker</code> group lets cron-scheduled scripts (backup, auto-update) access Docker without <code>sudo</code>. Log out and back in for the group change to take effect.</p>
<hr />
<h2 id="7-create-the-site-directory">7. Create the site directory</h2>
<pre><code class="language-bash">mkdir -p ~/mysite/{www,config}
mkdir -p ~/mysqldump
cd ~/mysite
</code></pre>
<p>Your layout will be:</p>
<pre><code>~/mysite/
├── docker-compose.yml
├── wordpress.Dockerfile   # Custom WordPress image with cron
├── default.conf           # nginx config with security headers
├── custom.ini             # PHP overrides
├── mpm_prefork.conf       # Apache worker tuning
├── mysql.cnf              # MySQL 8.0 low-memory tuning
├── .env                   # Secrets (gitignored)
├── config/                # swag runtime data (SSL certs, nginx state)
└── www/                   # WordPress files

~/mysqldump/
└── database.sql           # daily MySQL dump (written by backup script)
</code></pre>
<hr />
<h2 id="8-write-the-config-files">8. Write the config files</h2>
<p>Create each file below. Replace <code>yourdomain.com</code> and <code>you@example.com</code> throughout.</p>
<h3><code>.env</code> (secrets)</h3>
<p>Keep passwords out of your compose file. Generate strong random passwords:</p>
<pre><code class="language-bash">cat > .env <<'EOF'
MYSQL_ROOT_PASSWORD=CHANGE_ME_USE_openssl_rand_base64_16
MYSQL_PASSWORD=CHANGE_ME_USE_openssl_rand_base64_16
MYSQL_DATABASE=wp_db
MYSQL_USER=wp_db_user
EOF
chmod 600 .env
</code></pre>
<h3><code>docker-compose.yml</code></h3>
<p>This defines three containers: <strong>swag</strong> (nginx + SSL), <strong>wordpress</strong> (Apache + PHP), and <strong>db</strong> (MySQL 8.0). All have memory limits to stay within the 1 GB budget. Ports are bound to <code>127.0.0.1</code> to prevent Docker from bypassing your firewall.</p>
<pre><code class="language-yaml">services:

  swag:
    image: linuxserver/swag
    container_name: swag
    restart: always
    depends_on:
      - wordpress
    volumes:
      - ./config:/config
      - ./default.conf:/config/nginx/site-confs/default.conf
    environment:
      - EMAIL=you@example.com
      - URL=yourdomain.com
      - VALIDATION=http
      - TZ=America/Los_Angeles
      - PUID=1000
      - PGID=1000
    ports:
      - "443:443"
      - "80:80"
    mem_limit: 128m

  wordpress:
    build:
      context: .
      dockerfile: wordpress.Dockerfile
    container_name: wordpress
    hostname: wordpress
    depends_on:
      - db
    restart: always
    ports:
      - "127.0.0.1:8080:80"
    volumes:
      - ./www/:/var/www/html/
      - ./custom.ini:/usr/local/etc/php/conf.d/custom.ini
      - ./mpm_prefork.conf:/etc/apache2/mods-available/mpm_prefork.conf
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: ${MYSQL_USER}
      WORDPRESS_DB_PASSWORD: ${MYSQL_PASSWORD}
      WORDPRESS_DB_NAME: ${MYSQL_DATABASE}
      WORDPRESS_CONFIG_EXTRA: |
        define( 'WP_MEMORY_LIMIT', '96M' );
    mem_limit: 300m

  db:
    image: mysql:8.0
    container_name: db
    volumes:
      - /var/lib/mysql:/var/lib/mysql
      - ./mysql.cnf:/etc/mysql/conf.d/lowmem.cnf
    restart: always
    ports:
      - "127.0.0.1:3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
      MYSQL_DATABASE: ${MYSQL_DATABASE}
      MYSQL_USER: ${MYSQL_USER}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}
    mem_limit: 128m
</code></pre>
<blockquote>
<p><strong>Why <code>127.0.0.1</code> on ports?</strong> Docker manipulates iptables directly, bypassing UFW. Without the <code>127.0.0.1:</code> prefix, ports 3306 and 8080 would be publicly accessible even if UFW blocks them. Binding to localhost ensures only local connections and the swag reverse proxy can reach these services.</p>
</blockquote>
<blockquote>
<p><strong>Why <code>/var/lib/mysql</code> on the host?</strong> Mounting the MySQL data directory directly on the host (rather than in a named Docker volume) means the database survives container removal and is easy to access for backups via <code>mysqldump</code>.</p>
</blockquote>
<h3><code>wordpress.Dockerfile</code></h3>
<p>A custom Dockerfile that pre-installs <code>cron</code> into the WordPress image. This avoids running <code>apt-get install</code> on every container restart, which is slow and fragile:</p>
<pre><code class="language-dockerfile">FROM wordpress:latest

RUN apt-get update && \
    apt-get install -y --no-install-recommends cron && \
    rm -rf /var/lib/apt/lists/*

RUN echo '* * * * * www-data php /var/www/html/index.php -- wpaicg_builder=yes' > /etc/cron.d/wp-cron && \
    chmod 0644 /etc/cron.d/wp-cron

CMD ["sh", "-c", "cron && docker-entrypoint.sh apache2-foreground"]
</code></pre>
<h3><code>default.conf</code> (nginx with security headers)</h3>
<p>Redirects HTTP → HTTPS, proxies everything to the WordPress container, and adds a full set of security headers:</p>
<pre><code class="language-nginx">server {
    listen 80;
    listen [::]:80;
    server_name _;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;

    root /var/www/html/example;
    index index.html index.htm index.php;

    server_name _;

    include /config/nginx/proxy-confs/*.subfolder.conf;
    include /config/nginx/ssl.conf;

    client_max_body_size 64m;

    # Security headers
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header Referrer-Policy "strict-origin-when-cross-origin" always;
    add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
    proxy_hide_header X-Powered-By;

    location / {
        try_files $uri $uri/ /index.php?$args @app;
    }

    location @app {
        proxy_pass http://wordpress;
        proxy_set_header Host $host;
        proxy_redirect off;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Real-IP $remote_addr;
    }
}
</code></pre>
<p>The security headers do the following:</p>
<table>
<thead>
<tr>
<th>Header</th>
<th>What it does</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>Strict-Transport-Security</code></td>
<td>Forces browsers to always use HTTPS for your domain</td>
</tr>
<tr>
<td><code>X-Content-Type-Options</code></td>
<td>Prevents browsers from MIME-type sniffing (blocks attacks that disguise scripts as images)</td>
</tr>
<tr>
<td><code>X-Frame-Options</code></td>
<td>Prevents your site from being embedded in iframes on other sites (clickjacking protection)</td>
</tr>
<tr>
<td><code>Referrer-Policy</code></td>
<td>Controls how much URL info is sent when users click links to other sites</td>
</tr>
<tr>
<td><code>Permissions-Policy</code></td>
<td>Explicitly disables access to camera, microphone, and geolocation APIs</td>
</tr>
<tr>
<td><code>proxy_hide_header X-Powered-By</code></td>
<td>Strips the PHP version header — less info for attackers</td>
</tr>
</tbody>
</table>
<h3><code>custom.ini</code> (PHP overrides)</h3>
<pre><code class="language-ini">file_uploads = On
memory_limit = 128M
upload_max_filesize = 64M
max_input_vars = 3000
post_max_size = 64M
max_execution_time = 600
</code></pre>
<h3><code>mpm_prefork.conf</code> (Apache worker limits)</h3>
<p>Apache's default settings spawn up to 150 workers. On a 1 GB VM each PHP worker uses ~30 MB, so the default would consume all available memory. Cap it at 4:</p>
<pre><code class="language-apache">&lt;IfModule mpm_prefork_module&gt;
    StartServers            2
    MinSpareServers         1
    MaxSpareServers         3
    MaxRequestWorkers       4
    MaxConnectionsPerChild  200
&lt;/IfModule&gt;
</code></pre>
<p>For a personal or low-traffic site, 4 concurrent requests is plenty. If you start seeing 503 errors under load, raise <code>MaxRequestWorkers</code> and bump the <code>mem_limit</code> in <code>docker-compose.yml</code>.</p>
<h3><code>mysql.cnf</code> (MySQL 8.0 memory tuning)</h3>
<p>MySQL's defaults assume a dedicated server with gigabytes of RAM. These settings bring it down to ~40 MB idle on a shared 1 GB host:</p>
<pre><code class="language-ini">[mysqld]
# InnoDB — default is 128M, 32M is plenty for a small WordPress site
innodb_buffer_pool_size         = 32M
innodb_log_file_size            = 8M
innodb_flush_method             = O_DIRECT

# Disabling performance_schema saves ~400MB at default settings
performance_schema              = OFF

# Reduce caches from their large defaults
table_open_cache                = 64
thread_cache_size               = 4
thread_stack                    = 256K

# Per-connection buffers (only allocated when in use)
read_buffer_size                = 128K
read_rnd_buffer_size            = 128K
sort_buffer_size                = 256K
join_buffer_size                = 256K
</code></pre>
<blockquote>
<p><strong>Note:</strong> <code>thread_stack</code> must be at least 256K for MySQL 8.0 (128K worked in 5.7 but causes stack overflows in 8.0). The <code>query_cache</code> settings from MySQL 5.7 have been removed entirely — MySQL 8.0 dropped the query cache feature.</p>
</blockquote>
<hr />
<h2 id="9-start-the-stack">9. Start the stack</h2>
<pre><code class="language-bash">cd ~/mysite
sudo docker compose up -d
</code></pre>
<p>Watch the logs to make sure everything comes up:</p>
<pre><code class="language-bash">sudo docker compose logs -f
</code></pre>
<p>On first start, <strong>swag</strong> will:</p>
<ol>
<li>Request a Let's Encrypt certificate for your domain (takes ~30 seconds)</li>
<li>Start nginx with HTTPS enabled</li>
</ol>
<p>You should see <code>mysqld: ready for connections</code> in the db logs and then the WordPress container come up. Once swag shows <code>Server ready</code>, visit <code>https://yourdomain.com</code>.</p>
<p>If Let's Encrypt fails, check that your DNS A record has propagated and that ports 80/443 are open in GCP's firewall.</p>
<hr />
<h2 id="10-finish-wordpress-setup">10. Finish WordPress setup</h2>
<p>Navigate to <code>https://yourdomain.com</code> — you'll see the WordPress installation wizard.</p>
<ol>
<li>Choose your language</li>
<li>Enter site title, admin username, password, and email</li>
<li>Click <strong>Install WordPress</strong></li>
</ol>
<p>You're done. Your site is live at <code>https://yourdomain.com</code> with a valid SSL certificate that renews automatically.</p>
<hr />
<h2 id="11-set-up-email-alerts">11. Set up email alerts</h2>
<p>Get notified when backups fail or updates have issues. We'll use <code>msmtp</code> — a lightweight SMTP client that sends through Gmail.</p>
<h3>Create a Gmail app password</h3>
<ol>
<li>Go to <a href="https://myaccount.google.com/apppasswords">myaccount.google.com/apppasswords</a></li>
<li>Select <strong>Mail</strong> and <strong>Other (custom name)</strong>, enter "Server alerts"</li>
<li>Copy the 16-character app password</li>
</ol>
<h3>Install and configure msmtp</h3>
<pre><code class="language-bash">sudo DEBIAN_FRONTEND=noninteractive apt install -y msmtp msmtp-mta
</code></pre>
<p>Create <code>~/.msmtprc</code>:</p>
<pre><code class="language-ini">defaults
auth           on
tls            on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile        ~/.msmtp.log

account        gmail
host           smtp.gmail.com
port           587
from           you@gmail.com
user           you@gmail.com
password       YOUR_APP_PASSWORD_HERE

account default : gmail
</code></pre>
<pre><code class="language-bash">chmod 600 ~/.msmtprc
</code></pre>
<p>Test it:</p>
<pre><code class="language-bash">echo "Test alert from $(hostname)" | msmtp you@gmail.com
</code></pre>
<p>The <code>msmtp-mta</code> package creates a <code>sendmail</code> symlink, so the backup and auto-update scripts can use <code>sendmail</code> to send alerts without any additional configuration.</p>
<hr />
<h2 id="12-set-up-backups">12. Set up backups</h2>
<p>This backup system dumps MySQL daily and backs up all site files to a Google Cloud Storage bucket using <code>duplicity</code> (incremental backups, ~6 months of history).</p>
<h3>Create a GCS bucket</h3>
<p>In the GCP console:</p>
<ol>
<li>Go to <strong>Cloud Storage</strong> → <strong>Create bucket</strong></li>
<li>Name it something unique (e.g. <code>mysite-backup-abc123</code>)</li>
<li><strong>Region:</strong> same region as your VM</li>
<li><strong>Storage class:</strong> Standard</li>
<li>Leave public access blocked</li>
</ol>
<p>The first 5 GB of GCS storage is free per month. A WordPress backup set is typically well under that.</p>
<h3>Install backup tools</h3>
<pre><code class="language-bash">sudo apt install -y duplicity python3-pip gcsfuse
</code></pre>
<p><code>gcsfuse</code> lets you mount the GCS bucket as a local filesystem so <code>duplicity</code> can write to it. Authentication uses the VM's service account automatically — no key file needed.</p>
<h3>Create directories</h3>
<pre><code class="language-bash">mkdir -p ~/backup-bucket   # GCS mount point
mkdir -p ~/mysqldump
</code></pre>
<h3>Write the backup script</h3>
<p>Save this as <code>~/backup</code> and make it executable (<code>chmod +x ~/backup</code>). Replace <code>YOUR_BUCKET_NAME</code> and <code>you@example.com</code>:</p>
<pre><code class="language-bash">#!/bin/bash
set -uo pipefail
#
# backup — daily backup for mysite
# Dumps MySQL, backs up ~/mysite to GCS via duplicity.
# Run as your regular user (NOT sudo) — gcsfuse needs user permissions.
# Schedule: 0 0 * * * ~/backup > ~/backup.log 2>&1
#

NOTIFY_EMAIL="you@example.com"
WD="$HOME"
BUCKET="YOUR_BUCKET_NAME"
BACKUP_DEST="file://$WD/backup-bucket/backups"

# Load database credentials from .env
source "$WD/mysite/.env"

log()  { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"; }

fail() {
    log "ERROR: $*"
    local msg="Backup failed on $(hostname) at $(date): $*"
    if command -v sendmail &>/dev/null; then
        printf "Subject: Backup FAILED\nTo: %s\n\n%s\n" "$NOTIFY_EMAIL" "$msg" \
            | sendmail "$NOTIFY_EMAIL"
    fi
    mount | grep -q "$WD/backup-bucket" && fusermount -u "$WD/backup-bucket"
    exit 1
}

log "Backup started"

# 1. Mount GCS bucket
if mount | grep -q "$WD/backup-bucket"; then
    log "Already mounted."
else
    gcsfuse "$BUCKET" "$WD/backup-bucket" || fail "gcsfuse mount failed"
fi

# 2. Dump MySQL
log "Dumping MySQL..."
mysqldump --opt -h localhost --protocol=tcp \
    --user="root" --password="$MYSQL_ROOT_PASSWORD" \
    "$MYSQL_DATABASE" > "$WD/mysqldump/database.sql" \
    || fail "mysqldump failed"
log "Dump size: $(du -sh $WD/mysqldump/database.sql | cut -f1)"

# 3. Clean up any incomplete previous backup
duplicity cleanup --force --no-encryption "$BACKUP_DEST" \
    || log "WARNING: cleanup returned non-zero (may be harmless)"

# 4. Incremental backup (full if last full is >1 month old)
log "Running duplicity backup..."
duplicity --progress --no-encryption \
    --exclude "$WD/backup-bucket" \
    --full-if-older-than 1M \
    "$WD" "$BACKUP_DEST" \
    || fail "duplicity failed"

# 5. Prune old chains — keep 6 fulls (~6 months)
duplicity remove-all-but-n-full 6 --force --no-encryption "$BACKUP_DEST" \
    || log "WARNING: prune returned non-zero (may be harmless)"

# 6. Unmount
fusermount -u "$WD/backup-bucket" || log "WARNING: unmount failed"

log "Backup completed successfully"
</code></pre>
<p>Key improvements over a basic backup script:</p>
<ul>
<li><code>set -uo pipefail</code> — catches unset variables and pipe failures</li>
<li>Credentials loaded from <code>.env</code> — no passwords hardcoded in the script</li>
<li>Email alerts on failure via <code>sendmail</code> (provided by msmtp)</li>
<li>6-month retention keeps backup size manageable (~11 GB for a typical WordPress site)</li>
</ul>
<p><strong>Important:</strong> Run the backup script as your regular user, not with <code>sudo</code>. Running as root causes <code>gcsfuse</code> permission issues because the mount point ownership changes.</p>
<p>Test it manually before scheduling:</p>
<pre><code class="language-bash">~/backup
cat ~/backup.log
</code></pre>
<hr />
<h2 id="13-set-up-auto-updates">13. Set up auto-updates</h2>
<p>Automate WordPress, Docker, and OS updates with a weekly script. Save this as <code>~/auto-update</code> and make it executable:</p>
<pre><code class="language-bash">#!/bin/bash
set -uo pipefail
#
# auto-update — weekly WordPress, Docker, and OS updates
# Run as your regular user (NOT sudo).
# Schedule: 0 2 * * 0 ~/auto-update > ~/auto-update.log 2>&1
#

NOTIFY_EMAIL="you@example.com"
SITE_DIR="$HOME/mysite"
COMPOSE="docker compose -f $SITE_DIR/docker-compose.yml"
SITE_URL="https://yourdomain.com"
HAD_ERRORS=false

log()  { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"; }
warn() { log "WARNING: $*"; HAD_ERRORS=true; }

# Load database credentials from .env
source "$SITE_DIR/.env"

wpcli() {
    docker run --rm \
        -v "$SITE_DIR/www":/var/www/html \
        --network mysite_default \
        -e WORDPRESS_DB_HOST=db \
        -e WORDPRESS_DB_USER="$MYSQL_USER" \
        -e WORDPRESS_DB_PASSWORD="$MYSQL_PASSWORD" \
        -e WORDPRESS_DB_NAME="$MYSQL_DATABASE" \
        wordpress:cli wp --allow-root "$@"
}

# Pre-flight: verify Docker access
docker info &>/dev/null || { log "ERROR: Cannot access Docker. Is $USER in the docker group?"; exit 1; }

# Verify site is up before starting
curl -sf "$SITE_URL" > /dev/null || { log "ERROR: Site is down before updates — aborting"; exit 1; }

log "Auto-update started"

# 1. WordPress updates via WP-CLI
log "Updating WordPress core..."
output=$(wpcli core update 2>&1) && log "$output" || warn "Core update issue: $output"

log "Updating plugins..."
output=$(wpcli plugin update --all 2>&1) && log "$output" || warn "Plugin update issue: $output"

log "Updating themes..."
output=$(wpcli theme update --all 2>&1) && log "$output" || warn "Theme update issue: $output"

# 2. Health check after WordPress updates
if ! curl -sf "$SITE_URL" > /dev/null; then
    warn "Site is DOWN after WordPress updates — skipping Docker/OS updates"
    # Send alert and exit
    if command -v sendmail &>/dev/null; then
        printf "Subject: Auto-update FAILED — site down\nTo: %s\n\n%s\n" \
            "$NOTIFY_EMAIL" "Site went down after WordPress updates. Check immediately." \
            | sendmail "$NOTIFY_EMAIL"
    fi
    exit 1
fi

# 3. Docker image updates
log "Pulling Docker images..."
$COMPOSE pull 2>&1 | while read -r line; do log "$line"; done
log "Recreating containers..."
$COMPOSE down && $COMPOSE up -d --build
sleep 15

# 4. OS updates
log "Running apt upgrade..."
sudo apt update -qq && sudo apt upgrade -y -qq 2>&1 | while read -r line; do log "$line"; done

# 5. Clean up
log "Pruning unused Docker images..."
docker image prune -f 2>&1 | while read -r line; do log "$line"; done

# 6. Send summary email
SUBJECT="Auto-update complete"
$HAD_ERRORS && SUBJECT="Auto-update complete (WARNINGS)"

if command -v sendmail &>/dev/null; then
    {
        printf "Subject: %s\nTo: %s\n\n" "$SUBJECT" "$NOTIFY_EMAIL"
        cat ~/auto-update.log
    } | sendmail "$NOTIFY_EMAIL"
fi

log "Auto-update finished"
</code></pre>
<h3>Schedule both scripts with cron</h3>
<pre><code class="language-bash">crontab -e
</code></pre>
<p>Add:</p>
<pre><code># Daily backup at midnight
0 0 * * * /home/YOUR_USERNAME/backup > /home/YOUR_USERNAME/backup.log 2>&1

# Weekly auto-update: Sundays at 2am
0 2 * * 0 /home/YOUR_USERNAME/auto-update > /home/YOUR_USERNAME/auto-update.log 2>&1
</code></pre>
<p><strong>Important:</strong> Both scripts must run as your regular user (not root). Your user must be in the <code>docker</code> group (<code>sudo usermod -aG docker $USER</code>).</p>
<hr />
<h2 id="14-maintenance">14. Maintenance</h2>
<h3>Check container status and memory</h3>
<pre><code class="language-bash">sudo docker compose -f ~/mysite/docker-compose.yml ps
sudo docker stats --no-stream
</code></pre>
<h3>View logs</h3>
<pre><code class="language-bash">sudo docker compose -f ~/mysite/docker-compose.yml logs --tail=50 db
sudo docker compose -f ~/mysite/docker-compose.yml logs --tail=50 wordpress
sudo docker compose -f ~/mysite/docker-compose.yml logs --tail=50 swag
</code></pre>
<h3>Restart a container</h3>
<pre><code class="language-bash">sudo docker compose -f ~/mysite/docker-compose.yml restart wordpress
</code></pre>
<h3>Update WordPress manually (plugins, themes, core)</h3>
<p>Easiest via the admin dashboard at <code>https://yourdomain.com/wp-admin</code>.</p>
<p>For command-line updates using WP-CLI (runs as a temporary container — nothing to install):</p>
<pre><code class="language-bash">wpcli() {
    sudo docker run --rm \
        -v ~/mysite/www:/var/www/html \
        --network mysite_default \
        -e WORDPRESS_DB_HOST=db \
        -e WORDPRESS_DB_USER=wp_db_user \
        -e WORDPRESS_DB_PASSWORD=YOUR_APP_DB_PASSWORD \
        -e WORDPRESS_DB_NAME=wp_db \
        wordpress:cli wp --allow-root "$@"
}

wpcli core version
wpcli core update
wpcli plugin update --all
wpcli theme update --all
</code></pre>
<h3>Update Docker images manually</h3>
<pre><code class="language-bash"># Pull latest images and rebuild
sudo docker compose -f ~/mysite/docker-compose.yml pull
sudo docker compose -f ~/mysite/docker-compose.yml down
sudo docker compose -f ~/mysite/docker-compose.yml up -d --build

# Clean up old images
sudo docker image prune -f
</code></pre>
<h3>Restore from backup</h3>
<p>To restore the database from the latest backup:</p>
<pre><code class="language-bash"># Mount bucket
gcsfuse YOUR_BUCKET_NAME ~/backup-bucket

# Extract the database dump
duplicity restore \
    --no-encryption \
    --file-to-restore mysqldump/database.sql \
    file://$HOME/backup-bucket/backups \
    /tmp/database.sql

# Import it
mysql -h localhost --protocol=tcp -u root -pYOUR_ROOT_DB_PASSWORD wp_db < /tmp/database.sql
</code></pre>
<p>To restore WordPress files or restore from a specific date, swap in the appropriate <code>--file-to-restore</code> path and add <code>--time "2025-06-01"</code>.</p>
<h3>SSL certificates</h3>
<p>Let's Encrypt certificates renew automatically inside the swag container. No action needed. To check renewal status:</p>
<pre><code class="language-bash">sudo docker logs swag 2>&1 | grep -i "cert\|renew\|expire" | tail -10
</code></pre>
<h3>OS updates</h3>
<pre><code class="language-bash">sudo apt update && sudo apt upgrade -y

# Check if a reboot is required
[ -f /var/run/reboot-required ] && echo "REBOOT NEEDED" || echo "No reboot needed"

# If a kernel update was installed — containers restart automatically via restart: always
sudo reboot
</code></pre>
<hr />
<h2 id="15-how-the-memory-budget-works">15. How the memory budget works</h2>
<p>The e2-micro has 1 GB RAM. Here's how it's allocated at idle:</p>
<table>
<thead>
<tr>
<th>Component</th>
<th>Idle usage</th>
<th>Hard limit</th>
</tr>
</thead>
<tbody>
<tr>
<td>OS + Docker daemon</td>
<td>~200 MB</td>
<td>—</td>
</tr>
<tr>
<td>swag (nginx)</td>
<td>~42 MB</td>
<td>128 MB</td>
</tr>
<tr>
<td>wordpress (Apache + PHP)</td>
<td>~142 MB</td>
<td>300 MB</td>
</tr>
<tr>
<td>db (MySQL 8.0)</td>
<td>~58 MB</td>
<td>128 MB</td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td><strong>~442 MB</strong></td>
<td><strong>~756 MB</strong></td>
</tr>
</tbody>
</table>
<p>This leaves ~250 MB of headroom before the 1 GB ceiling. Under load, Apache spawns up to 4 PHP workers (capped by <code>mpm_prefork.conf</code>), each using ~30 MB — so peak WordPress memory is around 250 MB, still under the 300 MB container limit.</p>
<p>If a container ever exceeds its <code>mem_limit</code>, the kernel OOM-kills it and Docker immediately restarts it (<code>restart: always</code>). Check with <code>sudo docker stats --no-stream</code> if the site feels slow.</p>
<p>The three biggest memory levers, in order of impact:</p>
<ol>
<li><strong><code>performance_schema = OFF</code></strong> in <code>mysql.cnf</code> — saves up to 400 MB</li>
<li><strong><code>MaxRequestWorkers 4</code></strong> in <code>mpm_prefork.conf</code> — caps Apache worker count</li>
<li><strong><code>innodb_buffer_pool_size = 32M</code></strong> in <code>mysql.cnf</code> — cuts InnoDB cache from 128 MB</li>
</ol>
<hr />
<h2 id="16-troubleshooting">16. Troubleshooting</h2>
<h3>"Error establishing a database connection"</h3>
<pre><code class="language-bash"># Check if the db container is running
sudo docker compose -f ~/mysite/docker-compose.yml ps

# If it's missing, start it
sudo docker compose -f ~/mysite/docker-compose.yml up -d db

# Check db logs for errors
sudo docker compose -f ~/mysite/docker-compose.yml logs --tail=30 db

# Test connection directly
mysql -h 127.0.0.1 -P 3306 -u root -pYOUR_ROOT_DB_PASSWORD -e "SELECT 1;"
</code></pre>
<h3>Let's Encrypt certificate fails on first start</h3>
<ul>
<li>Verify DNS has propagated: <code>dig +short yourdomain.com</code> should return a Cloudflare IP</li>
<li>Verify GCP firewall has port 80 open (required for HTTP-01 challenge)</li>
<li>Check swag logs: <code>sudo docker compose logs swag</code></li>
</ul>
<h3>Site is slow or returning 503</h3>
<pre><code class="language-bash"># Check memory — is any container near its limit?
sudo docker stats --no-stream

# Check Apache worker count inside the wordpress container
sudo docker exec wordpress apache2ctl status
</code></pre>
<p>If memory is tight, the safest fix is to upgrade the VM to <code>e2-small</code> (2 GB RAM, ~$17/month) rather than loosening the memory caps.</p>
<h3>Site returns 500 after a plugin update</h3>
<pre><code class="language-bash"># Check for PHP errors
sudo docker logs wordpress 2>&1 | grep "PHP Fatal" | tail -10

# Disable the offending plugin by renaming its directory
sudo mv ~/mysite/www/wp-content/plugins/PLUGIN_NAME{,.disabled}

# Restart WordPress
sudo docker compose -f ~/mysite/docker-compose.yml restart wordpress
</code></pre>
<h3>Backup script fails with permission errors</h3>
<p>Most likely you ran it with <code>sudo</code>. The backup script must run as your regular user — <code>gcsfuse</code> mounts with user-level permissions that break when root takes over:</p>
<pre><code class="language-bash"># Wrong
sudo ~/backup

# Right
~/backup
</code></pre>
<h3>Docker bypasses your firewall</h3>
<p>Docker manipulates iptables directly, bypassing UFW. If you expose a port in <code>docker-compose.yml</code> without the <code>127.0.0.1:</code> prefix, it's publicly accessible regardless of UFW rules. Always bind non-public ports to localhost:</p>
<pre><code class="language-yaml"># Bad — publicly accessible even with UFW blocking 3306
ports:
  - "3306:3306"

# Good — only accessible from the host
ports:
  - "127.0.0.1:3306:3306"
</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://jphein.com/how-to-host-wordpress-for-free-with-gcp-and-docker/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">12199</post-id>	</item>
		<item>
		<title>How to form a nonprofit in California</title>
		<link>https://jphein.com/how-to-form-a-nonprofit-in-california/</link>
					<comments>https://jphein.com/how-to-form-a-nonprofit-in-california/#respond</comments>
		
		<dc:creator><![CDATA[Jeffrey Hein]]></dc:creator>
		<pubDate>Fri, 03 Feb 2023 07:23:02 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Nonprofit]]></category>
		<guid isPermaLink="false">https://jphein.com/?p=11124</guid>

					<description><![CDATA[Updated guide: This 2023 post is kept for reference, and some of its fees have changed. The current, checked version is at TechPorch.org: Starting a nonprofit in California (checked November 16, 2026). The most common type of charitable nonprofit organization is a 501(c)(3) organization, also known as a public charity. These organizations are exempt from [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="techporch-pointer wp-block-paragraph"><strong>Updated guide:</strong> This 2023 post is kept for reference, and some of its fees have changed. The current, checked version is at <a href="https://techporch.org/guides/start-a-nonprofit-california">TechPorch.org: Starting a nonprofit in California</a> (checked November 16, 2026).</p>



<p class="wp-block-paragraph">The most common type of charitable nonprofit organization is a 501(c)(3) organization, also known as a public charity. These organizations are exempt from federal income tax and are eligible to receive tax-deductible donations. The most common type of 501(c)(3) organizations are those that focus on providing education, health care, social services, or other types of charitable work.</p>



<h2 class="wp-block-heading">Cost</h2>



<p class="wp-block-paragraph">For small starting organizations, the actual fees for starting a nonprofit can be relatively low, especially if the organization takes advantage of online filing options and does not require extensive legal or tax services. However, it&#8217;s important to keep in mind that even small nonprofits must still comply with all applicable laws and regulations, and it may be necessary to invest in professional services to ensure compliance and ensure the long-term success of the organization. </p>



<figure class="wp-block-table"><table><thead><tr><th>Fee</th><th>Description</th><th>Amount</th></tr></thead><tbody><tr><td>Domain name registration</td><td>Fees for registering a domain name for the nonprofit&#8217;s website</td><td>$10 per year</td></tr><tr><td>Secretary of State name reservation fee (optional)</td><td>Fees for reserving the name of the nonprofit with the California Secretary of State</td><td>$10</td></tr><tr><td>State filing fee (online)</td><td>Filing fee for registering the nonprofit with the California Secretary of State (online)</td><td>Free</td></tr><tr><td>State filing fee (paper copy) (optional)</td><td>Filing fee for registering the nonprofit with the California Secretary of State (paper copy)</td><td>$5</td></tr><tr><td>Employer Identification Number (EIN)</td><td>Federal tax ID number required for opening a bank account and filing taxes</td><td>Free</td></tr><tr><td>Bank account setup</td><td>Fees for opening a business bank account for the nonprofit</td><td>Free</td></tr><tr><td>Form 1023 filing fee</td><td>Filing fee for obtaining tax-exempt status from the IRS</td><td>$0 (for most small nonprofits) or $600</td></tr><tr><td>California Franchise Tax Board fee</td><td>Filing fee for obtaining tax-exempt status from the California Franchise Tax Board</td><td>$25</td></tr><tr><td>Filing a Statement of Information (Form SI-100)</td><td>For providing updated information about your nonprofit to the California Secretary of State. You have 90 days to do this.</td><td>$20, every two years</td></tr></tbody></table><figcaption class="wp-element-caption">Starting a nonprofit can involve additional costs beyond those listed in the fees table, such as hiring a lawyer for legal advice, a tax professional for guidance on tax-exempt status and tax reporting, obtaining any necessary business licenses, and purchasing insurance to protect the organization and its directors and officers. These costs can vary depending on the size and complexity of the organization, and it&#8217;s always a good idea to consult with a professional or an attorney to get an accurate estimate of all the costs associated with starting a nonprofit.</figcaption></figure>



<p class="wp-block-paragraph"></p>



<h2 class="wp-block-heading">Making Decisions and Filling out Forms</h2>



<h3 class="wp-block-heading">Establish your mission</h3>



<p class="wp-block-paragraph">How are you going to help? Your business may not engage in political activities and must not overcompensate its members. For Example:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">&#8220;Our mission is to empower youth in underserved communities by providing access to education, mentorship, and leadership development opportunities. We believe that every young person has the potential to succeed and make a positive impact in their communities, and we strive to create a supportive and inclusive environment that helps them achieve their goals. Through our programs and partnerships, we aim to break down barriers to success and create a more equitable and just society for all.&#8221;</p>
</blockquote>



<h3 class="wp-block-heading">Take the nonprofit startup assessment tool</h3>



<p class="wp-block-paragraph">The Nonprofit Startup Assessment Tool is a resource provided by Candid, a nonprofit organization that provides tools and information for nonprofits and philanthropy. The tool is designed to help individuals and organizations that are considering starting a nonprofit understand the steps and considerations involved in the process.</p>



<p class="wp-block-paragraph">To access the tool, simply follow the link below and scroll down to the &#8220;Nonprofit Startup Resources&#8221; section. From there, you can click on the &#8220;Startup Assessment Tool&#8221; link to begin the assessment. The tool will walk you through a series of questions about your organization and provide customized guidance based on your responses.</p>



<p class="wp-block-paragraph"><a href="https://learning.candid.org/resources/nonprofit-startup-resources/">https://learning.candid.org/resources/nonprofit-startup-resources/</a></p>



<p class="wp-block-paragraph">Remember that the tool is just a starting point, and there are many other resources available to help you start and run a successful nonprofit. Good luck on your nonprofit journey!</p>



<h3 class="wp-block-heading">Find a mentor</h3>



<p class="wp-block-paragraph"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f91d.png" alt="🤝" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Looking for expert guidance in starting or growing your nonprofit organization? SCORE.org can help! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f31f.png" alt="🌟" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p class="wp-block-paragraph">SCORE is a national nonprofit organization that provides free mentoring services to small business owners and entrepreneurs, including those in the nonprofit sector. Their experienced mentors can offer valuable insights and guidance on a wide range of topics, from business planning and fundraising to marketing and strategic growth.</p>



<p class="wp-block-paragraph">To request a mentor for your nonprofit organization, simply visit their website and fill out the Mentor Request Form. This form will help pair you with the best mentor based on your specific needs and goals.</p>



<p class="wp-block-paragraph">Don&#8217;t navigate the world of nonprofit entrepreneurship alone &#8211; let SCORE help you achieve your goals! Contact them today to get started. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bb.png" alt="💻" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f91d.png" alt="🤝" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p class="wp-block-paragraph">Visit their website to learn more and fill out the form: https://www.score.org/find-mentor/request-mentor</p>



<h3 class="wp-block-heading">Create a nonprofit ecosystem blueprint</h3>



<p class="wp-block-paragraph"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4dd.png" alt="📝" class="wp-smiley" style="height: 1em; max-height: 1em;" /> A nonprofit ecosystem blueprint is like a business model canvas for nonprofits <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f331.png" alt="🌱" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p class="wp-block-paragraph">It helps break down key components such as <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" />value proposition, <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3af.png" alt="🎯" class="wp-smiley" style="height: 1em; max-height: 1em;" />target beneficiaries, <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f511.png" alt="🔑" class="wp-smiley" style="height: 1em; max-height: 1em;" />key activities, <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4b0.png" alt="💰" class="wp-smiley" style="height: 1em; max-height: 1em;" />revenue streams and <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f50c.png" alt="🔌" class="wp-smiley" style="height: 1em; max-height: 1em;" />partnerships. This helps develop a more comprehensive understanding of the organization and create a clear vision, well-designed strategy, and necessary resources to achieve your goals.</p>



<figure class="wp-block-table"><table><thead><tr><th>Category</th><th>Description</th></tr></thead><tbody><tr><td>KEY PARTNERS</td><td>List of organizations, gov&#8217;t offices, or individuals to partner with</td></tr><tr><td>PROGRAMMING</td><td>Details on the programming provided to fulfill the mission</td></tr><tr><td>ORGANIZATIONAL VALUE</td><td>Explanation of why the organization is uniquely suited to fulfill its mission and the problems it&#8217;s trying to solve</td></tr><tr><td>CONSUMER RELATIONSHIPS</td><td>Strategies for finding consumers to access the programming</td></tr><tr><td>CONSUMER SEGMENTS</td><td>Description of the key demographic for the programming</td></tr><tr><td>KEY RESOURCES</td><td>Physical space, staff, and tools needed to fulfill the mission</td></tr><tr><td>OUTREACH</td><td>Strategies for marketing the organization to consumers and funders</td></tr><tr><td>COST STRUCTURE</td><td>Description of the most expensive elements of the organization and costs that vary with consumer volume</td></tr><tr><td>FUNDING</td><td>Overview of the organization&#8217;s funding sources, including committed funding, grants, contracts, and consumer payments</td></tr></tbody></table></figure>



<p class="wp-block-paragraph"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f449.png" alt="👉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Check out this free PDF template to create your own nonprofit ecosystem blueprint: <a href="https://drive.google.com/file/d/1mL7Y2UI-Axr50HB95T2imbid9TC5gc1O/view?usp=sharing">https://drive.google.com/file/d/1mL7Y2UI-Axr50HB95T2imbid9TC5gc1O/view?usp=sharing</a></p>



<p class="wp-block-paragraph">This is a presentation: https://prezi.com/wwlfmc-poqfn/nonprofit-ecosystem-blueprint/#</p>



<p class="wp-block-paragraph">Creating a nonprofit ecosystem blueprint can help you communicate your organization&#8217;s vision and strategy to stakeholders and ensure that you have a clear path forward for success. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f680.png" alt="🚀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<h3 class="wp-block-heading">Choose a name</h3>



<ol class="wp-block-list">
<li>Choose a name for your nonprofit <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" />: Make sure the name you choose is not already in use by another organization in California by checking the California Secretary of State&#8217;s database:<br><a href="https://businesssearch.sos.ca.gov/">https://bizfileonline.sos.ca.gov/search/business</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2699.png" alt="⚙" class="wp-smiley" style="height: 1em; max-height: 1em;" /></li>



<li>Optional: Reserve your chosen name with the California Secretary of State <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4c4.png" alt="📄" class="wp-smiley" style="height: 1em; max-height: 1em;" />: If the name you&#8217;ve chosen is available, you can reserve it with the California Secretary of State by filing a name reservation request. This will prevent someone else from using the same name while you&#8217;re completing the other steps in creating your nonprofit. The fee for reserving a name in California is currently $10.00.
<ul class="wp-block-list">
<li>To reserve your chosen name with the California Secretary of State, you&#8217;ll need to follow these steps:</li>



<li>a. Complete the Name Reservation Request form: You can find the form on the California Secretary of State&#8217;s website:<br> https://bizfileonline.sos.ca.gov/forms/business</li>



<li>b. Submit the form and fee: You can submit the form and fee by mail or in person at the California Secretary of State&#8217;s office. You can find more information on submitting the form and fee on the California Secretary of State&#8217;s website.</li>



<li>Once your name reservation request is approved, your chosen name will be reserved for 60 days, giving you time to complete the other steps in creating your nonprofit.</li>
</ul>
</li>



<li>You&#8217;ll also want to make sure that the website domain name is available, so you can check availability on a domain registrar such as Google Domains:<br> <a href="https://domains.google.com/registrar/search?searchTerm=your-chosen-name.org">https://domains.google.com/registrar/search</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br>To register your domain name, you&#8217;ll need to follow these steps:
<ul class="wp-block-list">
<li>a. Search for your desired domain name: Use the search function on the domain registrar&#8217;s website to check if your desired domain name is available.</li>



<li>b. Choose a domain extension: Choose a domain extension, such as .org, .com, .net, etc.</li>



<li>c. Complete the registration process: Fill out the necessary information and complete the registration process by paying the fee.</li>



<li>Once your domain name is registered, you&#8217;ll have a unique web address for your nonprofit, which you can use to create a website and establish an online presence.</li>
</ul>
</li>
</ol>



<h3 class="wp-block-heading">File</h3>



<p class="wp-block-paragraph">File the Articles of Incorporation with the California Secretary of State <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: To officially create your Nonprofit Public Benefit Corporation in California, you&#8217;ll need to file Articles of Incorporation with the California Secretary of State. The Articles of Incorporation must include specific information about your nonprofit, including its name, purpose, and the names and addresses of the incorporators. You can find the form for the Articles of Incorporation on the California Secretary of State&#8217;s website: <br><a href="https://www.sos.ca.gov/business-programs/business-entities/forms/">https://www.sos.ca.gov/business-programs/business-entities/forms/</a></p>



<p class="wp-block-paragraph">Once you&#8217;ve completed the Articles of Incorporation and submitted them along with the required fee to the California Secretary of State, your Nonprofit Public Benefit Corporation will be officially recognized in California.</p>



<p class="wp-block-paragraph">The next steps are:</p>



<ol class="wp-block-list">
<li>Obtain an Employer Identification Number (EIN) from the IRS <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: Your nonprofit will need an EIN, also known as an Employer Identification Number, in order to open a bank account, file taxes, and engage in other financial transactions. You can obtain an EIN from the IRS for free by completing Form SS-4:  <a href="https://www.irs.gov/forms-pubs/about-form-ss-4">https://www.irs.gov/forms-pubs/about-form-ss-4</a> or online at https://sa.www4.irs.gov/modiein/individual/index.jsp</li>



<li>Open a bank account for your nonprofit <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4b0.png" alt="💰" class="wp-smiley" style="height: 1em; max-height: 1em;" />: Once you have obtained an EIN, you can open a bank account for your nonprofit. You&#8217;ll need to provide the bank with your nonprofit&#8217;s name, EIN, and formation documents, as well as the names and addresses of the individuals who will have signing authority on the account.</li>



<li>File for tax-exempt status with the IRS <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4b8.png" alt="💸" class="wp-smiley" style="height: 1em; max-height: 1em;" />: To be recognized as a tax-exempt nonprofit by the IRS, you&#8217;ll need to file for tax-exempt status. The type of form you&#8217;ll need to file will depend on the type of nonprofit you&#8217;re forming, but the most common form for a 501(c)(3) organization is Form 1023: <br><a href="https://www.irs.gov/forms-pubs/about-form-1023">https://www.irs.gov/forms-pubs/about-form-1023</a> More info: http://www.501c3book.com/www.form1023help.com.html and https://form1023.org/</li>



<li>File for tax-exempt status with the California Franchise Tax Board <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4b0.png" alt="💰" class="wp-smiley" style="height: 1em; max-height: 1em;" />: If your nonprofit is exempt from federal income tax, you may also be exempt from paying the annual franchise tax fee in California. To claim this exemption, you&#8217;ll need to file for tax-exempt status with the California Franchise Tax Board. The fee for filing for tax-exempt status with the California Franchise Tax Board is $25.00. You can find more information on the process of obtaining tax-exempt status in California, including the required forms and fees, on the California Franchise Tax Board website: <br>https://www.ftb.ca.gov/forms/misc/927.html</li>



<li>File Statement of a nonprofit corporation is required to file an initial Statement of Information (Form SI-100) within 90 days of filing the Articles of Incorporation with the California Secretary of State. This statement must include information such as the name of the nonprofit, the registered agent&#8217;s name and address, the names and addresses of the directors, and the address of the principal office and mailing address of the business.</li>
</ol>



<p class="wp-block-paragraph">Note: Charitable organizations that are exempt from federal income tax under section 501(c)(3) of the Internal Revenue Code and that have annual gross receipts that are normally less than or equal to $50,000 <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4b0.png" alt="💰" class="wp-smiley" style="height: 1em; max-height: 1em;" /> are exempt from the $800 state tax minimum, but you must file an exemption detailed above.</p>



<h2 class="wp-block-heading">Governance</h2>



<p class="wp-block-paragraph">Step 2 in creating a nonprofit organization in California involves establishing the governance structure of your nonprofit. This includes creating bylaws and electing a board of directors. Here are the steps involved in step 2:</p>



<ol class="wp-block-list">
<li>Draft bylaws <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4dd.png" alt="📝" class="wp-smiley" style="height: 1em; max-height: 1em;" />: Bylaws are the internal rules and regulations that govern the operation of your nonprofit. They outline the responsibilities of the board of directors, the duties of the officers, and the procedures for conducting meetings, voting, and making decisions. You can find sample bylaws for nonprofits online or work with an attorney to draft custom bylaws for your organization.</li>



<li>Elect a board of directors <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f5f3.png" alt="🗳" class="wp-smiley" style="height: 1em; max-height: 1em;" />: The board of directors is the governing body of your nonprofit. It is responsible for setting policies, making decisions, and overseeing the operations of the organization. The size of the board, the qualifications for serving on the board, and the terms of office for directors are all outlined in the bylaws.</li>



<li>Hold an organizational meeting <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4ac.png" alt="💬" class="wp-smiley" style="height: 1em; max-height: 1em;" />: After the bylaws have been adopted and the board of directors has been elected, the board should hold an organizational meeting to adopt policies, elect officers, and make any other decisions necessary to begin the operations of the nonprofit.</li>
</ol>



<h2 class="wp-block-heading">Annual Reports and Taxes</h2>



<p class="wp-block-paragraph">I can provide you with a step-by-step explanation of filing annual reports for a nonprofit in California:</p>



<ol class="wp-block-list">
<li>Determine the filing deadline: Most states, including California, require nonprofits to file an annual report with the Secretary of State. The due date for filing the annual report in California is the 15th day of the 4th month after the close of the fiscal year.</li>



<li>Gather information: Before filing the annual report, gather information about the organization&#8217;s activities and financial information for the previous year. This information should be accurate and up-to-date.</li>



<li>File the report: The annual report can be filed online through the California Secretary of State&#8217;s website. The fee for filing an annual report in California is $30.</li>



<li>Confirm receipt: After filing the annual report, wait for confirmation from the California Secretary of State that the report has been received and processed.</li>
</ol>



<p class="wp-block-paragraph">It is important to note that the annual report is a critical document for maintaining a nonprofit&#8217;s good standing with the state. Filing the report on time and with accurate information is essential to preserving the organization&#8217;s tax-exempt status. More info here: https://calnonprofits.org/resources/nonprofit-compliance-checklist and here: https://www.irs.gov/pub/irs-pdf/p4221pc.pdf</p>



<h3 class="wp-block-heading">Taxes</h3>



<p class="wp-block-paragraph">Filing your first tax return as a nonprofit can be a complex process, but with the right preparation and guidance, it can be manageable. Here is a step-by-step guide to help you file your first tax return as a nonprofit:</p>



<ol class="wp-block-list">
<li>Determine your tax-exempt status: The first step in filing your tax return is to determine your tax-exempt status. Most nonprofits are exempt from federal income tax under section 501(c)(3) of the Internal Revenue Code.</li>



<li>Choose a tax year: Nonprofits must choose a tax year, which is the 12-month period used to calculate the organization&#8217;s taxable income. The most common tax year for nonprofits is the calendar year (January 1 to December 31).</li>



<li>Gather financial information: Before you can file your tax return, you will need to gather financial information for the tax year, including revenue, expenses, and any other financial transactions.</li>



<li>Choose the right form: The most common tax form for nonprofits is Form 990. This form provides information about the organization&#8217;s activities, financial information, and governance. Depending on the size of the organization, you may need to file a different form, such as Form 990-EZ or Form 990-N (also known as the e-Postcard).</li>



<li>Complete the form: Complete the form with the financial information and other required information. You may need to consult with an accountant or tax professional to help you complete the form.</li>



<li>File the return: File the tax return with the IRS by the deadline, which is usually 5 months after the end of the tax year.</li>



<li>Maintain records: Keep a copy of the tax return and any supporting documentation for at least 3 years in case the IRS needs to review your return.</li>
</ol>



<p class="wp-block-paragraph">By following these steps, you can successfully file your first tax return as a nonprofit and maintain your tax-exempt status. It&#8217;s important to note that the specific requirements and procedures may vary depending on the specifics of your organization, so it&#8217;s always a good idea to consult with a professional or an attorney to ensure that you are meeting all the necessary requirements.</p>



<h2 class="wp-block-heading">Support</h2>



<h3 class="wp-block-heading">Nevada County</h3>



<p class="wp-block-paragraph"> <strong>The Community Foundation of Nevada County</strong> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> https://www.nevcofoundation.org/ <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" /> is a nonprofit organization that supports community organizations, schools, and individuals in the Nevada County area of California. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f332.png" alt="🌲" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f33b.png" alt="🌻" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f304.png" alt="🌄" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p class="wp-block-paragraph"><strong><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f5a5.png" alt="🖥" class="wp-smiley" style="height: 1em; max-height: 1em;" />  Sierra Small Business Development Center&#8217;s webinars! </strong><a href="https://www.sierrasbdc.com/webinars/">https://www.sierrasbdc.com/webinars/</a> Sierra SBDC offers a variety of free online webinars that cover topics such as business planning, social media marketing, and financial management. These webinars are designed to help small business owners and entrepreneurs develop the knowledge and skills they need to succeed. With expert instructors and a wealth of practical insights, Sierra SBDC&#8217;s webinars are a great way to stay up-to-date with the latest best practices and trends. Visit their website to see the upcoming schedule and register for a webinar today! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bb.png" alt="💻" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f468-200d-1f4bc.png" alt="👨‍💼" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<h3 class="wp-block-heading">California </h3>



<ol class="wp-block-list">
<li>California Association of Nonprofits <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://calnonprofits.org/">https://calnonprofits.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: The California Association of Nonprofits provides advocacy, resources, and training to help nonprofits succeed in California.</li>



<li>Northern California Grantmakers <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://ncg.org/">https://ncg.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: Northern California Grantmakers provides resources and support to help nonprofits in Northern California.</li>



<li>Philanthropy California <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://www.philanthropyca.org/">https://www.philanthropyca.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: Philanthropy California provides resources and support to help nonprofits and foundations in California.</li>



<li>The Law Foundation of Silicon Valley <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://www.lawfoundation.org/">https://www.lawfoundation.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: The Law Project of Silicon Valley provides legal services and support to help nonprofits and other community organizations.</li>



<li>Center for Volunteer &amp; Nonprofit Leadership <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://www.cvnl.org/">https://www.cvnl.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: The Center for Volunteer &amp; Nonprofit Leadership provides training, resources, and support to help nonprofits in Northern California.</li>



<li>Silicon Valley Council of Nonprofits <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://svcn.org/">https://svcn.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: The Silicon Valley Council of Nonprofits provides advocacy, resources, and support to help nonprofits in the Silicon Valley region.</li>



<li>Center for Nonprofit Management <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://cnmsocal.org/">https://cnmsocal.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: The Center for Nonprofit Management provides training, resources, and support to help individuals and organizations start and manage nonprofits in Southern California. They offer a variety of resources and services, including in-person training, consulting, and online resources.</li>
</ol>



<p class="wp-block-paragraph">These are just a few examples of nonprofits that offer resources and support to help people start and run nonprofits in California. The specific resources and services offered may vary, but these organizations can be a helpful starting point for those seeking support in California.</p>



<h3 class="wp-block-heading">Nationwide</h3>



<ol class="wp-block-list">
<li>Candid <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://candid.org/">https://candid.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: Candid (formerly known as GuideStar and Foundation Center) is a nationwide nonprofit that provides resources and tools to help individuals and organizations start and manage nonprofits. They offer a variety of training and support programs, including webinars, in-person workshops, and a library of online resources.</li>



<li>SCORE <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://www.score.org/">https://www.score.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: SCORE is a national nonprofit that provides mentoring and resources to help small businesses and nonprofits succeed. They offer free workshops, mentoring, and online resources to help people start and grow nonprofits.</li>



<li>Nonprofit Ready <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://www.nonprofitready.org/">https://www.nonprofitready.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: Nonprofit Ready is an online platform that provides free training and resources to help individuals and organizations build and strengthen their nonprofits. They offer courses on topics such as fundraising, board governance, and financial management.</li>



<li>Taproot Foundation  <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://taprootfoundation.org/">https://taprootfoundation.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: Taproot Foundation is a nonprofit organization that connects skilled volunteers with other nonprofits in need of pro bono services. From website design to marketing strategy, Taproot volunteers offer their expertise to help organizations make a bigger impact. Whether you&#8217;re a professional looking to give back or a nonprofit in need of support, Taproot Foundation is a fantastic resource. Visit their website to learn more and get involved! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f91d.png" alt="🤝" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bb.png" alt="💻" class="wp-smiley" style="height: 1em; max-height: 1em;" /></li>



<li>Hurwit &amp; Associates   <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> https://www.hurwitassociates.com/  <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />:Hurwit &amp; Associates is a leading law firm that specializes in nonprofit law, and their Q&amp;A page is a great resource for anyone looking to start a nonprofit foundation. The page covers a wide range of topics, including incorporation, tax-exempt status, fundraising, and governance.The Q&amp;A format is user-friendly and provides clear, concise answers to some of the most common questions about starting up a nonprofit foundation. Whether you&#8217;re just getting started or looking to refine your existing foundation, Hurwit &amp; Associates&#8217; Q&amp;A page is a valuable resource to have on hand. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bb.png" alt="💻" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f31f.png" alt="🌟" class="wp-smiley" style="height: 1em; max-height: 1em;" /></li>



<li>Nonprofit Technology Network <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://www.nten.org/">https://www.nten.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: The Nonprofit Technology Network provides resources, training, and support to help nonprofits use technology effectively. They offer a variety of resources and tools, including webinars, online courses, and an annual conference.</li>



<li>National Council of Nonprofits <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://www.councilofnonprofits.org/">https://www.councilofnonprofits.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: The National Council of Nonprofits is a nationwide nonprofit that provides advocacy, education, and resources to help nonprofits thrive. They offer a variety of resources and guides on topics such as starting a nonprofit, fundraising, and board governance.</li>



<li>Independent Sector <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://independentsector.org/">https://independentsector.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: Independent Sector is a national nonprofit that provides advocacy, resources, and support to help nonprofits succeed. They offer a variety of resources and tools, including research, policy analysis, and webinars.</li>



<li>BoardSource <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://boardsource.org/">https://boardsource.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: BoardSource is a national nonprofit that provides training, resources, and support to help nonprofit boards and board members. They offer a variety of resources and tools, including online courses, publications, and consulting services.</li>



<li>Nonprofit Finance Fund <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://nff.org/">https://nff.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: The Nonprofit Finance Fund provides financing, consulting, and support to help nonprofits achieve financial sustainability. They offer a variety of financial products and services, including loans, lines of credit, and financial management consulting.</li>



<li>United Way <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://www.unitedway.org/">https://www.unitedway.org/</a> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: United Way is a national nonprofit that provides resources and support to help individuals and organizations create positive community change. They offer a variety of programs and initiatives, including fundraising campaigns, community engagement programs, and advocacy efforts.</li>
</ol>



<p class="wp-block-paragraph">The types of support and resources provided by these nonprofits vary, and not all of the support may be free. Some nonprofits may offer free resources and services, while others may charge a fee for certain programs or services.</p>



<p class="wp-block-paragraph">For example, some of the resources and training offered by Foundation Center, Nonprofit Ready, and TechSoup are free of charge. Others, such as consulting services or in-depth training programs, may have a fee associated with them.</p>



<p class="wp-block-paragraph">It&#8217;s important to research each nonprofit and the specific resources or programs they offer to determine if there are any associated costs. Some nonprofits may offer scholarships or other forms of financial assistance to help cover the costs of their programs or services.</p>



<p class="wp-block-paragraph">In general, many nonprofits that offer support to help people start and run nonprofits are committed to providing accessible resources and services to help strengthen the nonprofit sector, so it&#8217;s worth exploring the available options to find the best fit for your organization and budget.</p>



<h2 class="wp-block-heading">More guides</h2>



<p class="wp-block-paragraph"><a href="https://www.canva.com/design/DAEBTDbDsFc/IJ698pBYbkcK4rbGdb3Lkw/view#1">https://www.canva.com/design/DAEBTDbDsFc/IJ698pBYbkcK4rbGdb3Lkw/view#1</a></p>



<p class="wp-block-paragraph"><a href="https://learning.candid.org/resources/knowledge-base/starting-a-nonprofit/">https://learning.candid.org/resources/knowledge-base/starting-a-nonprofit/</a></p>



<p class="wp-block-paragraph"><a href="https://www.score.org/philadelphia/resource/article/nonprofit-resources">https://www.score.org/philadelphia/resource/article/nonprofit-resources</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://jphein.com/how-to-form-a-nonprofit-in-california/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">11124</post-id>	</item>
		<item>
		<title>Free Resources for Nonprofits</title>
		<link>https://jphein.com/free-resources-for-nonprofits/</link>
					<comments>https://jphein.com/free-resources-for-nonprofits/#respond</comments>
		
		<dc:creator><![CDATA[Jeffrey Hein]]></dc:creator>
		<pubDate>Wed, 25 Jan 2023 20:19:22 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Discount]]></category>
		<category><![CDATA[FREE]]></category>
		<category><![CDATA[Nevada County]]></category>
		<category><![CDATA[Nonprofit]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[eBay]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Sprint]]></category>
		<category><![CDATA[WiFi]]></category>
		<guid isPermaLink="false">https://blog.jphein.com/?p=5991</guid>

					<description><![CDATA[Updated guide: This 2023 list is kept for reference; some of its links have moved or closed. The current, checked version is at TechPorch.org: Free and discounted tools for nonprofits (checked November 16, 2026). Nevada CountyLocal Resources Regional Resources Online resources This is not an exhaustive list, nor is it sorted in any particular order. [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="techporch-pointer wp-block-paragraph"><strong>Updated guide:</strong> This 2023 list is kept for reference; some of its links have moved or closed. The current, checked version is at <a href="https://techporch.org/guides/nonprofit-resources">TechPorch.org: Free and discounted tools for nonprofits</a> (checked November 16, 2026).</p>



<h2 class="wp-block-heading">Nevada County<br>Local Resources</h2>



<ul class="wp-block-list">
<li>The County of Nevada Nonprofit monthly office equipment giveaway. They computer equipment as well as office supplies and furniture. Last Friday of the month at the stoplight warehouse.</li>



<li>Briar patch has several programs for nonprofits: https://briarpatch.coop/giving-back/</li>



<li>Connect with United Way NC https://uwnc.org/become-a-uwnc-partner</li>



<li>Local Volunteer Center <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f91d.png" alt="🤝" class="wp-smiley" style="height: 1em; max-height: 1em;" />: A resource for finding volunteer opportunities in your local community. People are looking for ways to give back to their community and make a positive impact, some may consider checking out their local volunteer center. These organizations provide a wealth of resources and opportunities for volunteers, including information on local volunteer opportunities, resources for volunteer management and coordination, and training and support for volunteers. To find your local volunteer center, simply search online for &#8220;local volunteer center&#8221; followed by the name of your city or region.</li>
</ul>



<h2 class="wp-block-heading">Regional Resources</h2>



<ul class="wp-block-list">
<li>eScript for local donations at Grocery Stores www.escrip.com</li>



<li>CVS grant for giftcards for nonprofits <a href="https://www.cvshealth.com/social-responsibility/our-giving">https://www.cvshealth.com/social-responsibility/our-giving</a></li>



<li>Home depot project grants for nonprofits (gift cards) https://corporate.homedepot.com/page/home-depot-foundation</li>



<li>Foundation Directory Online <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4b0.png" alt="💰" class="wp-smiley" style="height: 1em; max-height: 1em;" />: Free access from your local library.<br>A database of foundations and grants, available for free through many libraries. Foundation Directory Online is a comprehensive database of foundations and grants, providing valuable information on funding opportunities for nonprofits. This resource is available for free through many libraries, providing organizations with a convenient and affordable way to research funding opportunities and plan their fundraising strategies. To learn more about Foundation Directory Online and how it can help your nonprofit, visit <a href="https://fdo.foundationcenter.org/">https://fdo.foundationcenter.org/</a>. candid?</li>
</ul>



<h2 class="wp-block-heading">Online resources</h2>



<p class="wp-block-paragraph">This is not an exhaustive list, nor is it sorted in any particular order. Although, the ones at the top are more generally useful to the nonprofit.  Many of them use techsoup.org to verify nonprofit eligibility.</p>



<h3 class="wp-block-heading">Technology Help</h3>



<ul class="wp-block-list">
<li>Online Impacts – a 501(c)(3) nonprofit organization that develops/hosts websites, provides digital marketing guidance, and creates technology solutions for impact-based nonprofits – https://onlineimpacts.org/ – Online Impacts is a great resource for nonprofits looking to maximize their impact. They offer comprehensive web development, marketing, and tech solutions to help organizations create meaningful change.</li>



<li>NTEN &#8211; technology resources for nonprofits &#8211; https://www.nten.org/ &#8211; NTEN is a nonprofit that provides technology resources, best practices, and training for nonprofits to help them use technology more effectively. They also offer free webinars, conferences, and other events for nonprofits to learn and network.</li>



<li>Idealware – tech training for nonprofits – http://idealware.org/ – Idealware provides tech training and resources specifically tailored for nonprofits, making it a great way for organizations to stay up to date on the latest tech tools.</li>



<li>Nonprofit Tech for Good An informative blog with easy-to-understand information, news, and resources related to nonprofit technology, online communications, and social and mobile fundraising. https://www.nptechforgood.com/about-nonprofit-tech-for-good/</li>



<li>Whole Whale <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f433.png" alt="🐳" class="wp-smiley" style="height: 1em; max-height: 1em;" />: A nonprofit digital consultancy with resources and expertise available for free. Whole Whale is a nonprofit digital consultancy that provides a range of resources and expertise to organizations looking to maximize their impact through technology. From website design and development to data analysis and strategy, Whole Whale provides nonprofits with the tools and support they need to succeed in the digital age. And the best part? Their resources and expertise are available for free. To learn more about Whole Whale and how they can help your nonprofit, visit <a href="https://wholewhale.com/">https://wholewhale.com/</a>.</li>



<li>Techsoup – discounted software – https://www.techsoup.org/ – Techsoup is a great resource for nonprofits looking to save money on technology. They offer discounted software licenses and hardware, as well as training and other resources to help nonprofits succeed.</li>
</ul>



<h3 class="wp-block-heading">Hardware</h3>



<ul class="wp-block-list">
<li>Good360 &#8211; donated goods for nonprofits &#8211; https://good360.org/ &#8211; Good360 is an organization that provides nonprofits with donated goods such as school supplies, clothes, baby items, computers, etc. Their service is free for qualifying nonprofits, and a great way for organizations to get the items they need to succeed.</li>



<li>ConnectAll – technology for nonprofits and people with low income – https://connectall.org/ – ConnectAll is a great resource for nonprofits and people with low incomes, offering discounted access to technology resources.</li>
</ul>



<h3 class="wp-block-heading">Cloud Services</h3>



<ul class="wp-block-list">
<li>Google &#8211; https://www.google.com/nonprofits/ 
<ul class="wp-block-list">
<li>Google Workspace for Nonprofits &#8211; free productivity suite -https://www.google.com/nonprofits/offerings/workspace/ &#8211; Google Workspace for Nonprofitsis a suite of tools designed to help nonprofits collaborate, communicate, and get work done more efficiently. It includes tools like Gmail, Drive, Calendar, Hangouts, and more.</li>



<li>Google Ad Grants &#8211; free online advertising &#8211; https://www.google.com/grants/ &#8211; Google Ad Grants is a free online advertising program that helps nonprofits reach new audiences. It provides free ad credits that can be used to promote the organization&#8217;s website and message.</li>



<li>Youtube Nonprofit Program &#8211; https://www.google.com/nonprofits/offerings/youtube-nonprofit-program/ &#8211; Engage your supporters using video with the YouTube Nonprofit Program. Unlock the power of video storytelling, so you can reach a global audience and amplify your cause. Plus, make it easy for supporters to give with YouTube Giving features (currently available in the U.S.).</li>



<li>Google Earth Nonprofit &#8211; https://www.google.com/nonprofits/offerings/google-earth-and-maps/ &#8211; Google for Nonprofits provides Google Maps Platform credits to nonprofits. Show your nonprofit&#8217;s impact with Google Earth and Maps. Develop compelling data visualizations to track and share your organization’s impact. Plus, use Google Maps Platform to help people locate community programs and resources closest to them.</li>
</ul>
</li>



<li>Microsoft 
<ul class="wp-block-list">
<li>Office 365 for Nonprofits – productivity suite &#8211; https://www.microsoft.com/en-us/nonprofits – Microsoft Office 365 offer a variety of tools and resources to help nonprofits stay productive and efficient.</li>



<li>Azure for Nonprofits &#8211; https://www.microsoft.com/en-us/nonprofits/offers-for-nonprofits &#8211; Leverage $3,500 (USD) Azure services credits per year and access the complete portfolio of Azure products and cloud services. Sign up for the Nonprofit Azure Onboarding Concierge and Success Center to set up your credits. </li>
</ul>
</li>



<li>Canva for Nonprofits – <a href="https://www.canva.com/canva-for-nonprofits/">https://www.canva.com/canva-for-nonprofits/</a>– Canva for Nonprofits is a free design tool that allows nonprofits to create beautiful visuals for websites, social media, and other marketing materials.</li>



<li>Slack for Nonprofits – https://slack.com/nonprofit – Slack is a great way for teams to communicate and collaborate in real-time. Slack for Nonprofits provides additional features and discounts to help nonprofits stay connected.</li>



<li>Asana for Nonprofits – https://asana.com/nonprofits – Asana is a great tool for project management and task organization. Asana for Nonprofits provides discounts and additional features to help nonprofits stay organized.</li>



<li>Cloudflare &#8211; https://www.cloudflare.com/ &#8211; Cloudflare provides reliable and secure web services to nonprofits of all sizes, making it easier for them to reach their audiences and expand their reach online. With its free plan, nonprofits can use a range of services to boost their online presence, including enhanced security, faster page loading times, and improved performance</li>



<li>Box.org – free cloud storage for nonprofits – https://www.box.com/industries/non-profit – Box.org provides free cloud storage for nonprofits. It’s a great way for nonprofits to securely store, share,and access data, documents, and other files.</li>



<li>CivicChamps – managing volunteers – https://www.civicchamps.com/ – CivicChamps is a great way for nonprofits to recruit, manage, and track volunteers. It offers 50% off to help nonprofits save money.</li>



<li>Dreamhost &#8211; web host provider &#8211; https://www.dreamhost.com/ &#8211; Dreamhost is a web host provider that offers free shared website and email hosting for nonprofits. It&#8217;s a great way for organizations to save money on web hosting costs.</li>



<li>eBay – waives selling fees for Nonprofits – https://charity.ebay.com/for-nonprofits/ – eBay waives their selling fees for nonprofits, making it an easy and cost-effective way to raise money for causes.</li>



<li>T-Mobile Network – unlimited Internet 4G WiFi Hotspot for nonprofits for $10/month with $18 for hotspot device – www.mobilebeacon.org/ – The T-Mobile Network offers unlimited 4G internet for nonprofits at a discounted price of $10/month and $18 for a hotspot device.</li>



<li>PayPal Giving Fund &#8211; donations for nonprofits &#8211; https://www.paypal.com/us/webapps/mpp/donations &#8211; PayPal Giving Fund is a great way for nonprofits to receive donations from PayPal users. It&#8217;s a free service that makes donating easy and secure.</li>



<li>Facebook Fundraisers &#8211; donations for nonprofits &#8211; https://www.facebook.com/fundraisers &#8211; Facebook Fundraisers are a great way for nonprofits to reach a larger audience and raise money for their cause. They provide an easy and secure way for users to donate to their favorite nonprofits.</li>



<li>Salesforce Nonprofit Cloud &#8211; free CRM software &#8211; https://www.salesforce.org/nonprofit &#8211; Salesforce Nonprofit Cloud is a free Customer Relationship Management (CRM) software designed to help nonprofits build better relationships with their donors and supporters.</li>



<li>GitHub Nonprofit Program &#8211; free developer tools &#8211; https://socialimpact.github.com/ &#8211; GitHub Nonprofit Program provides free developer tools and services to help nonprofits build software and manage projects.</li>



<li>MailChimp <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4e7.png" alt="📧" class="wp-smiley" style="height: 1em; max-height: 1em;" />: An email marketing platform with a free plan for nonprofits. Mailchimp offers a range of features including email design templates, automation, and analytics. Nonprofits can send up to 12,000 emails to 2,000 subscribers per month for free. Check it out at: <a href="https://mailchimp.com/">https://mailchimp.com/</a></li>



<li>Hubspot <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: A comprehensive marketing, sales, and customer service platform with a free nonprofit plan. Hubspot offers a range of features including website builder, email marketing, and a CRM. Nonprofits can access all the tools for free, with no time limits or restrictions. Learn more at: <a href="https://www.hubspot.com/">https://www.hubspot.com/</a></li>



<li>Buffer <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4ca.png" alt="📊" class="wp-smiley" style="height: 1em; max-height: 1em;" />: A social media management tool with a free plan for nonprofits. Buffer allows nonprofits to schedule, publish, and analyze posts on multiple social media platforms from one place. Nonprofits can access the basic plan for free, including support for three social media profiles. Get started at: <a href="https://buffer.com/">https://buffer.com/</a></li>



<li>Otter.ai <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f399.png" alt="🎙" class="wp-smiley" style="height: 1em; max-height: 1em;" />: An AI-powered tool for transcribing and recording meetings, available for free to nonprofits. Otter.ai uses AI to transcribe and organize audio and video recordings in real-time. Nonprofits can access 600 minutes of transcription per month for free. Find out more at: <a href="https://otter.ai/">https://otter.ai/</a></li>



<li>Givelively <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4b0.png" alt="💰" class="wp-smiley" style="height: 1em; max-height: 1em;" />: A fundraising platform that is free for nonprofits to use. Givelively offers a range of features including online fundraising pages, donation processing, and donor management. Nonprofits can use the platform for free, with no transaction fees or hidden costs. Get started at: <a href="https://www.givelively.org/">https://www.givelively.org/</a></li>



<li>Mobilize <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f680.png" alt="🚀" class="wp-smiley" style="height: 1em; max-height: 1em;" />: A platform for organizing volunteer events and campaigns, available for free to nonprofits. Mobilize makes it easy for nonprofits to recruit, manage, and mobilize volunteers. Nonprofits can use the platform for free, with no limits on the number of volunteers or events. Sign up at: <a href="https://mobilize.us/">https://mobilize.us/</a></li>



<li>LinkedIn <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bc.png" alt="💼" class="wp-smiley" style="height: 1em; max-height: 1em;" />: A professional networking platform with a free nonprofit account. LinkedIn is a platform designed for professional networking, connecting millions of professionals from around the world. Nonprofits can take advantage of LinkedIn&#8217;s free nonprofit account, which provides access to a wealth of resources and tools to help organizations build their online presence and connect with potential supporters, partners, and collaborators. To learn more about the free nonprofit account offered by LinkedIn, visit <a href="https://business.linkedin.com/non-profits">https://business.linkedin.com/non-profits</a>.</li>



<li>ClickUp <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4c5.png" alt="📅" class="wp-smiley" style="height: 1em; max-height: 1em;" />: A project management tool with a free plan for nonprofits.ClickUp is a comprehensive project management tool that can help organizations of all sizes streamline their workflows and collaborate more effectively. The tool is available for free to nonprofits, offering a range of features and tools to help organizations stay organized and on track, including task management, project tracking, and team collaboration. To learn more about ClickUp and how it can help your nonprofit, visit <a href="https://clickup.com/">https://clickup.com/</a>.</li>



<li>Webflow <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" />: A website design and development platform that offers a free plan for nonprofits. With Webflow, nonprofits can create beautiful, functional websites without having to write code. Nonprofits can take advantage of Webflow&#8217;s intuitive design tools, extensive design library, and customizable templates to create a website that meets their unique needs. To get started with Webflow, visit <a href="https://webflow.com/">https://webflow.com/</a></li>



<li>Codesandbox <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4bb.png" alt="💻" class="wp-smiley" style="height: 1em; max-height: 1em;" />: A code editor and development environment that is available for free to nonprofits. Codesandbox provides a collaborative environment for developers to create and test their code, making it easier for nonprofits to build and maintain their websites and applications. To access Codesandbox, go to <a href="https://codesandbox.io/">https://codesandbox.io/</a></li>



<li>Twilio.org &#8211; https://twilio.org  <br>Twilio offers free and discounted access for nonprofits to it’s powerful SMS and messaging platform. They are a proud member of the Pledge 1% for companies, redirecting 1% of their profit to social impact. They also run an annual impact fund for funding direct ideas in the community using SMS. More about this on our podcast with Twilio.org.</li>



<li>Okta Cloud-based identity management platform for nonprofits. Okta offers a discount to eligible nonprofits, providing up to 50 free licenses for their identity management.platform.https://www.okta.com/nonprofits/</li>



<li>Loom <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3a5.png" alt="🎥" class="wp-smiley" style="height: 1em; max-height: 1em;" />: A screen and camera recording tool with a free plan for nonprofits. Loom is a screen and camera recording tool that makes it easy to capture and share video content with others. The tool is available for free to nonprofits, providing organizations with a convenient and affordable way to create and share videos for a variety of purposes, including fundraising, marketing, and community engagement. To learn more about Loom and how it can help your nonprofit, visit <a href="https://www.loom.com/">https://www.loom.com/</a>.</li>



<li>GrantAdviser – a safe way to anonymously give and receive feedback on grantmaking – https://grantadvisor.org/ – GrantAdviser is a platform that allows nonprofits to review and rate their grantmaking experiences. It provides a safe and anonymous environment to share experiences and feedback that can help other organizations.</li>



<li>Charity Navigator is a nonprofit that rates charities in the US based on financial health, accountability, and transparency. Their rating system uses one to four stars. They also offer resources for donors and a paid service for personalized giving recommendations. Visit their website at: <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <a href="https://www.charitynavigator.org/">https://www.charitynavigator.org/</a></li>
</ul>



<p class="wp-block-paragraph">You don&#8217;t pay taxes on communication services if you are certain type of nonprofit.</p>



<figure class="wp-block-embed is-type-wp-embed is-provider-jeffrey-hein wp-block-embed-jeffrey-hein"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="3hxFyzFjjm"><a href="https://jphein.com/discounted-phone-and-internet-for-nonprofits-in-california/">Discounted 50% off Internet, and 25% off Phone Service for certain Nonprofits in California</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="“Discounted 50% off Internet, and 25% off Phone Service for certain Nonprofits in California” — Jeffrey Pine Hein" src="https://jphein.com/discounted-phone-and-internet-for-nonprofits-in-california/embed/#?secret=3aepZtESL0#?secret=3hxFyzFjjm" data-secret="3hxFyzFjjm" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<h2 class="wp-block-heading">Other ideas</h2>



<figure class="wp-block-embed is-type-wp-embed is-provider-jeffrey-hein wp-block-embed-jeffrey-hein"><div class="wp-block-embed__wrapper">
<blockquote class="wp-embedded-content" data-secret="HI4Q5mb4XI"><a href="https://jphein.com/0-05-for-every-beverage-container-in-california-ca-crv/">$0.05 for every beverage container in California. CA CRV</a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="“$0.05 for every beverage container in California. CA CRV” — Jeffrey Pine Hein" src="https://jphein.com/0-05-for-every-beverage-container-in-california-ca-crv/embed/#?secret=MmWTQt1aYw#?secret=HI4Q5mb4XI" data-secret="HI4Q5mb4XI" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div></figure>



<p class="wp-block-paragraph">ewaste drives</p>



<h2 class="wp-block-heading">Further reading</h2>



<p class="wp-block-paragraph"><a href="https://www.idealist.org/en/fundraising-resources/free-or-low-cost-services">https://www.idealist.org/en/fundraising-resources/free-or-low-cost-services</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://jphein.com/free-resources-for-nonprofits/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5991</post-id>	</item>
		<item>
		<title>How to secure your custom website, and domain email services for free using Cloudflare</title>
		<link>https://jphein.com/how-to-secure-your-custom-website-and-domain-email-services-for-free-using-cloudflare/</link>
					<comments>https://jphein.com/how-to-secure-your-custom-website-and-domain-email-services-for-free-using-cloudflare/#respond</comments>
		
		<dc:creator><![CDATA[Jeffrey Hein]]></dc:creator>
		<pubDate>Wed, 25 Jan 2023 20:13:35 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[FREE]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Nonprofit]]></category>
		<category><![CDATA[Service]]></category>
		<guid isPermaLink="false">https://blog.jphein.com/?p=10166</guid>

					<description><![CDATA[You want a custom domain for your website and email, but you don&#8217;t want to pay someone to manage your email security? Preparation: Steps: More Reading: Note: This guide assumes that you have already signed up for a Gmail account and Cloudflare account. Email security is important to protect your organization from phishing attacks and [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">You want a custom domain for your website and email, but you don&#8217;t want to pay someone to manage your email security? </p>



<p class="wp-block-paragraph">Preparation:</p>



<ol class="wp-block-list">
<li>Sign up for a free Gmail.com account</li>



<li>Sign up for Cloudflare.com</li>
</ol>



<p class="wp-block-paragraph">Steps:</p>



<ol class="wp-block-list">
<li>Register your domain with Cloudflare</li>



<li>Add your website to Cloudflare</li>



<li>Configure DNSEC, SPF, DKIM, and DMARC with Cloudflare
<ul class="wp-block-list">
<li>DNSEC is easy if your domain is registered with Cloudflare</li>



<li>Configure SPF to include Google (support.google.com/googleapps), and your own website IP address.</li>



<li>Set up DKIM</li>



<li>Set up DMARC</li>
</ul>
</li>



<li>Set up email forwarding in Cloudflare to your Gmail account</li>



<li>Set up &#8220;send as&#8221; address in Gmail</li>



<li>Test sending and receiving email with your custom domain through your Gmail account</li>



<li>Check your email deliverability score at mail-tester.com</li>
</ol>



<p class="wp-block-paragraph">More Reading:</p>



<ul class="wp-block-list">
<li>help.17hats.com/en/articles/2933143-how-to-set-up-email-forwarding-with-cloudflare</li>



<li>dmarcly.com/blog/how-to-use-dmarc-to-protect-your-domain</li>
</ul>



<p class="wp-block-paragraph">Note: This guide assumes that you have already signed up for a Gmail account and Cloudflare account.</p>



<p class="wp-block-paragraph">Email security is important to protect your organization from phishing attacks and email fraud. There are several email security features that you can enable for your custom domain, including DNSSEC, SPF, DKIM, and DMARC. DNSSEC is a security protocol that authenticates DNS data and can help prevent DNS spoofing attacks. SPF is a security protocol that helps to prevent email spoofing by verifying that email messages come from authorized senders. DKIM is a security protocol that uses digital signatures to verify the authenticity of email messages. DMARC is a security protocol that helps to prevent email spoofing by verifying the alignment of SPF and DKIM policies. Enabling these email security features for your custom domain can help to protect you from email fraud and phishing attacks. As well as make sure that your legitimate email is not marked as spam.</p>



<figure class="wp-block-image aligncenter size-large"><a href="https://jphein.com/wp-content/uploads/2022/08/DALL·E-2022-08-23-09.26.54-A-digital-art-banner-for-a-blog-depicting-en-envelope-with-a-padlock-and-arrows.png"><img fetchpriority="high" decoding="async" width="1024" height="1024" data-attachment-id="10247" data-permalink="https://jphein.com/how-to-secure-your-custom-website-and-domain-email-services-for-free-using-cloudflare/dall%c2%b7e-2022-08-23-09-26-54-a-digital-art-banner-for-a-blog-depicting-en-envelope-with-a-padlock-and-arrows/" data-orig-file="https://jphein.com/wp-content/uploads/2022/08/DALL·E-2022-08-23-09.26.54-A-digital-art-banner-for-a-blog-depicting-en-envelope-with-a-padlock-and-arrows.png" data-orig-size="1024,1024" data-comments-opened="1" data-image-title="DALL·E 2022-08-23 09.26.54 &amp;#8211; A digital art banner for a blog depicting en envelope with a padlock, and arrows" data-image-description="" data-image-caption="" data-large-file="https://jphein.com/wp-content/uploads/2022/08/DALL·E-2022-08-23-09.26.54-A-digital-art-banner-for-a-blog-depicting-en-envelope-with-a-padlock-and-arrows-1024x1024.png" src="https://jphein.com/wp-content/uploads/2022/08/DALL·E-2022-08-23-09.26.54-A-digital-art-banner-for-a-blog-depicting-en-envelope-with-a-padlock-and-arrows-1024x1024.png" alt="Illustration: an envelope, a padlock and an arrow, for securing email and a website" class="wp-image-10247" srcset="https://jphein.com/wp-content/uploads/2022/08/DALL·E-2022-08-23-09.26.54-A-digital-art-banner-for-a-blog-depicting-en-envelope-with-a-padlock-and-arrows.png 1024w, https://jphein.com/wp-content/uploads/2022/08/DALL·E-2022-08-23-09.26.54-A-digital-art-banner-for-a-blog-depicting-en-envelope-with-a-padlock-and-arrows-300x300.png 300w, https://jphein.com/wp-content/uploads/2022/08/DALL·E-2022-08-23-09.26.54-A-digital-art-banner-for-a-blog-depicting-en-envelope-with-a-padlock-and-arrows-150x150.png 150w, https://jphein.com/wp-content/uploads/2022/08/DALL·E-2022-08-23-09.26.54-A-digital-art-banner-for-a-blog-depicting-en-envelope-with-a-padlock-and-arrows-768x768.png 768w, https://jphein.com/wp-content/uploads/2022/08/DALL·E-2022-08-23-09.26.54-A-digital-art-banner-for-a-blog-depicting-en-envelope-with-a-padlock-and-arrows-250x250.png 250w, https://jphein.com/wp-content/uploads/2022/08/DALL·E-2022-08-23-09.26.54-A-digital-art-banner-for-a-blog-depicting-en-envelope-with-a-padlock-and-arrows-174x174.png 174w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<h2 class="wp-block-heading">Preparation</h2>



<p class="wp-block-paragraph">Sign up for a free gmail.com account. Google has the best deliverability, and spam filters in my experience. I&#8217;d recommend signing up for cloudflare.com as well. They have the lowest cost domain registration as well. $8/year. They have a really good free account for everything else. They can help you set up the below domain, and email settings:</p>



<ul class="wp-block-list">
<li>DNSSEC</li>



<li>SPF</li>



<li>DKIM</li>



<li>DMARC</li>



<li>Email forwarding to your gmail account. </li>
</ul>



<h2 class="wp-block-heading">Steps</h2>



<ol class="wp-block-list">
<li>Sign up for gmail.com, protonmail.com, or your own mail server.</li>



<li>Sign up for cloudlfare.com</li>



<li>Register your domain with cloudflare</li>



<li>Add your website to cloudflare</li>



<li>Configure DNSEC, DKIM, SPF, and DMARC with cloudflare.
<ol class="wp-block-list">
<li>DNSEC is easy if domain is registered with cloudflare.</li>



<li>DKIM </li>



<li>SPF (make sure to include google in your SPF) https://support.google.com/googlecloud/answer/10756302</li>



<li>DMARC</li>
</ol>
</li>



<li>Set up email forwarding in cloudflare to your gmail account</li>



<li>Set up &#8220;send as&#8221; address in Gmail</li>



<li>Test
<ol class="wp-block-list">
<li>Test sending and receiving email with your custom domain through your gmail account. </li>



<li>Test email deliverability score at <a href="https://www.mail-tester.com/">https://www.mail-tester.com/</a></li>
</ol>
</li>
</ol>



<h2 class="wp-block-heading">More reading</h2>



<p class="wp-block-paragraph"><a href="https://help.17hats.com/en/articles/865530-how-to-ensure-emails-do-not-end-up-in-spam">https://help.17hats.com/en/articles/865530-how-to-ensure-emails-do-not-end-up-in-spam</a></p>



<p class="wp-block-paragraph"><a href="https://dmarcly.com/blog/how-to-implement-dmarc-dkim-spf-to-stop-email-spoofing-phishing-the-definitive-guide">https://dmarcly.com/blog/how-to-implement-dmarc-dkim-spf-to-stop-email-spoofing-phishing-the-definitive-guide</a></p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://jphein.com/how-to-secure-your-custom-website-and-domain-email-services-for-free-using-cloudflare/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">10166</post-id>	</item>
	</channel>
</rss>
