Cheaper than cloud storage - colocating my own storage server

Hi there,

as many of you, I have been looking for a new storage solution and I wasn't really happy with the pricing of any of the cloud storage options, so I decided to build my own storage server, which has now been running perfectly for a couple of weeks. As some of you have expressed interest to follow my project, I would like to share my experiences here. There is quite a lot I have to share, so I will divide this into at least two parts.

Let's first get a quick overview of my previous setup, which was working perfectly for the last couple of years: I have a big collection of large files on a google team drive, which I had mounted with rclone on a dedicated server. The server was mainly used to stream the files over the internet. It is also powerful enough to host the occasional CPU-heavy game server (e.g. for satisfactory) and it benefits a lot from Intel's Quicksync, so an Intel CPU with integrated graphics is one of the requirements.

Recently, my team drive has become read-only, so I needed a new storage solution for new files (4 - 6 TB / month). Existing files can stay on the teamdrive for as long as possible, so don't worry, I will still be using rclone :). Everything I store can be found all over the internet and is easily replacable, so I do not really care about data integrity or backups. For my particular use case, I decided that it would be worth it to build my own storage server and colocate at a datacenter. This first part is intended to explain how I arrived at that decision by comparing the cost between different cloud storage options and colocated storage including the hardware that requires. In later parts, I will share more details about the build and any experiences that may help anyone planning a similar project.

Part I: Cost for Cloud vs. Local Storage

Cloud storage

The cheapest trustworthy cloud-storage options that I found were either IDrive e2 or Hetzner storage boxes:
IDrive e2 offers S3 compatible storage for 4$ / TB / month on a flexible plan, or for only 1.67$ / TB / month on a yearly plan.

Hetzner storage boxes vary in price between 3.81€ / TB / month for the smallest box and 2.42€ / TB / month for the largest box (20TB). Boxes can be extended whenever needed, so to save costs I could start with a small box, then extend it, then add another small box, extend it again etc. However, to keep it practical I calculate only with 10 TB and 20TB boxes, as with smaller boxes it would become too cumbersome to manage.

Let's compare the cumulative cost between the options during the first two years. I calculate with 6TB per month, which is the upper end of my requirements, just to give us a little headroom. To compare USD to EUR, I use today's exchange rate of 0.95 EUR/USD.
Unbenannt

The IDrive flex plan is quickly undercut by the Hetzner storage boxes after only 7 months (or 42 TB). However, at the end of the two years, the cheapest (and more managable) option is the IDrive e2 yearly plan. At that point, I would have paid a bit over 4100€ for storage but for the third year alone, I would have to pay that same amount again and so the cost is quickly rising.

So for the long term, would it be cheaper to build my own storage server? I live in a small appartment and don't have the space or a fast enough internet connection to host it at home. Is it feasible to colocate it at a datacenter? Let's try to do the math:

Colocated "Local" Storage

Recurring Colocation Cost

The cheapest colocation option I could find close to my home is at Hetzner in Nuremberg. They offer 14 unit rackspace for 120€ / month + 0.5355€/kWh for electricity and 1.19 € / TB for outgoing traffic over 2TB.
I expect an average power usage of 85 W + 6 W / drive, which would amount to a cost of about 34 + 0.75*NDRIVES € / month for electricity. Outgoing traffic will rarely be more than 2 TB / month, but let's calculate with 5TB / month to be on the safe side, which means ~4 € / month for traffic. Additionally, I would like to have IPv4 connectivity on my server, so I will have to pay an additional 16.18 € for a /29 subnet. Let's also assume 3 trips to the datacenter with my car and 4x 30 min remote hands per year, which would be another 12,50 € + 16,67 € = 29,17 € / month.
Total monthly cost per month for colocation: 207 - 222 €, depending on the number of installed drives.

Server Hardware

I could fit a lot of storage into 14 rack units, but I would need a suitable server case. Many people recommend to get used supermicro or similar server hardware, but those are hard to find and expensive in Germany. Instead, I found a 24 bay hot-swappable 4 unit 19" case on alibaba, which looks exactly like the Inter-Tech 4U-4424 but is much cheaper. The downside of buying on alibaba is that shipping takes a look time (almost two months). The case is compatible with ATX mainboards and power supplies, which allows me to save a lot of money using consumer hardware. I do anyway not care for redundancy for high availability or ECC-RAM. With this case I could build a server that meets (and actually exceeds) all my requirements for less than 1300€, HDDs excluded:

