
Deploy Martin
Martin 1.16: vector tile server for PostGIS, with its own PostGIS 17.
postgis
Just deployed
/var/lib/postgresql/data
martin
Just deployed
Deploy and Host Martin on Railway
Martin is a fast vector tile server from the MapLibre project, written in Rust. It turns PostGIS tables and functions into Mapbox Vector Tiles on the fly and also serves MBTiles and PMTiles files. Web and mobile maps built with MapLibre, Mapbox GL or OpenLayers load its tiles directly.
About Hosting Martin
This template runs ghcr.io/maplibre/martin:1.16.1 next to a PostGIS 17 database built from postgis/postgis:17-3.5. PostGIS installs its spatial extensions on first boot, and the start command skips the old TIGER geocoder, so its empty tables do not clutter the tile catalog. Martin publishes every table with a geometry column when it starts, so redeploy Martin after adding tables. Load data through PostGIS's TCP proxy with psql or ogr2ogr. Tiles and Martin's web UI are public and read-only. Martin restarts automatically until PostGIS is ready. Both fit the Hobby plan for small datasets.
Common Use Cases
- Serving your own map layers such as stores, routes or parcels to a MapLibre app
- Vector tiles computed from live PostGIS data instead of prebuilt tile files
- Replacing a hosted tile service for private or custom geodata
Dependencies for Martin Hosting
ghcr.io/maplibre/martin:1.16.1(official image)postgis/postgis:17-3.5with a volume for the database
Deployment Dependencies
Implementation Details
| Service | Source | Networking | Storage |
|---|---|---|---|
| martin | ghcr.io/maplibre/martin:1.16.1 | public HTTPS | none |
| postgis | postgis/postgis:17-3.5 | private + TCP proxy | volume at /var/lib/postgresql/data |
| Variable | Purpose |
|---|---|
DATABASE_URL (martin) | ${{postgis.DATABASE_URL}} |
DATABASE_PUBLIC_URL (postgis) | Connection string through the TCP proxy, for loading data |
MARTIN_URL | Public tile server URL |
Load data and use the tiles:
ogr2ogr -f PostgreSQL "PG:$DATABASE_PUBLIC_URL" stores.geojson -nln stores
# then redeploy martin; tiles are at $MARTIN_URL/stores/{z}/{x}/{y}
$MARTIN_URL/catalog lists the published sources, and $MARTIN_URL/stores returns TileJSON for a map style. Martin starts four workers.
This is a community-maintained deployment package and does not imply affiliation with or endorsement by the MapLibre organization or the PostGIS project.
Why Deploy Martin on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Martin on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
postgis
postgis/postgis:17-3.5

