Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 2.32 KB

local_server_docker.md

File metadata and controls

40 lines (27 loc) · 2.32 KB

How to run a local VersaTiles server using Docker

In this guide, we will explain how to set up and run a local VersaTiles server using docker.

Note

The VersaTiles server is written in Rust (Repo: versatiles-rs). The docker containers are specified in the repo versatiles-docker

Prerequisites

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

You also need to download the tiles.

Usage

Start the VersaTiles container with the latest image including the front-end user interface by executing the following command in the same folder where the file *.versatiles is located:

docker run -p 8080:8080 --mount src="$(pwd)",dst=/tiles,type=bind,readonly versatiles/versatiles-frontend:latest-alpine \
versatiles serve -s frontend.br.tar -i 0.0.0.0 '[osm]/tiles/planet-latest.versatiles'

Open http://localhost:8080/ in your browser. It should look like this: Screenshot of the frontend

Explanation

The Docker command example above contains quite a bit of information, so we should break it down:

  • docker run starts the Docker container.
  • -p 8080:8080 maps the port 8080 inside of the container to the outside.
  • --mount src="$(pwd)",dst=/tiles,type=bind,readonly mounts you current directory to /tiles inside of the container.
  • versatiles/versatiles-frontend:latest-alpine is the name of the Docker image. You can also choose one of the other images.

Now we have configured docker run. The following arguments are for the VersaTiles server inside:

  • versatiles server run versatiles in server mode.
  • -s frontend.br.tar adds the included frontend.
  • -i 0.0.0.0 listen on every IP.
  • '[osm]/tiles/planet-latest.versatiles' use the mounted *.versatiles file. Change this if your file has a different name.

For more information, see the documentation on using the VersaTiles server.