La Technique

Coming down from the cloud

(Updated )

As someone who develops web software not just for a living, but also for the occasional hobby, it’s only natural that I keep an internet-connected server running 24/7, as a platform for experimentation and for running the odd app and service. Folks like me commonly subscribe to cloud providers for this, often AWS or Azure, sometimes smaller players like Digital Ocean.

I rented a low-cost virtual machine from OVHcloud for a while, until I realized that all the things I wanted to run on an internet-connected server are all for personal use only, i.e., I’m currently not interested in serving web apps to the public internet and having the responsibilities that that might entail. This allowed me to consider pulling out of the cloud, to bring home my always-on, always-connected computing needs.

Home server economics

A big reason for running a server at home is cost savings, but several factors and trade-offs need to be considered.

In an attempt to compute the total cost of ownership of a home server, for my purposes, I considered only two factors as relevant: the upfront cost of the hardware and the running cost of electricity. The cost of network connectivity is irrelevant as I pay for broadband at home regardless.

  • Hardware: A proper commercial server is an expensive machine costing thousands of dollars, but all I really need is any computer that can run the software I want to run, so what I bought is a pre-loved Dell Wyse 5070 for the low, low price of PHP 3,500 (around USD 62.50; more about this Wyse device later). I needed three additional peripherals though: a UPS (USD 39.20, the smallest and cheapest APC model I could find; for safety reasons I wanted a recognizable brand and a brand-new unit, not used, for this component), a DisplayPort-to-HDMI cable (USD 8.04) and a USB keyboard (USD 3.57, a much-used, chunky, HP-branded office keyboard, with the key caps already discolored by age). Total ‘capital expenditures’ on hardware: USD 113.30.
  • Electricity: According to the internet, the Wyse 5070 is very frugal at idle, consuming 3 to 6 watts when it’s just sitting waiting to become useful. (I don’t have a power meter so I cannot confirm this with my particular unit.) As far as I know, this is comparable to the power consumption of a typical home WiFi modem-router. Using a constant 5 W, I get a rough estimate of 3.6 kW per month of power consumption, which, given the high prices of electricity in the Philippines, translates to about PHP 40 per month (USD 0.71).

Now, let’s compute the payback period. With OVHcloud, the cheapest VPS (‘Starter’ plan) costs USD 4.20/month, although there is a new-customers-only promo of USD 0.97 for the first year. Using the regular rate, and then comparing to my hardware and electricity costs in my home server setup, I estimate that I would recoup my investment only after 32.46 months, or under three years. I might be able to realize bigger savings afterwards, although UPS batteries do not last very long, and therefore I can expect that my unit will need refurbishing around the same time when I will supposedly have recouped my initial costs.

There are at least three aspects not considered in the purely financial computations above.

One: the computing resources afforded by a home server differs from that of a server rented from the cloud. Typically, you’ll get a lot more powerful machine if you buy your own. The OVHcloud Starter plan comes with 1 virtual CPU core, 2 GB memory, 20 GB of SSD storage, and 100 Mbps of network connectivity for the first 1 TB of traffic per month (to be throttled to 10 Mbps afterwards, for the rest of the month). Note that this is already significantly cheaper than an equivalent EC2 virtual machine instance from AWS, for example. The Wyse I bought has a quad-core 2017-model Pentium CPU (probably slower in single-thread applications than the OVHcloud VPS, but at least it is not a shared vCPU that can get artificially throttled under heavy and continuous load), 8 GB of RAM, and a 128-GB SSD. My internet connection at home is only 50 Mbps, although this has always been more than sufficient for my needs, and I’ve never seen it throttled (I’m not a particularly heavy user).

Two: the physical maintenance effort involved in running a server by yourself. With cloud providers, you never have to bother with peripherals and plugs and parts and placements. You just click around on a web console, and you let the cloud people deal with the tedious physical reality behind it.

And three: actually, you should not take the computations above too seriously, as I only made them ex post facto the decision to try running a server at home. I already wanted to run a server at home, for the sheer joy of getting to tinker with new hardware. I scratched my head when I realized the payback period would take nearly three years, as I feel like my interests would already move on before then! But it’s really a hobby, and the pure fun of setting up this computing contraption is already more than worth its cost in currency.

