Show HN: OpenFreeMap – Open-Source Map Hosting (opens in a new tab)openfreemap.org
848 pointsHi HN,
After 9 years of running my own OpenStreetMap tile server infra for MapHub (https://news.ycombinator.com/item?id=11389989), I've open-sourced it and launched OpenFreeMap.
You can either self-host or use our public instance. Everything is open-source, including the full production setup — there’s no 'open-core' model here. Check out the repo (https://github.com/hyperknot/openfreemap). The map data comes from OpenStreetMap.
I also provide weekly full planet downloads both in Btrfs and MBTiles formats.
I aim to cover the running costs of the public instance through donations.
Looking forwards for your feedback.

Comments (234) 54 threads
Earlier commentsWith 1TB free traffic from the CDN, and pretty small costs for S3 and Lambda@Edge, it's probably even cheaper to self-host I guess. Even lower costs would be possible by entirely using CloudFlare services (CDN, R2)...
Question, why use btrfs?
- MBTiles - an SQLite file, each file is a row in a table, you need a server to serve it.
- PMTiles - a single file, optimised for serverless usage.
- Extract them into a directory, which in practice should be on a partition image. This is the approach I choose.
I tested ext4 and Btrfs and I choose Btrfs. The reason is how ext4 and Btrfs handles inodes. Btrfs handles inodes so much better compared to ext4, it doesn't allocate them at start and also allows putting tiny files right with the metadata.
Because here the average tile size is only 405 bytes, most of the tiles can actually stored with the Btrfs metadata block. From the latest run:
Btrfs data is 51.57GiB
Btrfs metadata is 84.37GiB
I've been making some custom map stuff for mountain bike trails and I'd really like to move to self-hosted vector tiles for all layers, but too much of what I find says to start with Planet.osm when all I really need is a State (in the US) or even a few-miles-wide area.
(My goal is to basically snapshot OSM data, generate tiles, and use that until I decide to do another snapshot down the line, so the underlying data doesn't change. And limit it to a small area because that's all I need.)
Examples of maps I've done this way, and want to improve, are: https://trailmaps.app/ramba/ and https://trailmaps.app/dte/
Another option is to use the extract functionality in pmtiles [4] to extract your area of interest from their daily full-planet pmtiles builds. You can then statically host that file and use that in your client with one of their client libraries.
[1] https://github.com/onthegomap/planetiler
[2] https://download.geofabrik.de/
[3] https://gdal.org/en/latest/programs/gdalwarp.html
[4] https://docs.protomaps.com/pmtiles/cli#extract
I wanted to give repackaging the btrfs image a shot but the download was pretty slow - I assume your server is getting HN-hugged a bit so I didn't want to make it worse and stopped the download.
[1] https://erofs.docs.kernel.org/en/latest/index.html
btrfs.openfreemap.com just a public Cloudflare bucket, no idea why it might be slow.
Continue this thread — 1 reply
https://i.postimg.cc/tCn1xSRF/image.png
p.s. very cool project indeed
edit: I don't know how it happened, but while panning the map with the mouse, the map flipped upside down.
https://i.postimg.cc/sggZ2pHh/image.png
The Vatican situation is trickier than you'd think, as it's on country level, while Rome is on city level, and naturally you'd want to give countries a priority over cities. Like on low zooms you only want to show countries, then as it gets closer you show cities. Well, except for Vatican.
All comments shown.
Couldn't load more comments. Check your connection and try again.