>
Tech News

Claude Code on a Synology NAS: keep your prompts off someone else’s box

I was paying $200 a month for a coding assistant I barely trusted. Every conversation went to someone else’s servers, every keystroke I typed got logged, and the moment I stopped paying, the whole setup stopped working. The lock-in was the point. The subscription model is not a pricing choice for these tools, it is a moat. I got tired of renting my own tools, so I moved Claude Code to a Synology NAS (a Network Attached Storage device, basically a small always-on server you keep at home or in a closet, made by Synology) on my home network. The setup took a Saturday, costs me $0 a month in subscriptions, and has been running for four months without a hiccup.

If you are paying monthly for a hosted AI coding tool and you have a NAS, a home server, or even an old desktop you can leave on, you can run the same tool yourself. The performance is not identical to the hosted version, but for most coding tasks it is close enough that the monthly bill is the only thing I miss.

Why I bothered

The math was the first reason. Two hundred dollars a month is two thousand four hundred a year, every year, for a tool I was using maybe 30 hours a week. The NAS I run it on cost me $650 three years ago. The Claude API access I pay for separately (about $30 a month at my usage) is a tenth of what the hosted coding tool was charging. The breakeven (the point at which my savings equal the extra setup effort) was about three months.

The second reason was control. The hosted tool logs every prompt and every response to train future models, unless you pay extra for the “no training” tier, which is $50 a month on top. Self-hosting means my code, my prompts, and the model’s responses stay on hardware I control. For most work this does not matter. For the work I do for clients, it does. Some of my clients have NDAs (non-disclosure agreements, contracts that forbid sharing their code or data with third parties) that explicitly forbid sending code to AI providers that train on inputs. Self-hosting sidesteps the question entirely.

Downtime was the third reason. The hosted tool goes down sometimes. The API it talks to goes down more often. When the tool is on my own hardware, on my own network, with a fallback to my local model when the API is unreachable, the failure modes are mine to manage. I can fix them. I cannot fix someone else’s outage.

What “HolyClaude” actually is

The tool I am running is a small project called HolyClaude, which is a self-hosted wrapper (a thin piece of software that packages another tool with extra conveniences) around the official Claude Code CLI (Anthropic’s command-line coding assistant, a tool that lets you run Claude from a terminal to plan, edit, and debug code). The wrapper does three things the bare CLI does not do: it adds a web UI, it sets up authentication, and it manages a local cache of common requests so the API gets called less often.

The web UI is a simple React app (a JavaScript framework for building browser interfaces) that runs on port 8080 of the NAS. From any browser on my home network, I open http://nas.local:8080, get a chat interface, and use it the same way I would use the hosted version. From outside the home network, I use Tailscale (a VPN-like service that creates a private network between your devices, so you can reach your home services as if you were on the same Wi-Fi) to reach the NAS securely. The whole thing is behind my Tailscale tailnet (a private mesh network of devices), so it is not exposed to the public internet at all.

Authentication setup is the part I expected to hate. The official Claude Code CLI expects an Anthropic API key in an environment variable, and refreshing the key when it expires is annoying. The wrapper handles this by storing the key in the Synology’s credential store (an encrypted vault built into Synology’s DSM operating system for safely keeping passwords and tokens) and refreshing it on a schedule. I have not touched the API key in four months. It just works.

Local cache was the part I did not expect to care about. The wrapper keeps a SQLite (a lightweight file-based database) index of past requests and responses, and when I ask a question that is similar to one I have asked before, it serves the cached response without calling the API. For repetitive tasks like “explain this function” or “generate a docstring,” the cache hit rate is about 30%. That alone saves me $10 a month.

The actual install

The install took about four hours, most of which was figuring out the right way to expose the web UI through Tailscale on a Synology. The wrapper itself is a single Docker image (a packaged application that runs the same way on any machine with Docker installed), so the install is docker run -d -p 8080:8080 -v /volume1/holyclaude:/data holyClaude/holyclaude:latest. The rest is configuration.

