# Connecting to OPC-UA Server inside docker container

**URL:** <https://forum.inductiveautomation.com/t/connecting-to-opc-ua-server-inside-docker-container/53674>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [December 2, 2021, 3:14pm UTC](https://forum.inductiveautomation.com/t/connecting-to-opc-ua-server-inside-docker-container/53674 "2021-12-02T15:14:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manca](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/manca/32/6291_2.png) [@manca](https://forum.inductiveautomation.com/u/manca)\
**Post date:** [December 2, 2021, 3:14pm UTC](https://forum.inductiveautomation.com/t/connecting-to-opc-ua-server-inside-docker-container/53674/1 "2021-12-02T15:14:05Z")

</div>

Hi,

I’m wondering if anyone can share his/her experience on connecting to Ignition OPC-UA server running in a docker container.  
I’m using a dockerized Ignition 8.1.11 and trying to connect from the host (tested with Ignition or an OPC client) with no success so far.  
This is the string with which I start my docker

docker run -e TZ=Europe/Paris -p 8115:8088 -p 62543:62541 --expose 62543 --name IGN4 -e GATEWAY\_ADMIN\_PASSWORD=password -e IGNITION\_EDITION=edge -d kcollins/ignition:8.1.11

As you can see I’m exposing port 62543

this is my OPC server configuration

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/6/06d9e2b2e03878b64600a81d8d37a3cfb34f0295.png)

Is there something I’m not configuring correctly?

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [December 2, 2021, 3:37pm UTC](https://forum.inductiveautomation.com/t/connecting-to-opc-ua-server-inside-docker-container/53674/2 "2021-12-02T15:37:44Z")

</div>

Due to the way the discovery works, you'll probably need to actually bind to the same port within the container as you're publishing to the host. Try this (you don't need the `--expose` and I also added a named volume for you):

```bash
docker run -e TZ=Europe/Paris -p 8115:8088 -p 62543:62543 --name IGN4 -v ign4-data:/var/lib/ignition/data -e GATEWAY_ADMIN_PASSWORD=password -e IGNITION_EDITION=edge -d kcollins/ignition:8.1.11

```

From here, in your Edge gateway:

- Adjust both _Bind Addresses_ to `0.0.0.0` and _Bind Port_ to `62543`.

> This way the discovery URL will match the published port at `62543`.

- Restart the **OPC-UA** module under _Config -\> System -\> Modules_

> The changes to OPC-UA Server configuration won't take effect until you've restarted the module).

- Adjust your internal _Ignition OPC UA Server_ under _Config -\> System -\> OPC Client -\> OPC Connections_ (via _More -\> endpoint_) to point to `opc.tcp://localhost:62543/discovery` and then Save changes.

At this point your Edge gateway should be healthy and ready for external connections.

---

<div class="post-metadata">

**Author:** ![manca](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/manca/32/6291_2.png) [@manca](https://forum.inductiveautomation.com/u/manca)\
**Post date:** [December 2, 2021, 3:53pm UTC](https://forum.inductiveautomation.com/t/connecting-to-opc-ua-server-inside-docker-container/53674/3 "2021-12-02T15:53:14Z")

</div>

> [@kcollins](#):
>
> opc.tcp://localhost:62543/discovery

Works like a charm now! Thanks a lot Kevin !!!