Let’s continue to pretend, however, that this was an objective, rational decision, and allow me to continue sharing about the considerations I had in this mini-project.

Reliability anxiety

Going from cloud to home, from managed service to self-hosted, raises concerns about reliability.

One is about the stability of the computer. This is already entering theoretical, obsessive-compulsive territory, but before buying the Wyse, I thought about ECC memory, which as far as I know is one of the things that make proper servers both super stable and super expensive. (Although I’ve also read that the ECC/non-ECC divide between server and consumer hardware is merely an artificial market segmentation imposed by the chip companies.) I was worried, quite absurdly, about the higher likelihood of my server crashing because it’s mere consumer-grade hardware made to run 24/7, while I conveniently forgot that my Android phone is also a computer that has been doing exactly that, for years, in my pocket, without issue.

And then there’s power and connectivity: the reliability of which are also things I’ve taken for granted with cloud computing over the years, and which now I had to worry about. At my current location, both services are fortunately reliable, but I still bought the aforementioned UPS for insurance against power outages. (This is in fact the first time ever I’ve bought a UPS.) For connectivity, my ISP’s service has been most acceptable, so I did nothing extra. (Note though that connectivity is also a power question, because modem-routers also need a power source to continue running during blackouts, an issue that I also addressed with the UPS.) Home lab enthusiasts on Reddit talk about adding cellular data modems to their setup as a backup, an option I didn’t want to bother with. My server and I can survive being disconnected from the internet from time to time.

A Wyse choice of hardware

There were two qualities I needed for the hardware I’d use as a server: it needed it to be cheap, and it needed to be low-power (so that running it in the long term would also be cheap, in terms of electricity costs). Ideally, it should also be small, and, to be even more unobtrusive and low-maintenance, should be fanless.

I have an old and battered laptop lying unused in the house (a 2017 Asus VivoBook) which could have worked for my needs if only I weren’t hesitant about the safety of running it 24/7 with its old battery, and doubtful of how much longer its mechanical hard drive would last. I also considered getting a Raspberry Pi, until I learned about the inconveniences of setting it up as a home server (it does not even have a power button; it needs additional components and the costs quickly add up), not to mention that I prefer to have a system with an x86 CPU rather than the ARM ones that the Pi uses.

Luckily, I came across a humble shop selling refurbished units of the Dell Wyse 5070, tucked away in one of the aging malls in Cubao in Quezon City. I asked about the origins of the computers, and I was told something vague about them coming from Korea, and I didn’t ask further. Incidentally, some time later, while I was at a bank, I noticed that the computers the tellers were using were Dell OptiPlex thin clients screwed to the back of monitors—the OptiPlex is the branding used for the newer models of what used to be the Wyse. I came home suspecting that the computer I bought is really a decommissioned and auctioned unit from some big local company.

The CPU at the heart of the Wyse 5070 is the quad-core Intel Pentium Silver J5005, a low-power chip based on the Gemini Lake microarchitecture. Gemini Lake is the 2017 iteration of the CPU architecture that debuted as the Intel Atom processor, and would later become the ‘E’ cores (for ‘Efficiency’) in Intel’s latest CPUs (starting with 2022’s Alder Lake, the 12th generation Intel Core processors). The J5005 is low-power enough to not require active cooling, and indeed the Wyse is a silent, fanless machine.

It came installed with a questionably licensed copy of Windows 10 Pro, and an even more suspicious copy of Microsoft Office: the person at the shop told me to use specific shortcut icons in the desktop to access the Office programs rather than click through the Start menu. Later, at home, I would also discover that the computer would often not properly shut down or reboot, seemingly an issue with the copy of Windows it came with, because it went away when I wiped the disk and installed Ubuntu Server (Linux).

