Mantica
Self-hosted MBTiles / PMTiles atlas with MapLibre UI
Introduction
Mantica (Latin mantica — a traveler’s bag): maps you keep with you on your own host.
Serves local *.mbtiles / *.pmtiles, a MapLibre front-end, catalog downloads, and optional geocoding proxies. HTTP Basic auth is optional (both credentials together, or none).
Default listen: 127.0.0.1:8091 (NixOS module). CLI default is :8080.
GET /health — liveness (no auth)
- UI at
/
- Tile / map APIs under
/api/*, /services, /pmtiles/
NixOS (flake)
{
inputs.mantica.url = "github:NickRI/mantica";
inputs.mantica.inputs.nixpkgs.follows = "nixpkgs";
# modules = [ inputs.mantica.nixosModules.default ];
}
{
services.mantica.enable = true;
services.mantica.workDir = "/var/lib/mantica";
# Optional Basic auth (both or neither):
# services.mantica.authUserFile = config.sops.secrets."mantica/username".path;
# services.mantica.authPassFile = config.sops.secrets."mantica/password".path;
}
Downloads
Latest binary: GitHub Releases
curl -fsSL -o mantica-linux-amd64.tar.gz \
https://github.com/NickRI/mantica/releases/latest/download/mantica-linux-amd64.tar.gz
tar -xzf mantica-linux-amd64.tar.gz # → ./mantica
Run locally
go run . -dir . -listen :8080
# with auth:
go run . -dir . -auth-user USER -auth-pass PASS
nix build
./result/bin/mantica -dir .
-dir is the data root (default .):
| Path |
Purpose |
<dir>/tilesets/ |
*.mbtiles / *.pmtiles |
<dir>/settings.json |
UI settings |
<dir>/downloads.json |
Download jobs |
<dir>/hashes.json |
Checksum verify state |
<dir>/geocode-cache.gz |
Geocode LRU |
<dir>/downloads/ |
In-progress download workdirs |
Keep runtime state out of git.
Options (NixOS)
| Option |
Default |
Description |
services.mantica.enable |
— |
Enable service |
services.mantica.listenAddress |
127.0.0.1 |
Bind address |
services.mantica.port |
8091 |
Listen port |
services.mantica.workDir |
/var/lib/mantica |
Data root (-dir) |
services.mantica.authUserFile |
null |
Basic auth user file (with authPassFile) |
services.mantica.authPassFile |
null |
Basic auth password file |
services.mantica.geocoderKeysFile |
null |
JSON API keys for geocoders |
services.mantica.geocodeCache |
32MB |
Geocode LRU size (0 disables) |
Develop
go build -o mantica .
make release-artifacts
nix build