Protomaps: Self-hosting map tiles has gotten cheap and easy

399 points · 67 comments on HN · read original →

Points and comments are a snapshot, not live.

Protomaps' PMTiles format lets developers self-host world maps via CDN for pennies.

Protomaps offers PMTiles, a single-file tile format accessed via HTTP Range requests, making self-hosting maps cheap and portable. The author details deploying the 139GB world map to Bunny.net for ~$5/month storage, with bandwidth at $0.01/GB. A map of Europe loads ~5MB of tiles, costing ~$0.00005 per load, potentially 100x cheaper than Mapbox's $5 per 1k loads. Setup involves downloading the file, uploading via rclone to Bunny's S3-compatible storage, and embedding with MapLibre GL. The author recommends enabling CORS restrictions and download speed limits to control costs.

What commenters are saying

Commenters widely endorse PMTiles for cost-effective self-hosting, with many using Cloudflare R2. Several note that latency from direct cloud storage can be unpredictable due to granular Range request caching, mitigated by some providers like Bunny or by adding a cache (e.g., CloudFront) or a tile server like Martin. Practical tips: use Cloudflare Workers to convert paths to Range requests, and set download speed limits to prevent bill shocks. A few commenters mention success with PMTiles on R2 for personal hiking maps and parcel maps, costing as little as $2/month.