Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

makina-maps

> DevOps
Open source

Full Stack to Build, Serve and Update your own Vector and Raster Tiles from OpenStreetMap Data.

100 stars0 likes4 views
WebsiteGitHub

About

Full Stack to Build, Serve and Update your own Vector and Raster Tiles from OpenStreetMap Data.

Makina Maps

Full Stack to Build, Serve and Update your own Vector and Raster Tiles from OpenStreetMap Data.

Makina Maps render tiles on request, no need to pre-generate all tiles on huge MBTiles archive: fast setup, fast update.

  • Build Vector Tiles on request from the OpenMapTiles database and schema
  • Served Mapbox GL Styles, with sprites and fonts with embed TileServer GL
  • Render Raster version of Mapbox GL style (TileServer GL)
  • Cache vector and raster tiles (NGINX)
  • Update from OpenStreetMap

Install

Install as system dependencies: git, make, docker and docker-compose.

Clone Git reposittory

Get the project:

bash
git clone --recurse-submodules https://github.com/makina-maps/makina-maps.git
cd makina-maps

Get default GL Json Styles and Fonts, or use your owns:

bash
git clone -b gh-pages https://github.com/openmaptiles/osm-bright-gl-style.git tileserver-gl/styles/osm-bright-gl-style
git clone -b gh-pages https://github.com/openmaptiles/klokantech-basic-gl-style.git tileserver-gl/styles/klokantech-basic-gl-style
git clone -b gh-pages https://github.com/makinacorpus/cassini-gl-style.git tileserver-gl/styles/cassini-gl-style
git clone -b gh-pages https://github.com/openmaptiles/fonts.git tileserver-gl/fonts

Setup Docker images

Build and Fetch docker images:

bash
docker-compose build
cd openmaptiles
docker-compose pull

Import OpenStreetMap Data

OpenMapTiles initial Load

Use the management scripts from openmaptiles directory.

bash
cd openmaptiles

To reset from a previous install and erase database, run:

docker-compose down -v

Import generic data, not from OpenStreetMap:

../scripts/10-import-generic.sh

Prepare import by download OpenStreetMap data and setup configuration for an area. The area names are from Geofabrik, store it in the data directory:

../scripts/20-import-prepare.sh andorra

Import the OpenStreetMap extract:

../scripts/30-import-extract.sh

The scripts 20-import-prepare.sh or 30-import-extract.sh can be replayed with the same or other area.

Update OpenMapTiles data

From the openmaptiles directory.

Run the updater. It loops over pending updates, then wait for new update.

../scripts/40-update.sh

You can stop with CTRL-C, it will quit at the end of the current update.

Imposm marks tiles to expire. Then a script in the nginx container watches and expires tiles in the nginx cache.

Run the tiles server

To reset the tile server from a previous install (does not touch the OpenMapTiles database), run:

docker-compose down -v

From root directory. Start the OpenMapTiles database and the web server.

bash
cd openmaptiles && docker-compose up -d postgres postserve && cd ..
docker-compose up

Access to cached tiles and services at the following URLs - assuming your are hosting locally:

  • Demo: http://127.0.0.1:8080
  • OpenMapTiles TileJson: http://127.0.0.1:8080/data/v3.json
  • Default "Bright" GL JSON Style: http://127.0.0.1:8080/styles/bright/style.json
  • Default "Bright" raster:
    • TileJSON: http://127.0.0.1:8080/styles/bright.json
    • Raster tiles: http://127.0.0.1:8080/styles/bright/{z}/{x}/{y}.png

Configuration

Configuration file is Tileserver-GL configuration file tileserver-gl/config.json.

Get more detail about this configuration at the Tileserver-GL documentation.

Styles

javascript
  "styles": {
    "bright": {
      // Path to the Mapbox-GL Style
      "style": "osm-bright-gl-style/style-local.json"
    },
    "basic": {
      // Disable the render as raster (no PNG...)
      "serve_rendered": false,
      "style": "klokantech-basic-gl-style/style-local.json"
    }
  },

Vector tiles data sources

Where the vector tiles are come from. Can be generated on the fly from OpenMapTiles database, other external source or local MBTiles files.

javascript
  "data": {
    // Name of the source, here OpenMapTiles v3
    "v3": {
      // On demand tiles, internal URL
      // Alternatively could be a MBTiles
      // This option is specific to Makina Maps and not available in standard Tileserver-GL
      "remote_tilejson": "http://postserve:8090/"
      }
    }
  }

Public URLs

The domains may be adjusted. There used only for raster tiles.

javascript
    "domains": [
      // Publicly available domains, for raster tiles
      "a.example.com",
      "b.example.com"
    ],

The vector tiles source (tilejon) should be overwritten to expose public URLs.

javascript
  "data": {
    "v3": {
      "remote_tilejson": "http://postserve:8090/",
      "tilejson": {
        "tiles": [
          // Public available URLs of vector tiles
          "http://a.example.com/data/v3/{z}/{x}/{y}.pbf",
          "http://b.example.com/data/v3/{z}/{x}/{y}.pbf"
        ]
      }
    }
  }

The tiles URLs in tilejson from vector tiles producer are internal to the docker-compose and refer to internal host. Should be redefined as public URLs for outside world.

Tiles cache

Environment variable define the size of the cache of tiles.

yaml
      - CACHE_KEYS_ZONE_SIZE=50m # 8000 tile keys per 1m, in memory
      - CACHE_MAX_SIZE=20g # File storage

Download Tiles Rate Limit

There is a rate limit for typical browser usage in NGINX configuration.

The rate limit can be increased using an URL parameter key or by host white list. It is mainly to allow tiles download at higher speed. Should be configured in nginx/map

"this-secret-key-allows-download-at-highspeed" "";

Overview

Architecture overview, workflow.

…

Clear the tiles cache first. Then request the tiles server.

docker-compose down --volumes
docker-compose -f docker-compose.yml -f docker-compose-benchmark.yml run --rm artillery artillery run artillery.yaml

Random order tiles request on mixed urban and rural area, without concurrency. Time from server, HTTP included.

Source Delay
Zoom 12 mixte Europe 50 ms
Zoom 13, mixte Europe 49 ms
Zoom 14, mixte Europe 60 ms
Zoom 14, urban Paris 250 ms
From cache 5 ms

Issues· 18 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptdockermapbox-glopenmaptilesopenmaptiles-schema

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理