---
title: "Prepare your Postgres for MapTiler Server | Guides | Self hosting | Map server"
description: "Set up PostgreSQL database for MapTiler Server vector tiles."
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Prepare your Postgres for MapTiler Server

Do you want to use MapTiler Server **vector** **tiles** **generating on the fly**feature and you wonder how to set up your Postgres database? In this article, we will show how!

## Installation

-   installed PostgresSQL 9.5 or higher
-   enabled [PostGIS](https://postgis.net/) extension version 3.0 or higher
    -   For native installation please see the official tutorial targeting your platform [https://postgis.net/install/](https://postgis.net/install/)
    -   If you do not have any running database, the easiest way to start is with Postgis docker image: [https://hub.docker.com/r/postgis/postgis](https://hub.docker.com/r/postgis/postgis)

MapTiler Server serves vector tiles gziped. If you enable [gzip](https://github.com/pramsey/pgsql-gzip) extension in your database, tiles will leave your database compressed. This may reduce network traffic between your database and Server.

## Common issues

MapTiler Server uses public.geometry\_columns view and relies on correct geometry columns initialization. In practice, geometry columns are often created without proper SRID. MapTiler Server will inform you about this inconsistency and provide a dialog to help you set the correct SRID.

![warn.png](./warn_ca0e35fa23.png)

![setSrid.png](./setSrid_e127cdcffa.png)

## Useful links

[How to import spatial data to PostGIS for MT Server](https://docs.maptiler.com/guides/self-hosting/map-server/how-to-import-spatial-data-to-postgis-for-maptiler-server)  
[Vector tiles from PostgreSQL](https://docs.maptiler.com/guides/self-hosting/map-server/vector-tiles-from-postgresql)  
[Advanced SQL editing](https://docs.maptiler.com/guides/self-hosting/map-server/advanced-sql-editing)
