Use Docker

You can use Docker to run the Open Street Map tile server on a Windows machine using the Windows Subsystem for Linux (WSL) or directly on an Ubuntu server. This approach allows you to quickly set up and run the tile server without needing to install all dependencies manually.

This example assumes that Docker is already deployed on a Windows machine and that Ubuntu 22.04 LTS is the distribution in use.

These steps are described in more detail on the Using a Docker container page at Switch2OSM.

  1. Start the Ubuntu application on your Windows machine.

  2. Download data for your region of interest to the home directory of the Ubuntu user (assumed to be renderaccount in this example).

    wget https://download.geofabrik.de/europe/united-kingdom-latest.osm.pbf
  3. Create a docker volume for the data:

    docker volume create osm-data
  4. Install it and import the data:

    docker run  -v /home/renderaccount/united-kingdom-latest.osm.pbf:/data/region.osm.pbf  -v osm-data:/data/database/ -v osm-tiles:/data/tiles/ overv/openstreetmap-tile-server  import
  5. Check for the following message at the end of the process:

    INFO:root:  Import complete
  6. Start the tile server:

    docker run -p 8080:80 -v osm-data:/data/database --shm-size="192m" -v osm-tiles:/data/tiles/ -d overv/openstreetmap-tile-server run

    Note: The amount of shared memory for the docker container has been increased to 192 MB to ensure successful processing of the united-kingdom-latest.osm.pbf data. It might be necessary to further increase the amount of shared memory for other larger datasets.

  7. Check to see that it is working by browsing to:

    http://your.server.ip.address:8080
  8. If this installation is on your own computer, you can browse to:

    http://localhost:8080