---
title: "Self-host Maps with Protomaps and Supabase Storage"
description: "Protomaps lets you serve a self-hosted vector basemap as a single static PMTiles file, and Supabase Storage supports the HTTP Range Requests needed to read it directly from a public bucket."
url: "https://swe.quest/articles/self-host-maps-with-protomaps-and-supabase-storage-74300faebca9e4a3"
canonical: "https://supabase.com/blog/self-host-maps-storage-protomaps"
source: "Supabase"
published: "2024-06-19"
difficulty: "medium"
kind: "How-to"
reading_minutes: 6
tags: ["geospatial","serverless","frontend","mobile"]
---

# Self-host Maps with Protomaps and Supabase Storage

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2024-06-19, 6 min read, How-to. Original: [https://supabase.com/blog/self-host-maps-storage-protomaps](https://supabase.com/blog/self-host-maps-storage-protomaps)

## Summary

Protomaps lets you serve a self-hosted vector basemap as a single static PMTiles file, and Supabase Storage supports the HTTP Range Requests needed to read it directly from a public bucket. The walkthrough extracts a bounding box with the pmtiles CLI, uploads it, and renders it with MapLibre GL via the pmtiles protocol. Because public bucket CORS can't be configured, a Deno Edge Function can proxy range requests to a private bucket using the service role key and enforce an origin allowlist. Optionally, Expo's experimental 'use dom' components can run react-map-gl in React Native, since maplibre-react-native lacks custom protocol support.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Maps & geospatial](https://swe.quest/tags/geospatial.md) (Domains)
- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [Mobile](https://swe.quest/tags/mobile.md) (Web & mobile)

## Prerequisites

- HTTP range requests
- CORS basics
- JavaScript web mapping ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))

## Keywords

Protomaps, PMTiles, Supabase Storage, MapLibre GL, Supabase Edge Functions, Expo, react-map-gl, Deno

## Related posts

- [Generate Vector Tiles with PostGIS](https://swe.quest/articles/generate-vector-tiles-with-postgis-b14acc8d0f59fc3b.md): Supabase · 2024-06-26 · Medium · 6 min read · Maps & geospatial, PostgreSQL, Frontend
  PostGIS can generate Mapbox Vector Tiles on demand from Postgres rows, so a MapLibre GL client can render large point datasets while transferring only the data for the current viewport and zoom level.
- [Supabase Storage now in Beta](https://swe.quest/articles/supabase-storage-now-in-beta-146dd8398549e2a4.md): Supabase · 2021-07-27 · Medium · 7 min read · Storage systems, Identity & auth, PostgreSQL, JavaScript
  Supabase Storage moves to Beta with range-request streaming for audio/video, whole-bucket public visibility (private by default, to avoid S3-style per-object exposure), directory uploads via the File and Directory Entries API, an RLS policy editor with SQL templates, and a local-filesystem backend so self-hosted setups need no S3.
- [Supabase Edge Runtime: Self-hosted Deno Functions](https://swe.quest/articles/supabase-edge-runtime-self-hosted-deno-functions-55b12d1d5db96506.md): Supabase · 2023-04-11 · Medium · 7 min read · Serverless, Runtimes & VMs, JavaScript, Rust, Open source
  Supabase Edge Runtime is an MIT-licensed, Rust-based web server built on deno\_core that self-hosts Deno Edge Functions (TypeScript, JavaScript, WASM) without code changes.
- [Edge Functions are now available in Supabase](https://swe.quest/articles/edge-functions-are-now-available-in-supabase-3c06235615e01037.md): Supabase · 2022-03-31 · Easy · 7 min read · Serverless, CDN & edge, TypeScript, System design
  Supabase Edge Functions run TypeScript globally on the Deno runtime via Deno Deploy across 30+ data centers.
- [Edge Functions: Node and native npm compatibility](https://swe.quest/articles/edge-functions-node-and-native-npm-compatibility-4f29863e45494db0.md): Supabase · 2023-12-12 · Medium · 3 min read · Serverless, JavaScript, Observability
  Supabase Edge Functions now natively support npm modules (via \`npm:\` imports) and Node built-in APIs, so existing Node apps using Express, node-postgres and Drizzle can migrate with minimal changes.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
