Protomaps: Self-hosting map tiles has gotten cheap and easy bruceroettgers.eu · ...

@best30

Protomaps: Self-hosting map tiles has gotten cheap and easy bruceroettgers.eu · 185 points · 44 comments · HN thread

TL;DR Bruce Roettgers explains how to self-host the Protomaps world map as a single PMTiles file on Bunny.net storage and CDN, citing a cost of roughly $5/month for storage and fractions of a cent per map view versus commercial APIs like Mapbox at $5 per 1k loads. He walks through rclone upload, pull zone settings for Range caching, download throttling and embedding in MapLibre GL.

  • PMTiles is a single-file tile format read via HTTP Range requests, so it can be hosted on any storage bucket with range caching.
  • The full 139GB world map with 5x replication to most continents costs about $5/month in storage on Bunny.net.
  • A Europe map loaded and zoomed to a city transfers about 5MB, roughly $0.00005 in bandwidth at Bunny's rates.
  • Setup requires S3-compatible storage zone, rclone copyurl for upload, enabling 'Optimize for large object delivery', and CORS/referrer restrictions.
  • To limit abuse, the author throttles downloads to 10kB/s after 10MB per request and suggests request-rate or monthly bandwidth caps.
  • Embedding uses the pmtiles npm package as a protocol in MapLibre GL.

Discussion The thread is largely a show-and-tell of people who run Protomaps or similar self-hosted tiles on Cloudflare R2, S3 with CloudFront, Bunny, or via OpenFreeMap, many reporting monthly bills of a few dollars and relief after large Google Maps or Mapbox invoices. The mood is positive and enthusiastic, with a few practical caveats about latency and the tooling ecosystem, plus a brief unrelated security warning about a Bunny-hosted analytics endpoint.

  • Self-hosted PMTiles on object storage plus CDN is cheap and easy (most): Many commenters report running Protomaps on R2, S3 or Bunny for a few dollars a month, describing setup as effortless and bills far below commercial map APIs. Several cite past Google Maps or Maptiler bills as the reason they switched.
  • OpenFreeMap is a strong free alternative (many): Commenters point to OpenFreeMap as a free public option with no limits or keys, which serves tiles from a Btrfs image with hard-linked files and is funded by donations. Some note they donate to it.
  • Direct range-request access is too slow without a server (some): One commenter found cloud storage latency unpredictable and browsers rarely cache range requests granularly, so they put a Martin tile server in front. Another replied that Bunny latency of 100-300ms and CDN range caching worked fine for them.
  • Cloudflare file-size limits constrain range caching (a few): A commenter asked whether Cloudflare's range-request caching still depends on overall file size, linking its caching limitations documentation, suggesting the limit applies regardless of range.
  • Satellite imagery and storage scale are the harder problem (a few): One commenter who built a North America satellite mosaic up to zoom 17 notes that high-resolution global imagery reaches hundreds of TB, far beyond simple bucket hosting, and that the hard parts were seamless blending and cloud filtering.

Links from the comments

#maps #selfHosting #PMTiles #OpenStreetMap #CDN #MapLibre