How to run Nextcloud in Docker (behind Traefik)

NextCloud (now called "Nextcloud Hub II") has as grown from a humble fork of OwnCloud in 2016, to an industry-leading, on-premises content collaboration platform. NextCloud still does the traditional file-collaboration, but is now beefed-up with an app store supporting more than 100 apps, including text and video chats, calendaring, a mail client, and even an office editing suite.


This is a companion discussion topic for the original entry at https://geek-cookbook.funkypenguin.co.nz/recipes/nextcloud

@funkypenguin Hi David, thank you first for your greath collection.

If i run Nextcloud i receive a issue with the ‘Strict-Transport-Security’ that i have to enable Enable HTTP Strict Transport Security with traefik i could solve this issue with a new label.

  nextcloud:
    image: nextcloud  
    ...
    deploy:
      labels:
        - traefik.frontend.rule=Host:nextcloud.example.com
        - traefik.docker.network=traefik_public
        - traefik.port=80
# fix Enable HTTP Strict Transport Security
        - traefik.frontend.headers.STSSeconds=15552000