Soo.. how do i make my bucket public without

Hello, i’m really new to cloudflare and i’m really intrigued to try cloudflare r2 because of free egress. I’m going to use r2 to host game files, where i can provide game asset to user via in game download feature (video, image, script, text, 3d model, etc).

But im having confusion on how to setup public bucket. I read the documentation that my bucket can either be made public using, or i need to create custom domain. However is rate limited so the only practical way to make my bucket public is to use custom domain, where can i create custom domain? do i need to buy custom domain for it or cloudflare provide one for free ? if i need to buy custom domain, does cloudflare sell very cheap custom domain just for the purpose of making the bucket public ?

And suppose i have custom domain, how does the data transfer from r2 server to user work ? which one below represent the data transfer flow?:
(1) r2 server transfer the data to custom domain server, and then custom domain server transfer data to client
(2) custom domain server redirect to r2 bucket, which then r2 server transfer directly to client?
(3) other ???
If (1) is the case, then i guess it is pointless to use r2 to host file because i need r2 for the bandwidth not for the storage, amazon s3 would be a better platform. If the case is (2), how exactly do i setup my bucket url with my custom domain ??

I’m sorry if this sounds like a newbie question, but i’m having a hard time trying to wrap my head around r2 bucket system. Please help.


The domain sends people directly to Cloudflare via DNS, no redirect involved.

You first either buy a domain on Cloudflare or add your external domain:

Next, you follow the procedure to add the domain to your bucket:

1 Like

Thanks for the reply. So i need to buy domain, then setup cloudflare zone, then rent cloudflare worker, only after all that hidden cost i can finally make my bucket accessible from internet. I was guessing that free egress is too good to be true, i was right :joy:.

But it can potentially still be cheaper than amazon s3 depending on cloudflare worker, or to be precise, how many CPU milisecond does cloudflare worker takes to deliver file from R2 ? this is important because R2 file need to go through cloudflare worker, and cloudflare worker charge user based on cpu time.

Does cloudflare worker only take milisecond cpu time to execute request regardless of R2 file size, or does the cpu time used by cloudflare worker is equivalent to the time needed to transfer file ? For example, if a user need 15 minutes to download 1gb file from R2 through cloudflare worker, does cloudflare worker charges milisecond cpu time to execute the request, or does it charge 15 minutes cpu time?

The answer to question above is necessary to calculate the true cost to host file in R2. If you dont mind, can you please help me answer these question ? sorry for deviating from the post title, i already figured out how to make the bucket public, now i just need to calculate the cost.

You should really already have a domain for the game you are developing. If not, many domains cost 10-20$ per year.

There is no associated cost to this, except that it requires 5-10 minutes of your time.

Workers are a completely unrelated product that you don’t need to make your bucket public.

If you do need Workers for some additional task, Including the costs in a R2 vs S3 comparison doesn’t make much sense, as the same tasks would probably require you to use Amazon’s AWS Lambda.

In the new pricing model, Cloudflare only charges for the CPU time, not the duration of the entire request.

Wait really, how ? So all i need to make my bucket public was just cloudflare domain and cloudflare zone? The tutorial i was following uses cloudflare worker, how do i setup the bucket public with just domain ? If what you say is true, then it is a huge thing!!! so i can basically host my game file with
very small price per year (by buying the cheapest domain and keeping the game file size low).

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.