# Using OpenSearch maps server

**URL:** <https://forum.opensearch.org/t/using-opensearch-maps-server/15184>\
**Category:** OpenSearch Dashboards\
**Tags:** discuss, troubleshoot\
**Created:** [July 20, 2023, 7:48pm UTC](https://forum.opensearch.org/t/using-opensearch-maps-server/15184 "2023-07-20T19:48:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![vityca](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@vityca](https://forum.opensearch.org/u/vityca)\
**Post date:** [July 20, 2023, 7:48pm UTC](https://forum.opensearch.org/t/using-opensearch-maps-server/15184/1 "2023-07-20T19:48:41Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS):

OpenSearch, OpenSearch Dashboards latest versions  
opensearch-maps-server docker container 1.0.0  
OS version Debian 11

**Describe the issue** :

I want to parse some logs with IP data and bring it through geoip processor in order to make map with this information. I learned how to install and configure self-hosted maps server and go through all steps in documentation.

But my server with opensearch maps has no internet access (but I hoped that “self-hosted” means hosted in isolated environment) which is needed for his work because it loads .js libraries.

If anyone has come across this issue, I’d love to hear how I can fix it.

---

<div class="post-metadata">

**Author:** ![Navneet](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/navneet/32/3645_2.png) [@Navneet](https://forum.opensearch.org/u/Navneet)\
**Post date:** [July 20, 2023, 8:25pm UTC](https://forum.opensearch.org/t/using-opensearch-maps-server/15184/2 "2023-07-20T20:25:36Z")

</div>

@junqiu can you help here?

---

<div class="post-metadata">

**Author:** ![junqiu](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@junqiu](https://forum.opensearch.org/u/junqiu)\
**Post date:** [July 20, 2023, 10:12pm UTC](https://forum.opensearch.org/t/using-opensearch-maps-server/15184/3 "2023-07-20T22:12:24Z")

</div>

Hi @vityca, are you using the docker container from docker hub or build by your self from Github source code? If you build by yourself, it will require internet connection. If you use from docker hub, it shouldn’t require internet when you start the map server.

---

<div class="post-metadata">

**Author:** ![vityca](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@vityca](https://forum.opensearch.org/u/vityca)\
**Post date:** [July 21, 2023, 2:40pm UTC](https://forum.opensearch.org/t/using-opensearch-maps-server/15184/4 "2023-07-21T14:40:16Z")

</div>

@junqiu I’m using official docker image, not source code. In that time I can’t post screenshots of my work. But if someone try to install this maps server following official documentation 2.8 in isolated environment without internet connection, configuration fails. Because in source code of html page (ctrl+u [http://localhost:8080](http://localhost:8080) by the documentation) you can see that mapgl.js loads from net repository. If you run this page with F12 (for Firefox) and open debug page, there is error to load mapgl.js

---

<div class="post-metadata">

**Author:** ![vityca](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@vityca](https://forum.opensearch.org/u/vityca)\
**Post date:** [July 23, 2023, 10:55am UTC](https://forum.opensearch.org/t/using-opensearch-maps-server/15184/5 "2023-07-23T10:55:37Z")

</div>

Hi @junqiu, hi @Navneet, now I’ll provide all my research with virtual machines  
There is Debian 12, not 11, but nothing changes in this case, all steps will be same as on Debian 11  
I use only official documentation ([Using the self-host maps server - OpenSearch documentation](https://opensearch.org/docs/latest/dashboards/visualize/selfhost-maps-server/)) and for maps in this example will be used this map ([https://maps.opensearch.org/offline/planet-osm-default-z0-z8.tar.gz](https://maps.opensearch.org/offline/planet-osm-default-z0-z8.tar.gz)).  
First step is pulling image. On isolated environment we can `docker pull`, `docker save` maps server docker image on computer with internet access and then `docker load` on local machine without internet connection, it’s not a problem.  
Second step is loading selected maps. This will more complicated but ok.

```auto
docker run \
    -e DOWNLOAD_TILES=https://maps.opensearch.org/offline/planet-osm-default-z0-z8.tar.gz \
    -v tiles-data:/usr/src/app/public/tiles/data/ \
    opensearch/opensearch-maps-server \
    import

```

In this command we see url path to our map because this docker container download map with `curl` command. In isolated environment this can be passed by starting http server with command `python3 -m http.server` in folder where we transfered our selected map from computer with internet connection. And our command will be like that:

```auto
docker run \
    -e DOWNLOAD_TILES=http://<our_local_ip>/planet-osm-default-z0-z8.tar.gz \
    -v tiles-data:/usr/src/app/public/tiles/data/ \
    opensearch/opensearch-maps-server \
    import

```

If we run this command downloading will be passed.

**Figure\_1! I’ll post this in next message because of limitations**

This ip just default for docker network.

Third step is run docker to serve with command `run`:

**Figure\_2! I’ll post this in next message because of limitations**

As we can see all starts properly without errors and now we go to our `localhost:8080`

**Figure\_3! I’ll post this in next message because of limitations**

With blank page :)))

This happens because off loading js library (let’s enter ctrl+u on page)

 ![изображение](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/5/54accac5ccdec7fb554795b613ffe9d9d8fcde1f.png)

And if you want more you can go to debugger on previous page

**Figure\_4! I’ll post this in next message because of limitations**

As we can see “self hosted maps server” needs internet connection. And I guess my case also can interesting for other people and we can help each other.  
In the end of this message I’ll write some troubleshoot things I tried.

I tried rewrite this `demo.html` page to load libraries from my local machine with `<script src="http://localhost:8000/maplibre-gl.js"></script>` also serving this with `python3 -m http.server` but this not works for me. And a tried to rewrite `demo.html` to load libraries from docker volume `docker run -v path:path` this is also not works for me.  
But I’m think that this tries just attempts to fast work and not reliable at all.

---

<div class="post-metadata">

**Author:** ![vityca](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@vityca](https://forum.opensearch.org/u/vityca)\
**Post date:** [July 23, 2023, 10:56am UTC](https://forum.opensearch.org/t/using-opensearch-maps-server/15184/6 "2023-07-23T10:56:15Z")

</div>

**Figure\_1**

 ![fig_1](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/a/ae7aaeb24f802c04511f74a2cf96cb2d481ef809.png)

---

<div class="post-metadata">

**Author:** ![vityca](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@vityca](https://forum.opensearch.org/u/vityca)\
**Post date:** [July 23, 2023, 10:56am UTC](https://forum.opensearch.org/t/using-opensearch-maps-server/15184/7 "2023-07-23T10:56:48Z")

</div>

**Figure\_2**  
 ![изображение](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/8/84db906f3b8168ff7c025e5b044b11afc9171efb.png)

---

<div class="post-metadata">

**Author:** ![vityca](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@vityca](https://forum.opensearch.org/u/vityca)\
**Post date:** [July 23, 2023, 10:57am UTC](https://forum.opensearch.org/t/using-opensearch-maps-server/15184/8 "2023-07-23T10:57:23Z")

</div>

**Figure\_3**

 ![изображение](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/b/b842d304e48dd362c9b98c7a8edabab34d9bd1e2.png)

---

<div class="post-metadata">

**Author:** ![vityca](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@vityca](https://forum.opensearch.org/u/vityca)\
**Post date:** [July 23, 2023, 10:58am UTC](https://forum.opensearch.org/t/using-opensearch-maps-server/15184/9 "2023-07-23T10:58:27Z")

</div>

**Figure\_4**

 ![изображение](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/2/2a40c41c0f7f612add370efda174555331a86fd3.png)

---

<div class="post-metadata">

**Author:** ![vityca](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@vityca](https://forum.opensearch.org/u/vityca)\
**Post date:** [July 25, 2023, 3:50pm UTC](https://forum.opensearch.org/t/using-opensearch-maps-server/15184/10 "2023-07-25T15:50:59Z")

</div>

@junqiu any thoughts?  
Or this problem is narrow and need some time to look around

---

<div class="post-metadata">

**Author:** ![junqiu](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@junqiu](https://forum.opensearch.org/u/junqiu)\
**Post date:** [July 25, 2023, 5:00pm UTC](https://forum.opensearch.org/t/using-opensearch-maps-server/15184/11 "2023-07-25T17:00:08Z")

</div>

Hi @vityca, thanks for providing the details. The [http://localhost:8000](http://localhost:8000) is only the demo page for maps server which used maplibregl library, which shouldn’t block maps server function usage in OpenSearch Dashboard(OSD).

Could you help verify if the [http://localhost:8080/manifest.json](http://localhost:8080/manifest.json) and [http://localhost:8080/tiles/data/0/0/0.png](http://localhost:8080/tiles/data/0/0/0.png) have response, if yes, then you can check the following step to set up the map server in your use case:

There are three main maps app in the OSD Visualization(Region Map App, Coordinates Map App and Maps App), in order to use self-host maps server in OpenSearch Dashboards Visualization:

- For Region Map App and Coordinates Map App, you can set up maps server by doc [Using the self-host maps server - OpenSearch documentation](https://opensearch.org/docs/latest/dashboards/visualize/selfhost-maps-server/#option-1-configure-opensearch_dashboardsyml) with manifest endpoint [http://localhost:8080/manifest.json](http://localhost:8080/manifest.json)

- For Maps App, you can add a custom layer with TMS type with endpoint: [http://localhost:8080/tiles/data/{z}/{x}/{y}.png](http://localhost:8080/tiles/data/%7Bz%7D/%7Bx%7D/%7By%7D.png) by doc [Using maps - OpenSearch documentation](https://opensearch.org/docs/latest/dashboards/visualize/maps/#adding-a-custom-map)
