# Adding services behind - ports?

**URL:** <https://community.traefik.io/t/adding-services-behind-ports/12102>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [October 14, 2021, 11:15am UTC](https://community.traefik.io/t/adding-services-behind-ports/12102 "2021-10-14T11:15:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![macmattias](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/macmattias/32/102_2.png) [@macmattias](https://community.traefik.io/u/macmattias)\
**Post date:** [October 14, 2021, 11:15am UTC](https://community.traefik.io/t/adding-services-behind-ports/12102/1 "2021-10-14T11:15:26Z")

</div>

So my first Traefik setup is up and running.  
Now I want to add my docker services, these has a port number. What do I do with these?  
For example the unifi controller:

- traefik.http.routers.unifi.rule=Host([unifi.example.com](http://unifi.example.com))  
This uses 8443, way of any standard ports, should I add the port to?

---

<div class="post-metadata">

**Author:** ![jakubhajek](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/jakubhajek/32/3389_2.png) [@jakubhajek](https://community.traefik.io/u/jakubhajek)\
**Post date:** [October 14, 2021, 12:28pm UTC](https://community.traefik.io/t/adding-services-behind-ports/12102/2 "2021-10-14T12:28:50Z")

</div>

Hello @macmattias

Please have a look at the docs that explain [how port detection works on Traefik.](https://doc.traefik.io/traefik/providers/docker/#port-detection).

Literally speaking if there is one port expose by the container you don't have to do anything, if there are more than one port expose or there is no port, the load balancer port has to be explicitly configured.

This is only true for Docker. However, for Docker Swam, the port has to be configured as it is presented below:

```auto
- "traefik.http.services.myservice.loadbalancer.server.port=8080"

```

[https://doc.traefik.io/traefik/routing/providers/docker/#port](https://doc.traefik.io/traefik/routing/providers/docker/#port)

---

<div class="post-metadata">

**Author:** ![macmattias](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/macmattias/32/102_2.png) [@macmattias](https://community.traefik.io/u/macmattias)\
**Post date:** [October 15, 2021, 5:05am UTC](https://community.traefik.io/t/adding-services-behind-ports/12102/3 "2021-10-15T05:05:04Z")

</div>

Thank you! I've been doing some blog reading and configuring just to get a hang of how Traefik works and how you can configure it.  
After that the documentation has been making sense to me, so that is what I am gonna base my config on. Also due to that the I know I will get corresponding to the current version.
