---
title: "Deploy Martin"
description: "Martin 1.16: vector tile server for PostGIS, with its own PostGIS 17."
category: "Other"
url: https://railway.com/deploy/martin
---

# Deploy Martin

Martin 1.16: vector tile server for PostGIS, with its own PostGIS 17.

**[Deploy Martin on Railway](https://railway.com/template/martin)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/martin/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Other

## Template content

### postgis https://github.com/postgis.png

- **Image:** postgis/postgis:17-3.5
- **Start command:** `sh -c 'sed -i "/fuzzystrmatch\|tiger_geocoder/d" /docker-entrypoint-initdb.d/10_postgis.sh; exec docker-entrypoint.sh postgres'`

### martin https://github.com/maplibre.png

- **Image:** ghcr.io/maplibre/martin:1.16.1
- **Start command:** `/usr/local/bin/martin --listen-addresses [::]:3000 --webui enable-for-all --workers 4`
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# 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.5` with a volume for the database

### Deployment Dependencies

- [Martin documentation](https://maplibre.org/martin/)
- [Martin 1.16.1 release](https://github.com/maplibre/martin/releases/tag/martin-v1.16.1)
- [PostGIS](https://postgis.net/)

### 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:

```bash
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.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/martin
