OpenFreeMap

github x/twitter

What is OpenFreeMap?

OpenFreeMap provides free map hosting so you can display custom maps on your website and apps.

It is truly free: there are no limits on the number of map views or requests you can make, nor on how you use your map. There is no registration page, user database, API keys, or cookies.

It is truly open-source: everything, including the full production setup, is on GitHub. Map data is from OpenStreetMap.

How can I use it?

(Click below, it's interactive!)

Choose a style:

Use the following style in a MapLibre map:

https://tiles.openfreemap.org/styles/liberty

Include MapLibre GL JS in the <head>. If you are using npm, you can install the maplibre-gl package. Make sure to import the CSS as well.

<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
<link
  href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css"
  rel="stylesheet"
/>

Initialize it to a div like this:

<div id="map" style="width: 100%; height: 500px"></div>
<script>
  const map = new maplibregl.Map({
    style: 'https://tiles.openfreemap.org/styles/liberty',
    center: [-0.114, 51.506],
    zoom: 14.2,
    container: 'map'
  })
</script>

If you are currently using Mapbox, please change your libraries to MapLibre GL JS. MapLibre is based on the last open-source version of Mapbox GL JS before it went closed-source. Migrating should be as simple as changing the libraries, as long as you are not using any features specific to the 2.x or later releases.

A Leaflet-based snippet is coming soon.

For mobile apps, you can use the same styles with MapLibre Native.

You can customize the styles using the Maputnik editor. For example, you can remove labels, POIs, or change colors.

When you use a customized style, you need to host the style JSON yourself and use its URL in MapLibre.

Customize Bright

Customize Liberty

Customize Positron

You can also download our processed planet MBTiles and BTRFS images if you want to self-host yourself. Details can be found on GitHub.

How can I donate or support this project?

If this project helps you save on your map hosting costs, please subscribe to one of our support plans here:

On Gold level and above, we offer personalised technical support by email. Otherwise, support is via GitHub Discussions.

If we ever receive a Diamond level supporter, we'll put their logo on this page.

When subscribing to a support plan, you receive an invoice for each of your payments.

Note: if you want to make a single donation, feel free to cancel after the first payment. However, please understand that the nature of this project needs recurring donations to cover the server costs.

Is commercial usage allowed?

Yes.

Who is behind this project?

I'm Zsolt Ero (twitter, blog, email). I built MapHub and have been running map hosting in production for 8 years.

Why did you build this project?

OpenStreetMap is one of the most important collective projects in history. It began almost 20 years ago, and today, 3 million edits are made each day!

Unfortunately, when you want to use the map on your website or app, you need to look for a commercial map tile provider and hope your site doesn't become too popular. Otherwise, you might end up with a $10,000 bill in a single day, as Hoodmaps did.

You can try self-hosting, but it requires a big server and a lot of time to get it right.

I waited for years for someone to offer this service but realized that no one was going to do it. So, I thought I might use my map hosting experience and build it myself.

I'll share more about the reasons in a future blog post. Feel free to subscribe.

How can this work? How can a one-person project offer unlimited map hosting for free?

There is no technical reason why map hosting costs as much as it does today. Vector tiles are just static files. OK, serving 300 million files is not easy, but at the end of the day, they are just files.

Financially, the plan is to keep renting servers until they cover the bandwidth. I believe it can be self-sustainable if enough people subscribe to the support plans.

If this project helps you save on your map hosting costs, please consider subscribing to a support plan.

How can I follow this project?

twitter: hyperknot (details) and OpenFreeMapOrg (announcements)

GitHub: openfreemap and openfreemap-styles

What is the tech stack?

The map schema is OpenMapTiles, the tiles are generated by Planetiler. The styles are forked and heavily modified.

There is no tile server running, only BTRFS partition images with 300 million hard-linked files. I haven't read anyone else doing this in production, but it works really well.

There is no cloud, just dedicated servers. The HTTP server is nginx on Ubuntu.

Currently, it is behind Cloudflare.

Attribution

Attribution is required. If you are using MapLibre, they are automatically added, you have nothing to do.

If you are using alternative clients, or if you are using this in printed media or video, you must add the following attribution:

OpenFreeMap © OpenMapTiles Data from OpenStreetMap

You do not need to display the OpenFreeMap part, but it is nice if you do.

License

The license of this project is MIT. Map data is from OpenStreetMap. The licenses for included projects are listed in LICENSE.md.