Technology

Host a world map for $5 a month

Bruce Röttgers self hosted a 139GB world map with PMTiles on Bunny.net for about $5 a month in storage.

StartupHub.ai Staff

By StartupHub.ai Staff, reviewed by Daniel Singer, Editor

2 min read

World map tiles served from single PMTiles file on CDN
PMTiles on Bunny.net

Bruce Röttgers self hosted a 139GB world map to avoid per-load API pricing. He built the stack for Mapboard and says storage with 5x replication runs about $5 a month. Bandwidth to Europe and North America costs $0.01 per GB, he says, which makes a 5MB Europe view cost $0.00005.

The trick is one file plus Range requests.

PMTiles is a tile archive that packs a full zoom pyramid of Mapbox Vector Tiles, which are pre-cut vector squares a browser fetches as you pan and zoom, into a single file. HTTP Range requests are byte-slice reads that let the browser pull only the tiles in view instead of downloading the archive, Röttgers explains. Bunny.net can cache those slices when you enable Optimize for large object delivery, he says. That file-first design is why a laptop load of Europe with a city zoom moves about 5MB, he says, or roughly $0.05 per 1,000 loads against Mapbox at $5 per 1,000 after the free tier.

Get the planet from the Protomaps build page or cut it smaller with the CLI by bounding box and zoom levels. Upload through an S3 compatible storage zone with rclone, Röttgers says, because the HTTP API timed out after 15 minutes for him. A pull zone is a CDN endpoint that fetches from storage on a cache miss and serves later hits from edge PoPs, and you should lock yours to your CORS origins under Allowed referrers and cap speed at 10kB/s after 10MB, he says. Cloudflare does not cache those Range slices the same way, so it needs an edge function to translate x/y/z paths, he says.

Embed with MapLibre GL plus the pmtiles npm protocol, add a style per the official guide, and you have a global map with local cache doing most repeat work. Watch abuse controls and request rate limits from day one because legitimate panning still fires many small reads.

Mentioned in this story

Markets

CloudflareNYSE:NET

Sources

Get the free daily brief every morning

Every morning the day's AI news, new AI startups and new funding rounds. Free and takes a few minutes to read, unsubscribe at any time.

Join 64,000 other subscribers.

TopicsProtomapsPMTilesBunny.netMapLibre GLMapboxCloudflareMapboard

StartupHub.ai Staff

Written by

StartupHub.ai StaffEditorial team

The staff writers of StartupHub.ai, ranging from investment analysts to avid AI tool users, early adopters and critical enthusiasts. Backgrounds span engineering, business and the arts. We hold every piece to rigorous standards of research and review.

Daniel Singer

Reviewed by

Daniel Singer is an AI expert who has been writing about, covering and building AI technology since 2018.

Test your Agent Readiness now

Paste your website. How well ChatGPT, Claude and the other agents can read and use a site, in about a minute.

Watch

The videos behind the news, one flip at a time

The feed mixes the videos from our articles with startup demos and you flip through them like TV channels for free with no signup.