Home About Me

Building a Personal CDN with FlexCdn on a Mini PC

A while ago I put together a small mini PC, but the specs turned out to be anything but small: an R7-5700U with 8 cores and 16 threads, one 32 GB Lenovo memory stick plus another 16 GB stick, and storage made up of a 2 TB M.2 drive and a 512 GB SATA drive. On paper, it is actually stronger than the office computer I use every day.

Mini PC setup

After installing BaoTa Panel, I used FRP for intranet penetration and deployed several services on it, including Alist, KodExplorer cloud drive, a blog, a password vault, a novel site, and a video site.

Running things on my own server is more controllable in many ways, and the machine has plenty of memory. With FRP, access performance is also acceptable. For the small services I run, this hardware is honestly a bit overkill.

The idea of building my own CDN came after the blog was attacked some time ago. Because there were already some CDN restriction policies in place, the incident did not cause serious consequences. Still, it made me think about whether I could run a CDN myself. I only started putting that idea into practice recently.

Several self-hosted CDN options I looked at

I briefly compared a few solutions before deciding what to use.

  1. Cdnfly: The interface and introduction looked quite good, but I could not access the official website. Even using a proxy did not help, and I could not figure out the reason, so I gave up on it.
  2. 99CDN: The interface is nice, and deployment is simple enough. However, after configuring DNS, I could not add a website successfully. It kept reporting a parameter error, and I could not find out why. It also does not support the latest Ubuntu very well; Ubuntu 22 seems to be the better choice. It has not been updated for a long time, and from what I understand, it is said to be undergoing reconstruction.
  3. FlexCdn: Deployment is very straightforward, basically just one command. Daily use and configuration are also convenient, and it is easy to get started with. The free version supports 10 nodes, which is enough for my needs.

After weighing these options, I finally chose FlexCdn.

Why I picked FlexCdn

The decision mainly came down to a few points:

  1. Deployment difficulty: installation can be done with a single command.
  2. Cost: the free version includes 10 nodes, which is already enough for personal use.
  3. Migration: moving the program is relatively simple.
  4. Updates: it supports online updates.

The free version does not include a user-side client, but for self-use this is not a major issue.

System requirements

Minimum requirements

  • Operating system: Linux, including CentOS, RHEL, Debian, Ubuntu, RockyLinux, AlpineLinux, and other distributions
  • CPU: at least 1 core
  • Available memory: at least 1 GB
  • Available disk space: at least 10 GB

Recommended configuration for CDN systems with more than ten million visits per day

  • CPU: at least 8 cores
  • Available memory: at least 16 GB
  • Available disk space: at least 200 GB

Installing FlexCdn

The installation command is simple:

curl -s https://flexcdn.cn/install.sh | bash

Control panel

The console interface looks like this:

FlexCdn control panel

At the moment, aside from CDN features, the main thing I am using is WAF. If this type of setup fits your needs, FlexCdn is worth a look.