# Docker Install - metasfresh behind caddy server (reverse proxy)

**URL:** <https://forum.metasfresh.org/t/docker-install-metasfresh-behind-caddy-server-reverse-proxy/1724>\
**Category:** Setup\
**Tags:** english\
**Created:** [November 1, 2019, 6:38am UTC](https://forum.metasfresh.org/t/docker-install-metasfresh-behind-caddy-server-reverse-proxy/1724 "2019-11-01T06:38:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![OnlineAlone](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/onlinealone/32/642_2.png) [@OnlineAlone](https://forum.metasfresh.org/u/OnlineAlone)\
**Post date:** [November 1, 2019, 6:38am UTC](https://forum.metasfresh.org/t/docker-install-metasfresh-behind-caddy-server-reverse-proxy/1724/1 "2019-11-01T06:38:19Z")

</div>

According to instructions [here](http://docs.metasfresh.org/installation_collection/EN/How_do_I_change_the_webui_ports_for_metasfresh_docker) about changing ports, I have modified ports as following,

```auto
webui:
  build: webui
  links:
    - webapi:webapi
  ports:
    - "8080:80"
    - "8443:443"
  restart: always
  volumes:
    - /etc/localtime:/etc/localtime:ro
    - /etc/timezone:/etc/timezone:ro
  #uncomment and set to URL where metasfresh will be available from browsers
  #environment:
    - WEBAPI_URL=https://my.domain.com:8443

```

but it results in the below error,

```auto
Creating metasfresh_webui_1 ... error

ERROR: for metasfresh_webui_1 Cannot create container for service webui: b'invalid mode: 8443'

ERROR: for webui Cannot create container for service webui: b'invalid mode: 8443'
ERROR: Encountered errors while bringing up the project.

```

trying to build for standard TLS port 443 `https://my.domain.com` results in the below error,

```auto
Creating metasfresh_webui_1 ... error

ERROR: for metasfresh_webui_1 Cannot create container for service webui: b'create WEBAPI_URL=https: "WEBAPI_URL=https" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path'

ERROR: for webui Cannot create container for service webui: b'create WEBAPI_URL=https: "WEBAPI_URL=https" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path'
ERROR: Encountered errors while bringing up the project.

```

I’m looking for running metasfresh-docker on custom port `8443` behind caddy server; so that, external requests to `https://my.domain.com` to be directed by caddy to `https://my.domain.com:8443` internally.

Please advise, Thanks.

---

<div class="post-metadata">

**Author:** ![julian.bischof](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/julian.bischof/32/36_2.png) [@julian.bischof](https://forum.metasfresh.org/u/julian.bischof)\
**Post date:** [November 1, 2019, 2:32pm UTC](https://forum.metasfresh.org/t/docker-install-metasfresh-behind-caddy-server-reverse-proxy/1724/2 "2019-11-01T14:32:03Z")

</div>

Hi @OnlineAlone

Looks like you forgot to uncomment `environment:` since it’s a new “section”.  
If it’s not uncommented, docker-compose thinks it belongs to the section above `volumes:` - that’s why you get this weird error.

It should look like this:

```auto
...
  restart: always
  volumes:
    - /etc/localtime:/etc/localtime:ro
    - /etc/timezone:/etc/timezone:ro
  #uncomment and set to URL where metasfresh will be available from browsers
  environment:
    - WEBAPI_URL=https://my.domain.com:8443

```

(beware indentations)

Cheers.

---

<div class="post-metadata">

**Author:** ![OnlineAlone](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/onlinealone/32/642_2.png) [@OnlineAlone](https://forum.metasfresh.org/u/OnlineAlone)\
**Post date:** [November 3, 2019, 4:58pm UTC](https://forum.metasfresh.org/t/docker-install-metasfresh-behind-caddy-server-reverse-proxy/1724/3 "2019-11-03T16:58:24Z")

</div>

Thanks @julian.bischof

On other note, please advise on changing `WEBAPI_URL` later on after getting the platform running.  
I want to deploy it on VPS using IP address before I get it pointed by URL with TLS certificate.

Cheers,

---

<div class="post-metadata">

**Author:** ![OnlineAlone](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/onlinealone/32/642_2.png) [@OnlineAlone](https://forum.metasfresh.org/u/OnlineAlone)\
**Post date:** [November 3, 2019, 6:18pm UTC](https://forum.metasfresh.org/t/docker-install-metasfresh-behind-caddy-server-reverse-proxy/1724/4 "2019-11-03T18:18:41Z")

</div>

metasfresh is installed by docker and waited long till the database being populated but still showing the blank page as below,

 ![metasfresh](https://forum.metasfresh.org/uploads/default/original/1X/6cdbf38a943e674bb28bdd9e349950c34b900580.png)

```auto
webui:
  build: webui
  links:
    - webapi:webapi
  ports:
    - "8080:80"
    - "8443:443"
  restart: always
  volumes:
    - /etc/localtime:/etc/localtime:ro
    - /etc/timezone:/etc/timezone:ro
  #uncomment and set to URL where metasfresh will be available from browsers
  #environment:
    #- WEBAPI_URL=http://example.com:8080

```

`WEBAPI_URL` entry were left commented (as it is) to allow access by IP address for now and only port 8080 is working while port 8443 doesn’t respond.

Please advise, Thanks

---

<div class="post-metadata">

**Author:** ![bzero](https://forum.metasfresh.org/letter_avatar_proxy/v4/letter/b/8797f3/32.png) [@bzero](https://forum.metasfresh.org/u/bzero)\
**Post date:** [February 11, 2021, 5:04pm UTC](https://forum.metasfresh.org/t/docker-install-metasfresh-behind-caddy-server-reverse-proxy/1724/5 "2021-02-11T17:04:45Z")

</div>

Hello,

I am getting same issue, almost 1 hour after launch docker-compose up -d, but still blank page.  
Anyone knows what could be the issue?  
Thank you.
