OpenStreetMap User's Diaries
mbtiles, mbtileserver, tileserver-gl
While editing the next edition of WeeklyOSM, I stumbled upon a fascinating case study that caught my full attention.
A certain team, responding to a certain request, set out to display a mobile device’s geolocation on a map—completely offline, without any network access.
Their initial approach? Crawling OpenStreetMap tile images one by one and stori
While editing the next edition of WeeklyOSM, I stumbled upon a fascinating case study that caught my full attention.
A certain team, responding to a certain request, set out to display a mobile device’s geolocation on a map—completely offline, without any network access.
Their initial approach? Crawling OpenStreetMap tile images one by one and storing them locally.
It didn’t take long before they hit a wall: the data size exploded, and keeping the tiles up-to-date turned into a maintenance nightmare. Sensibly, they scrapped that plan.
Next, they evaluated two open-source tools: tileserver-gl (JavaScript) and mbtileserver (Go).
In the end, they opted for mbtileserver, citing Go’s “security” over JavaScript. I still don’t fully grasp that reasoning (somehow, it involves a decision between verifying their own source code and verifying the entire JavaScript interpreter), and I even asked them in the comments section. But for now, let’s accept that as a given and move on.
After choosing mbtileserver, they needed MBTiles files to serve. Eventually, they discovered tilemaker, a tool that converts .osm.pbf files into .mbtiles.
They successfully tested it on a small area. Encouraged, they moved on to larger datasets. Then came the pain.
“…half an hour passes, and we experience a computer freeze as all the RAM runs out.”
Their machine couldn’t handle the memory load. So they requested a beefy VM—256 GB of RAM—and tried again. Still no luck.
That’s when they discovered tilemaker’s --store
option, which dumps intermediate stages to disk instead of holding everything in RAM. That tweak made it work.
Creating an offline, custom OSM map has been my white whale for years. So I decided to replicate their setup on my own desktop.
I began with installing mbtileserver. That’s when I hit this cryptic error:
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in
According to StackOverflow, the issue stemmed from a broken GCC toolchain. The fix? Replace it with TDM-GCC. That worked.
Next, I needed an .mbtiles file to test.
The BBBike Extract Service came to the rescue—letting me select a custom region. I grabbed one for my hometown and placed it in the required tilesets/
directory.
Running mbtileserver… and it crashed.

Apparently, this kind of crash typically happens when Go calls external C code and something goes wrong—like a segmentation fault. Likely, this server-side tool hasn’t been stress-tested on Windows desktops like mine.
As a last resort, I turned to the JavaScript-based tileserver-gl.
The trick is to download the sample ZIP file (which contains a config file, style sheet, and a sample Zurich MBTiles file), then replace the Zurich MBTiles file with my own hometown MBTiles file that I just extracted from the BBBike extract service.
It started—but with missing text labels.

Even worse, the server would occasionally exit with no log at all.
After some digging, I found others had experienced similar issues—again, only on Windows.

Despite the original team’s success, I hit too many roadblocks—most of them likely tied to running server software in a desktop Windows environment. Their success probably hinged on using a properly configured server environment.
Someday, with access to a dedicated Linux VM, I’ll try again. Maybe.
While editing the next edition of WeeklyOSM, I stumbled upon a fascinating case study that caught my full attention.
A certain team, responding to a certain request, set out to display a mobile device’s geolocation on a map—completely offline, without any network access.
Their initial approach? Crawling OpenStreetMap tile images one by one and stori
While editing the next edition of WeeklyOSM, I stumbled upon a fascinating case study that caught my full attention.
A certain team, responding to a certain request, set out to display a mobile device’s geolocation on a map—completely offline, without any network access.
Their initial approach? Crawling OpenStreetMap tile images one by one and storing them locally.
It didn’t take long before they hit a wall: the data size exploded, and keeping the tiles up-to-date turned into a maintenance nightmare. Sensibly, they scrapped that plan.
Next, they evaluated two open-source tools: tileserver-gl (JavaScript) and mbtileserver (Go).
In the end, they opted for mbtileserver, citing Go’s “security” over JavaScript. I still don’t fully grasp that reasoning (somehow, it involves a decision between verifying their own source code and verifying the entire JavaScript interpreter), and I even asked them in the comments section. But for now, let’s accept that as a given and move on.
After choosing mbtileserver, they needed MBTiles files to serve. Eventually, they discovered tilemaker, a tool that converts .osm.pbf files into .mbtiles.
They successfully tested it on a small area. Encouraged, they moved on to larger datasets. Then came the pain.
“…half an hour passes, and we experience a computer freeze as all the RAM runs out.”
Their machine couldn’t handle the memory load. So they requested a beefy VM—256 GB of RAM—and tried again. Still no luck.
That’s when they discovered tilemaker’s --store
option, which dumps intermediate stages to disk instead of holding everything in RAM. That tweak made it work.
Creating an offline, custom OSM map has been my white whale for years. So I decided to replicate their setup on my own desktop.
I began with installing mbtileserver. That’s when I hit this cryptic error:
cc1.exe: sorry, unimplemented: 64-bit mode not compiled in
According to StackOverflow, the issue stemmed from a broken GCC toolchain. The fix? Replace it with TDM-GCC. That worked.
Next, I needed an .mbtiles file to test.
The BBBike Extract Service came to the rescue—letting me select a custom region. I grabbed one for my hometown and placed it in the required tilesets/
directory.
Running mbtileserver… and it crashed.
Apparently, this kind of crash typically happens when Go calls external C code and something goes wrong—like a segmentation fault. Likely, this server-side tool hasn’t been stress-tested on Windows desktops like mine.
As a last resort, I turned to the JavaScript-based tileserver-gl.
The trick is to download the sample ZIP file (which contains a config file, style sheet, and a sample Zurich MBTiles file), then replace the Zurich MBTiles file with my own hometown MBTiles file that I just extracted from the BBBike extract service.
It started—but with missing text labels.
Even worse, the server would occasionally exit with no log at all.
After some digging, I found others had experienced similar issues—again, only on Windows.
Despite the original team’s success, I hit too many roadblocks—most of them likely tied to running server software in a desktop Windows environment. Their success probably hinged on using a properly configured server environment.
Someday, with access to a dedicated Linux VM, I’ll try again. Maybe.