Speaking of the disk, it is an SSD by Kingchuxing, a manufacturer I haven’t heard of before, and which Google tells me is a dirt-cheap brand from China. No worries though, it’s been running for months and is still alive. Running the smartctl utility, I’m told it has a serial number of 2023122200561, so it was likely a component installed during refurbishing. It also had a Power_On_Hours value of only 4 when I first ran the utility, so it seemed brand new at the time. That Power_On_Hours stat has been increasing more or less as expected since I first checked it.

The Wyse also came with an unbranded USB WiFi dongle that seems to be based on some Realtek chip. It’s been working flawlessly as well, even in Linux except for a minor issue during Ubuntu Server installation when the automatic WLAN scan didn’t work, although manually entering the SSID name and password worked. (When I tried Ubuntu Desktop on the unit though, booted live from a USB stick, the WLAN scan worked flawlessly, so it was probably just a minor bug with the Ubuntu Server installer.)

While setting up the machine, I connected it to my daily-driver monitor, but afterwards it’s been running headless, tucked away in a corner of my room next to the WiFi router.

Ubuntu Server in the house

I’ve been an Ubuntu user since 2007, and it’s my favorite Linux distribution, so I didn’t think twice about installing the Server edition of the OS to run my new-old Wyse box. I did the Server edition install after trying out the Desktop edition on it, booting from a USB stick, to confirm that all the important components worked on Linux, and also after checking if there is some sort of product key for the copy of Windows on the machine that I could back up in case I wanted to revert—I didn’t find any, but proceeded anyway to wipe the disk clean and never looked back.

Ubuntu/Linux’s disk tools also revealed that there are actually two storage devices in the box. In addition to the 128-GB Kingchuxing SSD, there is apparently a 16-GB SD card or card-like device attached to the system. I haven’t opened the box so I haven’t seen this directly, but it’s there, and looking up the technical specifications of the Wyse online, it appears that this is intended to be the default or fallback storage device for the machine. It’s marketed as a thin client PC, after all.

It’s a little funny in hindsight, but because I’m using Linux, I had to test even the power button, if it plays nice with the OS. Specifically, I tested if pushing the button sends the shutdown command properly to the OS, which is important because of my plan to run the unit headless.

I also went through the BIOS settings, and found an auto-on setting that’s perfect for my home server intentions: if there’s a power outage, and it goes on long enough that even my UPS runs out of juice, this setting allows the computer to automatically turn back on whenever the power comes back. It’s great for the hypothetical scenario when I’m away from home for an extended period, I’ve come to rely on services I’m running on the box, and then a blackout knocks the server out of service. Without this setting, I’d then have to ask my brother to come home to push the button on the Wyse. What an inconvenience! (Irony intended.)

Still on the absurd side of things: I tested this BIOS setting by yanking the power adaptor while the system was running, and then plugged it back on. The test was successful, and there was no damage to the computer—as far as I can tell.

The abundance of BIOS settings on this machine is interesting though, and it clearly shows that this is a product intended for a demanding enterprise environment. Another pleasant surprise was the firmware (BIOS) update notification I received from fwupd, a Linux utility I hadn’t encountered before, and which led me to learn about the Linux Vendor Firmware Service. It’s great to see that this 2018-model computer is still getting BIOS updates in 2024, and it’s great to see the commitment of vendors like Dell to the Linux ecosystem. It’s come a long way from when I first used Linux approaching two decades ago.

One of the last tests I did to prepare the Wyse for headless server use was to check how long it takes to reboot and get back online. Here, I discovered a 2-minute delay in the boot process due to the system waiting on the Ethernet connection to come online. I’m not using this port, of course (I’m using the WiFi dongle to connect the device), so with the help of an Ask Ubuntu answer, I applied a one-line configuration change to Netplan to remove the boot delay. A sudo reboot-to-login-prompt process now takes only around 45 seconds, comparable to what I’m used to with cloud virtual machines.

NAT an easy task with Tailscale

As mentioned in a previous post, the magical existence of Tailscale was another major motivation for me to try out the home server setup. I’ve tried making web apps on my machine accessible through the public internet many years ago, using port forwarding, but was foiled by the use of CGNAT by residential ISPs in the Philippines (and I guess in most or all other countries). The heroic arrival of Tailscale, with its ability to punch through firewalls and other obstacles, makes it extra simple and easy for me to use my home server as if it’s a public-facing host, accessible from anywhere with internet access, while still being private, and secure without the hassle of other lockdown methods (e.g., IP-based restrictions).

