How to make a CDN

I am not really sure if its even possible, but is there some kind of Open-Source Self-Hosted CDN software? I’m new to this so please don’t bully me on the comments.

Hello! A CDN is just a webserver, with some extra configuration at the network level.

If you’re unfamiliar with how BGP routing works between Internet operators, all you have to know is that each operator (AS - Autonomous System) has links to others, and can decide:

  • where through to route its own traffic to other AS (eg. your AT&T ISP may have a direct route to OVH (where is hosted), or may go through a 3rd party transit provider like Level3 (for a much higher cost)
  • in which Points of Presence (PoPs) to advertise which routes to its own network ; you can advertise address only from your Paris PoP and let other AS find the best route to you, and at the same time advertise address from Paris, Moscow, Beijing, etc…

A CDN is more or less an IP address announced from many places, pointing to different servers depending on where you access it from, but with a single TLS certificate for HTTPS. So if you try to reach it from AT&T, you’ll get traffic directed to a datacenter in USA, etc…

So, on a system level, it’s REALLY easy to deploy a CDN. It’s just a webserver. On a network level, it’s more complicated because you need your own IP block that’s announced on your own network. In fact, that’s not entirely true as you can find (very costly) network operators that’ll do that for you.

Did i answer your question? :)

Zoë Tech Corner

This did explain to me what a CDN is/how it works yes! Thank you! I just have now to learn or try to understand exactly how could this possibly be set up.

723d kinda works like a CDN, but it is probably not what you are looking for.

I think there was some open source javascript based CDN software, but I forgot the name. Sorry.

Zoë Tech Corner

I’ll check it later, thank you!

Yes, you can run for example Nginx or Varnish or Caddy web server software to serve static content like images and java script files. Here an example.

Zoë Tech Corner

I’ll have a look when i have some free time, thx!

Apache HTTP Server with load_balancing modules can work like it too.

There is also HAProxy.

What’s your goal with the CDN? Distributed file storage?

Or mount a community network to support FLOSS services between each one.

Zoë Tech Corner

For now I’m just trying to understand how it works, and how is it possible to make one. But something like website hosting (which I do believe is in the file storage category)

You don’t self-host a CDN. The CDN is hosting around the world so users connect to closer servers.


A sefhosted network of cdn servers would be cool though. Basically a more generalized webtorrent.

Zoë Tech Corner

In this case of self-hosting I mean my self managing the CDN network, even if its like let’s say Linode hosting it for example, instead of beying like cloudflare CDN.

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links


  • Posts must be relevant to the open source ideology
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon from

  • 0 users online
  • 30 users / day
  • 49 users / week
  • 116 users / month
  • 357 users / 6 months
  • 24 subscribers
  • 324 Posts
  • Modlog