Here is the order of operations that has worked for me:

  • Get the DSM Container Manager package. Synology’s DSM (DiskStation Manager, the operating system that runs on a Synology NAS) ships with a package called Container Manager, which is a Docker frontend. Install it from the Package Center if it is not already there.
  • Create a dedicated volume for HolyClaude. A volume in Synology terms is a named folder on the NAS drives. HolyClaude writes its cache and config there, and putting it on a separate volume makes backups and migrations easier.
  • Get an Anthropic API key. The wrapper needs a Claude API key to work. You can get one from the Anthropic console. Set up a hard spending limit on the key so a runaway session does not drain your bank account.
  • Pull and run the Docker image. The command is in the project’s README. The default settings work for most people.
  • Set up Tailscale on the NAS. Synology has a Tailscale package. Install it, sign in, and the NAS gets a stable Tailscale IP. Use that IP (or the Tailscale MagicDNS name) to reach the web UI from anywhere.
  • Back up the volume. Synology’s Hyper Backup (the built-in tool for scheduling backups to an external drive, a Synology NAS at a friend’s house, or a cloud service) can back up the HolyClaude volume to an external drive or a remote Synology. Schedule it for once a week.

One specific thing that was harder than expected was the Tailscale integration. The Synology package does not advertise itself via mDNS (multicast DNS, a protocol that lets devices on the same network discover each other by name, like nas.local) the way a Mac does, so I had to use the Tailscale IP directly. It works, but the IP changes when the NAS restarts unless you set up a stable Tailscale name. One specific thing that was easier than expected was the API key rotation. I expected to be regenerating keys every few weeks. The wrapper handles it.

What I gave up

The mobile app is also gone. The hosted tool has a slick phone client. Mine has a Tailscale-protected web UI that works in a phone browser, but it is not a native app. For the kind of coding I do, mobile is a “look at a file” tool, not a “write a function” tool, so the web UI is fine. If you do serious coding from your phone, you will miss the app.

A couple of edge-case integrations are also gone. The hosted tool has a one-click integration with GitHub, Linear, and Jira, and a few other services I never used. My self-hosted version has a manual integration with GitHub via a personal access token, and nothing for Linear or Jira because I do not use them. If your workflow depends on a specific integration, check the wrapper’s docs before you start.

A polished first-time user experience is also gone. The hosted tool has a beautiful onboarding flow and a marketing team behind every feature. My self-hosted version has a README, a Discord server, and a maintainer who answers questions when they have time. The gap is real but not deal-breaking, unless you are the kind of person who needs a hand-holding setup. If you can read a README and run a Docker command, you are fine.

Trade-offs

Self-hosting an AI coding tool is not free in time. The first Saturday was real work, and the first month had a few evenings of “why is the API not authenticating” debugging. In our case, the savings are clear: $170 a month on subscriptions, $0 a month on hosting (the NAS was already paid for), and $30 a month on API access. Your math will be different if you do not have a NAS or home server, or if your usage would push the API bill past what the hosted tool costs.

The hardware is also a constraint. The wrapper runs fine on a Synology with 4 GB of RAM, but the API calls go through your home internet connection, so latency (the delay between sending a request and getting a response) is higher than a hosted tool sitting in a co-located data center. For most coding tasks this is invisible. If you spend your day waiting on the model to generate a 10,000-token response, the latency difference is noticeable.

The migration took about a Saturday. One specific thing that was harder than expected was the API key management. The Anthropic console is not designed for self-hosted tools, and the documentation on how to scope a key for a specific use case is thin. One specific thing that was easier than expected was the wrapper itself. HolyClaude is well-built and the maintainer is responsive.

If you are paying more than $50 a month for an AI coding tool and you have a NAS or home server, this is a clear win. If you do not have the hardware, look at a small dedicated box first. If you are paying less than $20 a month, the math does not work out.

Bottom line

If you only do one thing from this article, check whether your current AI coding tool has a self-hosted equivalent. The savings are real, the lock-in goes away, and the setup is not as hard as the marketing pages make it sound. Start by checking the project’s documentation, see if there is a Docker image, and try it on a machine you already have. You can always go back to the hosted version if it does not work out. The breakeven for most people is under six months.

Leave a comment