Some of the neat things that Tailscale provides are MagicDNS and Tailscale Serve. The former is what allows any device in my private Tailscale network (or ‘tailnet’, as they call it), namely my Wyse server and all my other personal devices, including my Android phone, to connect to each other using a custom domain name, instead of just numbers (IP addresses and ports) like in the wild old days. This means that, for my Wyse server, which I’ve labelled as gemini in my tailnet (after Gemini Lake), I can simply type in ‘gemini’ in my browser address bar to reach the web apps I’m running on it. I can even do HTTPS, which is essential for some types of web development, by using a fully qualified version of the MagicDNS name: gemini.<tailnet-name>.ts.net. This HTTPS mode is enabled by Tailscale Serve, which runs an HTTP server that automatically provisions the necessary TLS certificates, through Let’s Encrypt. It’s all very neat and easy.

Of course there are some caveats and wrinkles to this newfangled way of doing networking. In my case, as of the last time I checked, Tailscale didn’t yet have a way of serving multiple domains from the same device. This means that, to get the affordances of MagicDNS and HTTPS for multiple apps or services running on the same box, I had to put them on different paths under one subdomain, using Nginx as a reverse proxy behind the Tailscale server. This setup might cause some issues if the apps or services are not built to support non-root-path installations.

Application speculation

So, what am I actually running on my home server? After all that trouble, I’m mainly hosting just two applications for now, that at least I use on a daily basis: the RSS reader Miniflux, and my little notes app Leornianite. Clearly I still have to find the time to do more of the experimentation and development I’ve wanted to do with this home server.

Previously, with my OVHcloud VPS, I executed some long-running Python scripts to automate some tasks I needed to do around the web. This is something I can do now with the Wyse should the need arise again.

There is one script that I am running now on a systemd timer every minute of every day on this box: it pings the excellent, free Healthchecks.io service, so that I’m alerted whenever the box goes down or gets disconnected. This has had the side-effect of allowing me to finally quantify the uptime of my internet connection at home: in the last 30 days as of this writing, my home server was not able to reach Healthchecks.io for only three minutes. That’s a 99.993% uptime—not bad!

Other home server, or home lab, enthusiasts on the internet will be happy to tell you about what they use their machines for. A lot of them run Jellyfin to serve their personal media libraries; I don’t maintain a media stash anymore, so this does not appeal to me. (Note that if I wanted to, I could easily plug external hard drives to the Wyse 5070’s generous offerings of USB ports, for bulk media storage.) Others run self-hosted versions of popular cloud services, like Nextcloud or ownCloud. I prefer to outsource mission-critical needs like these to established service providers.

Run time

A final note on this cloud-to-home migration: this is only about moving the main machine, not about abstaining totally from cloud services. To be on the internet, after all, is to be interdependent. My Wyse box relies on Amazon SES to send me emails for notifications and potentially other content. (I run Postfix locally only for SMTP relay.) Currently, the only data I need to backup from the server is a small database, and I decided to push the dumps to Amazon S3. Because my usage of these services are so small, the costs are negligible; after months, Amazon still has not billed me a single dollar, presumably because my usage has not accrued enough to be worth it.

So there it is, my small black box blinking quietly in the corner of my room, communicating with the world through the wires and (radio) waves of the internet. I hope the hardware continues to be healthy for many years, and for the supporting services to continue to be reliable. I’m looking forward to having more fun and learnings with this humble home server setup.

A Dell Wyse 5070 thin client computer next to a window. It is a small, slim, black PC, a vertical box about 7 inches tall and 7 inches deep, and only about 1.5 inches thick, mounted on a plastic base. You can see the power button and various ports on the narrow front panel, along with the Dell logo. The side panels have a grid-pattern surface structure that makes it look like a proper server computer, and probably helps with cooling the fanless system.

P.S. Do not leave your computers under direct sunlight, like in the image above, except for brief periods, for the ’gram.

Next:
Previous: