Skip to content

Run a VersaTiles Server Locally with Docker ​

This short guide shows how to launch a VersaTiles server on your machine in just a few commands.

TIP

To expose the server on a public domain, see Deploy a VersaTiles server with Nginx.

Prerequisites ​

Before you begin, make sure you have Docker properly installed.


Option A — Minimal image: versatiles ​

The image versatiles contains only the VersaTiles Rust server. Choose it if you already have your own frontend or want finer control.

First, download the frontend and tile data into your current directory:

bash
wget "https://github.com/versatiles-org/versatiles-frontend/releases/latest/download/frontend-dev.br.tar.gz"
wget -c "https://download.versatiles.org/osm.versatiles"

Then start the server (the -s flag accepts .br.tar.gz directly):

bash
docker run --rm -it \
  -p 8080:8080 \
  --mount type=bind,src="$(pwd)",dst=/data,readonly \
  versatiles/versatiles:latest \
  serve \
  -s /data/frontend-dev.br.tar.gz \
  '/data/osm.versatiles'

Open http://localhost:8080/ in your browser to confirm the server is running.

See the full image documentation in the versatiles directory of the versatiles-docker repo.


Option B — Bundled frontend image: versatiles-frontend ​

The image versatiles-frontend packages the VersaTiles server together with the latest developer frontend already baked in. Only the tile data needs to be on disk:

bash
wget -c "https://download.versatiles.org/osm.versatiles"
bash
docker run --rm -it \
  -p 8080:8080 \
  --mount type=bind,src="$(pwd)",dst=/tiles,readonly \
  versatiles/versatiles-frontend:alpine \
  '/tiles/osm.versatiles'

The image's entrypoint already runs versatiles serve --static /app/frontend-dev.br.tar, so only the tile source has to be passed. Variants are tagged alpine, debian and scratch (latest points at alpine); the older latest-alpine style names still work but are deprecated aliases.

Then browse to http://localhost:8080/.

See the image documentation in the versatiles-frontend directory of the versatiles-docker repo.


Resources ​

Released under Unlicense