# Upgrading Traefik 2.2 to latest

**URL:** <https://community.traefik.io/t/upgrading-traefik-2-2-to-latest/9787>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [February 21, 2021, 8:59pm UTC](https://community.traefik.io/t/upgrading-traefik-2-2-to-latest/9787 "2021-02-21T20:59:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![avico](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/avico/32/570_2.png) [@avico](https://community.traefik.io/u/avico)\
**Post date:** [February 21, 2021, 8:59pm UTC](https://community.traefik.io/t/upgrading-traefik-2-2-to-latest/9787/1 "2021-02-21T20:59:14Z")

</div>

Running Traefik 2.2 for quite a while ,  
the upgrade from v1 to v2 was not easy ,  
I like to keep things updated and i have some concern it will break up ,  
Traefik 2,2 docker-compose:

```auto
  traefik:
    image: traefik:v2.2.0
    container_name: traefik
    restart: always
    command:
      - --log.level=INFO
      - --log.filePath=etc/traefik/log/traefik.log
      - --accessLog.filePath=etc/traefik/log/access.log
      - --accessLog.bufferingSize=100
      - --providers.docker=true
      - --providers.docker.exposedbydefault=false
   
      - --api
      #allow access on 8888 
      - --api.insecure=true
      - --entrypoints.traefik.address=:8888
      - --entrypoints.web.address=:80
      - --entrypoints.web.http.redirections.entrypoint.to=websecure
      - --entrypoints.web.http.redirections.entrypoint.scheme=https
      - --entrypoints.websecure.address=:443
      - --entrypoints.websecure.http.tls.certresolver=myresolver
      - --certificatesresolvers.myresolver.acme.dnschallenge=true
      - --certificatesresolvers.myresolver.acme.email=${CF_API_EMAIL}
    # TEST MODE
    # - --certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
      - --certificatesresolvers.myresolver.acme.storage=acme.json   
      - --certificatesresolvers.myresolver.acme.dnschallenge.provider=cloudflare
            # specify dynamic configuration file:
      - --providers.file.filename=/dynamic.yaml
      - --providers.file.watch=true
      #usually without it
   # network_mode: host
    ports:
      - 80:80
      - 443:443
      - 8888:8888
    environment:
      - CF_API_EMAIL=${CF_API_EMAIL}
      - CF_API_KEY=${CF_API_KEY}
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock
      - ./traefik/acme.json:/acme.json    
      - ./traefik/:/etc/traefik/log/
      #for accessing non docker application (qnap)
      - ./traefik/dynamic.yaml:/dynamic.yaml
    labels:
      traefik.enable: true

      # Dashboard
      traefik.http.routers.traefik.rule: Host(`traefik.${DOMAINNAME}`)
      traefik.http.routers.traefik.entrypoints: websecure
      traefik.http.routers.traefik.service: api@internal
      traefik.http.routers.traefik.middlewares: auth
      traefik.http.middlewares.auth.basicauth.users: ${TRAEFIK_USER}:${TRAEFIK_PASS}

```

for labeling dockers with traefik :

```auto
  whoami:
    image: "containous/whoami"
    container_name: "whoami"
    command: --port=8082 # Our service listens on 8082
    ports:
      - "8082:8082"
    labels:
      traefik.enable: true
      traefik.http.routers.whoami.rule: Host(`whoami.${DOMAINNAME}`)
      traefik.http.routers.whoami.entrypoints: websecure
      traefik.http.services.whoami.loadbalancer.server.port: 8082
      COMPOSE_PATH: ${PWD}

```

but before i upgrade to newest version,  
do i need to change anything in compose file?

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [February 21, 2021, 10:19pm UTC](https://community.traefik.io/t/upgrading-traefik-2-2-to-latest/9787/2 "2021-02-21T22:19:05Z")

</div>

Hello,

you have nothing to change

[https://doc.traefik.io/traefik/v2.4/migration/v2/](https://doc.traefik.io/traefik/v2.4/migration/v2/)

---

<div class="post-metadata">

**Author:** ![avico](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/avico/32/570_2.png) [@avico](https://community.traefik.io/u/avico)\
**Post date:** [February 22, 2021, 1:14pm UTC](https://community.traefik.io/t/upgrading-traefik-2-2-to-latest/9787/3 "2021-02-22T13:14:24Z")

</div>

Thanks a lot @ldez -Upgrade 2.2. --\> 2.4.5 was easy and smoothly 🙂

---

<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:** [February 25, 2021, 1:15pm UTC](https://community.traefik.io/t/upgrading-traefik-2-2-to-latest/9787/4 "2021-02-25T13:15:11Z")

</div>

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