Item Price (incl. tax + shipping)
Case (alibaba version of Inter-Tech 4U 4424) + sliding rails 314.17 €
Mainboard NZXT N5 Z690 Black 109.00 €
2x 32GB G.Skill Aegis DDR4-3000 CL16 RAM Kit 98.56 €
750W NZXT 80+ Gold C Series V2 PA-7G1BB-EU Power Supply 108.99 €
2x 2TB Samsung 970 EVO Plus M.2 NVMe SSD 179.82 €
Intel i5 12600k CPU 249.00 €
Arctic i35 CPU Cooler 22.80 €
2x Dell H200 SAS controller 47.32 €
IBM 46M0997 SAS Expander 33.00 €
4x SSF-8087 to SFF-8643 SAS Cable 0.5m 44.78 €
2x SSF-8087 to SFF-8643 SAS Cable 0.8m 22.99 €
2x SSF-8087 to SFF-8087 SAS Cable 0.25m 21.99 €
Total 1252.42 €

Hard Drives

With a little patience I was able to find 18 TB enterprise HDDs from private sellers with 3+ years warranty. In particular, I bought 4x 18 TB + 1x 20TB drives for 995.49 € (incl. shipping), which should be enough for the first year. I will use 20TB drives as parity drives (more on that in a later part). If these prices stay constant (they are more likely to drop over the years), I expect to pay about 20x 190 € + 4x 240 € = 4760 € for 24 HDDs, giving me 360 TB usable storage (enough for 5 years) and 4 parity drives.

Other One-Time Cost

There are a few more things to buy: First of all, there is a setup fee for the colocation. Moreover, I want a KVM console to be able to remotely access or powercycle the server in case something goes wrong. Luckily, there is a cheap option called PiKVM, which is based on a Raspberry Pi. I have lots of RPis laying around anyway, so I used one of those for "no cost". I will also need a network switch to connect both, the server and the PiKVM, to the internet. A simple unmanged switch would be enough. There are a lot of cheap used rackmount switches on ebay, but they use a lot of power, so I opted for a popular TP-Link 8 port switch and 3D-printed a nice 19" mount for it. I also ordered spares for the SAS-backplanes, because I don't want to wait for them to ship from china in case one fails. Unfortunately, I forgot to order them together with the server case, so I had to pay again for shipping. I guess 4 spares is a bit excessive but whatever.

Item Price (incl. tax + shipping)
set-up fee for colocation and /29 ipv4 subnet 161.53 €
Geekworm KVM-A3 Kit for Raspberry Pi 4 84.89 €
Raspberry Pi 4 0.00 €
Geekworm power supply 20W 5V 4A 12.89 €
TP-Link TL-SG108E Managed Switch 8 Port Gigabit 26.60 €
Rack Power Delivery Unit 17.90 €
4x Spare Backplanes 99.03 €
2x 2m CAT6 Ethernet Cable 7.98 €
M6x16 Cage Nuts 30 Pack 6.99 €
50x #6-32 UNC x 6mm HDD screws 5.14 €
Zivacate 120 velcro straps 6.49 €
Total 429.44 €

Comparison

Now that we have a good estimate for the cost of colocating storage in a datacenter, let's compare it to the cloud options:
Unbenannt
If I intend to keep the data for more than 36 months, it is cheaper to colocate my own storage.
For this comparison, I added the cost of the dedicated server to the cloud storage options (47 € / month). If I colocate my own, I can get rid of that server. Moreover, I assumed that I buy a new drive every 3 months. This would save electricity (and HDD-wear) for unused storage capacity, maximize warranty periods and take maximum advantage of decreasing HDD prices (although the calculation assumes constant prices). In reality, it is more practival to buy a couple of drives once a year.

At the end of the 5 year period, when the server is full, I will have saved more than 4000 € - enough to replace a lot of failed hardware parts, if needed. From then on, ignoring hardware fails and assuming no further growth after 5 years, the monthly cost for the colocation would be 222 € (0.62 €/TB) compared to 571 € (1.59€ / TB) with e2. Even if I assume a 20% HDD failure rate after 5 years and assume that I bought all HDDs at once in the beginning and that HDD cost remains the same - all very pessimistic scenarios - the replacements would only increase the cost to 0.84 €/TB, so I think the risk is managable.

It would have been even cheaper to use Hetzner storage boxes or e2 in the first year and then migrate to local storage when the cost exceeds the recurring colocation cost, but I didn't want to bother dealing with two setups and storage migration.

Also in favor of local storage are faster access times and not having to worry about the upoad/download bandwidth to the cloud. Of course it is possible that cloud storage providers could become much cheaper within the next 5 years, but I doubt they will undercut 1€ / TB. I also entirely ignored the value of my own time and labor, but I personally consider this to be a plus, because it is a fun a hobby of mine that I very much enjoy spending time on.

In part II I will explain the hardware selection and the configuration of the server.

Disclaimer: The prices listed in this post are what I paid at the time and may be out of date.

Tagging @ashlar and @durval, as promised.

8 Likes

Thanks a lot for the tag!

I will read avidly.

1 Like

are u colo in your own or are u doing with some pp to split the cost?

On my own so I have full control over the traffic / power consumption. I am also planning to add another server for a couple of services that are currently running on a quite expensive vps.

Great post! Many thanks for tagging me! Looking forward to Part II!

1 Like

nice am myself trying to do this as well but due to lack of found i might try to do it with some pp

Nice summary, thanks for that!
Been thinking about doing the same but having it hosted @home as I've got a decent upload speed.

I was thinking about just getting an external HDD closure (4-bay probably) and start of with one or two HDDs and keep expanding as required. As I would mostly store non-critical stuff on it, I don't want to spare on HDD as paritiy drive due to costs. But, I saw that Backblaze offers a personal service that allows you to sync your stuff to them for 70 bucks a year.

Problem is, they do not offer a Linux client but I was thinking about spinning up a Windows VM and passthrough the external closure to the VM to use the Windows client instead.

Anyone had a thought on that?

BackBlaze offers a service that it calls 'b2' and which works, on Linux, with BackBlaze's own command-line client and with rclone. I myself use it with rclone. Perhaps though I misunderstand what you have in mind; b2 is a cloud service, and seemingly you want to host your data yourself . .

I feel like OP overlooked a few options...

  • In the time OP was looking at the prices, you where able to get a auction storage server from Hetzner with 15 * 10TB drives for around 170 Euro per month. That alone was 1.30 Euro/TB.
  • Or a SX64 ...

If we look at todays situation, auction storage servers are expensive but the regular SX65... servers are 1.87 Euro / TB (if one drive is used for Raid 5), or as OP stated, he does not care about the data, that means 1.40TB. If he ran out of space, ... then you move from the SX65 to SX135.

  • Found OP his calculations also very optimistic. I did the same calculations for my own project and that was at home (so no 120 Euro colocation) and 32cent, instead of the 50 cent in power usage. And the bill grew to 0.85+/TB.

I see 0.75 Euro / month per disk in Electricity? How ... A basic 6W * 24h * 30 days is 4.3Kw in power. Doing with my cheaper 32 cent electricity price, makes it 1.38 Euro / month. If we take OPs 53 cent / kwh, that is 2.28 Euro/Month per disk. So unless OP is sleeping a bunch of drives, that 0.75 Euro / month number is way off.

Then there is the average 80W usage ... 12600k, 2x H200, SAS expender... That 80W is not average but the lowball for this configuration because the H200 and SAS expander are going to eat easily 40W+ ...

Then there is the 190 Euro for a 18TB, 240 Euro for a 20TB ... Those are not new drives, and a refurbs so forget about that 5 year failure rate. Each failure is another drive you need to buy, but also remote hand AND rebuild (what can be another drive failure)... That 3 year warranty means nothing from ebay sellers.

In other words, it might just be that OP is break even compared to a just renting a storage server at hetzner (or getting a cheap, at that time auction storage server).

Just taking OP numbers, moving his dedicated 47 Euro server, minus a SX64 96 Euro price at that time, means that he paid 49 Euro for at that time 4x16TB drives. So ... 1.02 Euro / TB (raid 5). Or with a SX65, 124 - 47 = 77 for 4x22TB = 1.16 Euro / TB.

And again, more drives can simply be getting another server or upgrading to a higher capacity one.

Lets be honest, OP, you simply wanted to colocate with your own hardware :wink:

Thanks a lot for your detailed response. First of all, sorry to I never followed up with part two. I will still do that at some point.

You raise a few valid points, however I still think my solution is cheaper in the long run.

This one I may have overlooked, indeed. I do remember checking server auctions, but I don't think I have seen such an offer. If I recall correctly the SX64 had 4x16TB drives and was about 115€ here in Germany. That's almost 1,80€ / TB.

Those were released 5 days ago... Also, I do not care about the data enough to pay for a backup, but I still use parity drives (4 once all bays are full).

You're right, it should be 2.28 €/Months. I'm not sure what I did there, sorry. Maybe I was thinking about sleeping them back then but I'm not doing that now.

Not sure what to tell you here other than that power usage in the last couple months has been consistently around 75kwh/month, which amounts to an average power draw of 105W. That is with 5 drives installed and includes also a network switch and a PiKVM. Meanwhile, the electricity price has been reduced a bit to 0.476 ct/kwh.

As I said in my initial post, I bought them from private sellers, not from ebay. They are NOT refurbs. I put a lot of effort into finding those and making sure that they indeed are covered by warranty for at least 3 years

Except that the SX64 does not fulfill my hardware requirements on the CPU. I need an intel iGPU. So instead of calculating with 96€ - 47€ (price was higher in Germany btw.) you should calculate with 96 + 47€. Also your calculation wouldn't scale with adding more server, since I only had one 47€ dedicated server.

Of course I did, I would never do such a thing if I had no interest in managing my own hardware. But I do think I'm saving money in the long run.

Btw. the server has been running great since October. I have been paying 170-180€ / month for colocation, IP-subnet, electricity and traffic with 6 drives installed. No failures or downtime so far. No remote hands needed, although I had to make one trip to the datacenter, because I locked myself out of my PiKVM when I updated it, which stopped tailscale from starting up again (known issue that could have been avoided if I head read the PiKVM documentation properly). But we could combine the trip with a visit to the Nürnberger Christkindlesmarkt, which made my girlfriend happy, so that was a plus :smile:

I will try to write part two of this sometime in the next couple of weeks.

1 Like

https://webcache.googleusercontent.com/search?q=cache%3Ahttps%3A%2F%2Fwww.hetzner.com%2Fdedicated-rootserver%2Fsx64%2F&oq=cache%3Ahttps%3A%2F%2Fwww.hetzner.com%2Fdedicated-rootserver%2Fsx64%2F&gs_lcrp=EgZjaHJvbWUqBggAEEUYOzIGCAAQRRg7MgYIARBFGDoyBggCEEUYPNIBCDEwODBqMGo0qAIAsAIB&sourceid=chrome&ie=UTF-8

96.75 Euro (inc 19%) ...

The new SX65 jumped the price up a lot (28 Euro). For what is technically, 4 * 4TB more storage and 2 * 1TB NVME, with 2 Extra Zen2 cores.

I like that you can actually use that low end storage server now for more then just storage thanks to the NVME drives but that was some nice price premium.

Wait when you see how much the older SX63 used to cost! Until Hetzner used the whole Chia HDD mining as a excuse to increase the prices.

SX 63: 82 EUR ( E3-1275 ) with 4x 16TB
SX 64: 96 EUR ( AMD 3600 ) with 4x 16TB
SX 65: 124 EUR ( AMD 3700X ) with 4x 22TB + 2x 1TB NVME

A rather worrisome price evolution in my book. And Hetzner has also been pulling a lot of those SX63 and older auction servers, so they can use them for storageboxs. That is why the action servers are missing. Yea, people love to rent those but hetzner has been slowing the release of those. Notice also the lack of SX64 in the auctions, when SX65 is out.

I admit, been looking more into colocation or another alternative for my project, because of those price increases. Makes it difficult for long term planning.

True ... Still way too darn expensive at 0.476, when residential already dropped to 0.32 for over a year. If only we had actual proper glassfiber here in Germany, instead of this ridiculous 1000/200 for 70 bucks. We have a home in Spain and that has 1000/1000 for 20 Euro!! per month. If we paid 30 Euro, we can get 10.000/10.000. I checked a few years ago, and you where able to get a 1Gbit fiber for like 200 per month (and i mean with a actual SLA, not just a home fiber).

I am rather surprised that your two H200 / SAS expander are not the bulk of your power bill, as those things normally eat 10 a 15W / piece. That 12600K, yea, MB/CPU can idle down to 20W range. I did include your Pi/netwerk etc in my 80W estimate (forgot to write it down). So, close i got lol

Think we all know what your doing with that server (after mentioning the need for a intel iGPU) :wink:

Yea, that is the issue with over protecting a server... The risk of locking yourself out. This has really, REALLY never happened to me before, why are you looking at me like that... really, i never locked down a server to accept SSH from a single IP, and forgot when moving that my IP changed. It really never happened ! :blush:

Will love to read it.