# Host Elastic Maps Service locally

**URL:** <https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347>\
**Category:** Kibana\
**Tags:** docker, maps\
**Created:** [November 3, 2023, 10:07am UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347 "2023-11-03T10:07:48Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manal\_A](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manal_a/32/123992_2.png) [@Manal\_A](https://discuss.elastic.co/u/Manal_A)\
**Post date:** [November 3, 2023, 10:07am UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347/1 "2023-11-03T10:07:48Z")

</div>

I use an offline virtual machine (Red Hat), and I want to create some maps. So, I followed the documentation of hosting Elastic maps service locally, and I'm going to use the Docker image for the map server.

However, when I execute this command :  
`sudo docker run --rm --init --publish 8080:8080 \docker.elastic.co/elastic-maps-service/elastic-maps-server-ubi8:8.8.1`

I receive this error :  
`{"log.level":"error","@timestamp":"2023-11-03T10:04:34.826Z","process":{"pid":7},"host":{"hostname":"37ce03cfc7b5"},"log":{"logger":"Elastic Maps Server"},"message":"Unable to connect to the Elasticsearch cluster: http://elasticsearch:9200","ecs":{"version":"1.6.0"}}`

I'm not sure if I need to configure something before this?

Ps : For your information, I'm using two distinct virtual machines. I pulled the Docker image in my Kibana instance, and Elasticsearch is in another instance.

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [November 3, 2023, 10:20am UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347/2 "2023-11-03T10:20:47Z")

</div>

A command line like that is not passing any configuration, so you are running the server with all the defaults that imply that your elasticsearch server (used to validate you have an Enterprise license) is available at `http://elasticsearch:9200`.

In general, you need to pass a configuration file as documented here via a docker bind mount.

> **[Connect to Elastic Maps Service | Kibana Guide \[8.10\] | Elastic](https://www.elastic.co/guide/en/kibana/current/maps-connect-to-ems.html#elastic-maps-server-configuration)**

In that configuration file, you set up your Elasticsearch cluster settings and any other details.

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [November 3, 2023, 11:04am UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347/3 "2023-11-03T11:04:07Z")

</div>

To check the default configuration, you can run this command:

```auto
docker run --rm \
 docker.elastic.co/elastic-maps-service/elastic-maps-server-ubi8:8.8.1 \
 cat /usr/src/app/server/config/elastic-maps-server.yml

```

and check the defaults for connecting to Elasticsearch are:

```yaml
# Required settings for the URL and basic authentication parameters for your Elasticsearch
# cluster for license verification.
elasticsearch.host: 'http://elasticsearch:9200'
elasticsearch.username: 'ems'
elasticsearch.password: 'changeme'

```

---

<div class="post-metadata">

**Author:** ![Manal\_A](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manal_a/32/123992_2.png) [@Manal\_A](https://discuss.elastic.co/u/Manal_A)\
**Post date:** [November 3, 2023, 11:13am UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347/4 "2023-11-03T11:13:38Z")

</div>

Thank you very much,  
I got this error when running this command:

```auto
docker run --rm \
 docker.elastic.co/elastic-maps-service/elastic-maps-server-ubi8:8.8.1 \
 cat /usr/src/app/server/config/elastic-maps-server.yml

```

I think it's due to the fact that I'm on an offline machine:

```auto
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Trying to pull docker.elastic.co/elastic-maps-service/elastic-maps-server-ubi8:8.8.1...
Error: Error initializing source docker://docker.elastic.co/elastic-maps-service/elastic-maps-server-ubi8:8.8.1: error pinging docker registry docker.elastic.co: Get "[https://docker.elastic.co/v2/":](https://docker.elastic.co/v2/%22:) dial i/o timeout

```

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [November 3, 2023, 12:38pm UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347/5 "2023-11-03T12:38:36Z")

</div>

If you already have a container running the image, then you can alternatively run `docker exec` on that container as well.

```auto
docker exec [YOUR-CONTAINER] cat /usr/src/app/server/config/elastic-maps-server.yml

```

---

<div class="post-metadata">

**Author:** ![Manal\_A](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manal_a/32/123992_2.png) [@Manal\_A](https://discuss.elastic.co/u/Manal_A)\
**Post date:** [November 8, 2023, 9:56am UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347/6 "2023-11-08T09:56:54Z")

</div>

Thank you

For updates, it's good. I have my Docker container containing the Docker image. I've created a bind mount, and when I try to run `docker-compose up` , I encounter this error :

```auto
**sudo docker-compose up**
Creating rpm_ElasticMapsServer_1 ... done
Attaching to rpm_ElasticMapsServer_1
ElasticMapsServer_1 | EACCES: permission denied, open '/usr/src/app/server/config/elastic-maps-server.yml'
rpm_ElasticMapsServer_1 exited with code 1

```

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [November 8, 2023, 10:27am UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347/7 "2023-11-08T10:27:18Z")

</div>

That is more a docker question, check the owner of the configuration file you are binding.

---

<div class="post-metadata">

**Author:** ![Manal\_A](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manal_a/32/123992_2.png) [@Manal\_A](https://discuss.elastic.co/u/Manal_A)\
**Post date:** [November 8, 2023, 1:16pm UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347/8 "2023-11-08T13:16:39Z")

</div>

It's good, I've resolved the Docker issue.

And I've executed this command, and everything is fine; it doesn't return any errors:

```auto
**sudo docker run --rm --init --publish 8080:8080 \5b3b1847374e**
Emulae Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
{"log.level":"info","@timestamp":"2023-11-08T13:09:14.322Z","process":{"pid":8},"host":{"hostname":"b1e90f67b0e4"},"log":{"logger":"Elastic Maps Server"},"created":1699448954274,"started":1699448954314,"host":"b1e90f67b0e4","port":8080,"protocol":"http","id":"b1e90f67b0e4:8:lops11gi","uri":"http://b1e90f67b0e4:8080","address":"10.88.0.20","ecs":{"version":"1.6.0"},"message":"server started"}
{"log.level":"info","@timestamp":"2023-11-08T13:10:56.340Z","process":{"pid":8},"host":{"hostname":"b1e90f67b0e4"},"log":{"logger":"Elastic Maps Server"},"req":{"id":"1699449056319:b1e90f67b0e4:8:lops11gi:10000","method":"get","url":"/","headers":{"host":"10.88.0.20:8080","user-agent":"curl/7.61.1","accept":"*/*"},"remoteAddress":"10.88.0.1","remotePort":58060},"responseTime":21,"ecs":{"version":"1.6.0"},"req":{"id":"1699449056319:b1e90f67b0e4:8:lops11gi:10000","method":"get","url":"/","headers":{"host":"10.88.0.20:8080","user-agent":"curl/7.61.1","accept":"*/*"},"remoteAddress":"10.88.0.1","remotePort":58060},"res":{"statusCode":200,"headers":{"content-length":511,"content-type":"text/html; charset=utf-8","last-modified":"Fri, 02 Jun 2023 09:52:42 GMT","etag":"\"3748990f2f14d021bff2a2794ceca479a5e18b77\"","vary":"origin","access-control-expose-headers":"WWW-Authenticate,Server-Authorization","cache-control":"no-cache","accept-ranges":"bytes"}},"message":"request completed"}

```

But I'm not sure how to access the map. Is it through the Kibana dashboard interface, or using which address IP?

Thank you

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [November 8, 2023, 2:35pm UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347/9 "2023-11-08T14:35:23Z")

</div>

There is a demo interface (same as what you see at [https://maps.elastic.co](https://maps.elastic.co)) on the `http://{YOUR_EMS_SERVER}/maps` route.

Then, to configure Kibana to use that instance, you need to follow the docs:

> **[Connect to Elastic Maps Service | Kibana Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/kibana/current/maps-connect-to-ems.html#elastic-maps-server-kibana)**

---

<div class="post-metadata">

**Author:** ![Manal\_A](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manal_a/32/123992_2.png) [@Manal\_A](https://discuss.elastic.co/u/Manal_A)\
**Post date:** [November 10, 2023, 1:33pm UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347/10 "2023-11-10T13:33:59Z")

</div>

My map server is well configured now; it manages to connect to Elasticsearch to validate the license.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/2/f25696c8bbaa68e3de019bd929f9fe301f6e7409.jpeg)

However, I still cannot visualize the map on the Kibana interface + I have this error: `Unable to find the configuration for the EMS tile with the ID: road_map_desaturated. Connection to [http://10.4.1.188:5602](http://10.4.1.188:5602/)."`  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/c/6c0a6bdf247c85a91e1cc219959805feed76930d.png)

- i added this line in the Kibana configuration that I am using :  
`map.emsUrl: http://10.4.1.188:5602`

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [November 10, 2023, 2:34pm UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347/11 "2023-11-10T14:34:51Z")

</div>

Check the browser console and especially the network connections for more details.

Is maybe your Kibana instance accessed trough HTTPS? Mind that a webpage served on HTTPS cannot make external requests to an HTTP endpoint for security reasons. This is not specific of Kibana or EMS Server.

---

<div class="post-metadata">

**Author:** ![Manal\_A](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manal_a/32/123992_2.png) [@Manal\_A](https://discuss.elastic.co/u/Manal_A)\
**Post date:** [November 10, 2023, 3:38pm UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347/12 "2023-11-10T15:38:31Z")

</div>

Thank you so much  
It's good, I've set everything up, and I can display the map on Kibana interface.

If I want to show only the cities and streets of a specific country without loading all the data, how can I do that, please?

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [November 10, 2023, 4:33pm UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347/13 "2023-11-10T16:33:50Z")

</div>

Sorry, we don't support country downloads 😞

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 8, 2023, 4:33pm UTC](https://discuss.elastic.co/t/host-elastic-maps-service-locally/346347/14 "2023-12-08T16:33:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
