# Issues reaching tcp service from outside

**URL:** <https://community.traefik.io/t/issues-reaching-tcp-service-from-outside/12078>\
**Category:** Traefik v2\
**Tags:** tcp, docker\
**Created:** [October 12, 2021, 6:08pm UTC](https://community.traefik.io/t/issues-reaching-tcp-service-from-outside/12078 "2021-10-12T18:08:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hurlu](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/hurlu/32/1513_2.png) [@Hurlu](https://community.traefik.io/u/Hurlu)\
**Post date:** [October 12, 2021, 6:08pm UTC](https://community.traefik.io/t/issues-reaching-tcp-service-from-outside/12078/1 "2021-10-12T18:08:25Z")

</div>

Hi!  
I've been trying to setup an sftp server provided by a docker container.  
I checked that it indeed worked on the docker network using another container hooked to the network, and that I could access the web admin interface through traefik.

Here is the error message I get:

```auto
 sftp -P 2222 hurlu@ftp.mydomain.com
ssh_exchange_identification: Connection closed by remote host
Couldn't read packet: Connection reset by peer

```

One curious thing I noticed but do not understand, is that docker ps does not display a port for this container, while it does for my other containers:

```auto
ee0a6c7f9ea1 gitea/gitea:1.9.6 "/usr/bin/entrypoint…" 11 hours ago Up 11 hours 22/tcp, 3000/tcp gitea
cf9160bc5fd3 postgres:9.6 "docker-entrypoint.s…" 11 hours ago Up 11 hours 5432/tcp gitea_db
1c956e51b0b8 drakkan/sftpgo:v2.1.2-alpine-slim "sftpgo serve" 11 hours ago Up 11 hours ftp

```

Below is my config:  
docker-compose.yml

```auto
services:
  ftp:
    container_name: ftp
    image: drakkan/sftpgo:v2.1.2-alpine-slim
    networks:
      - traefik_default
    labels:
      - "traefik.enable=true"
      - "traefik.tcp.routers.ftp.rule=HostSNI(`*`)"
      - "traefik.tcp.routers.ftp.entrypoints=sftp" # entrypoint listens to port 2222
      - "traefik.tcp.services.ftp.loadbalancer.server.port=2022"
      - "traefik.tcp.routers.ftp.tls.certresolver=myhttpchallenge" # tried with & without tls or passthrough, no luck

      - "traefik.http.routers.uiftp.rule=Host(`ftp.mydomain.com`)" # this part is working as intended
      - "traefik.http.routers.uiftp.entrypoints=websecure"
      - "traefik.http.routers.uiftp.tls.certresolver=myhttpchallenge"
      - "traefik.http.services.uiftp.loadbalancer.server.port=8080"

networks:
  traefik_default:
    external: true

```

Thanks for reading !

---

<div class="post-metadata">

**Author:** ![cakiwi](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cakiwi/32/3205_2.png) [@cakiwi](https://community.traefik.io/u/cakiwi)\
**Post date:** [October 12, 2021, 6:18pm UTC](https://community.traefik.io/t/issues-reaching-tcp-service-from-outside/12078/2 "2021-10-12T18:18:39Z")

</div>

> [@Hurlu](#):
>
> ` - "traefik.tcp.routers.ftp.tls.certresolver=myhttpchallenge" # tried with & without tls or passthrough, no luck`

Remove this entirely, it is not a 'TLS' protocol.

---

<div class="post-metadata">

**Author:** ![Hurlu](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/hurlu/32/1513_2.png) [@Hurlu](https://community.traefik.io/u/Hurlu)\
**Post date:** [October 12, 2021, 7:06pm UTC](https://community.traefik.io/t/issues-reaching-tcp-service-from-outside/12078/3 "2021-10-12T19:06:39Z")

</div>

Crap, it works now !  
Guess when I removed / re-added I had another issue ongoing, thank you !

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [October 15, 2021, 7:07pm UTC](https://community.traefik.io/t/issues-reaching-tcp-service-from-outside/12078/4 "2021-10-15T19:07:27Z")

</div>

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