Run this command and paste the output:

docker compose ps nginx-mailcow --format json | jq .

    DocFraggle

    WARN[0000] /etc/nginx/root/mailcow-dockerized/docker-compose.yml: version is obsolete
    {
    “Command”: “\”/docker-entrypoint.…\"",
    “CreatedAt”: “2024-03-27 08:00:11 +0000 UTC”,
    “ExitCode”: 0,
    “Health”: "",
    “ID”: “89bb1e13aa88”,
    “Image”: “nginx:mainline-alpine”,
    “Labels”: “com.docker.compose.oneoff=False,com.docker.compose.version=1.29.2,maintainer=NGINX Docker Maintainers docker-maint@nginx.com,com.docker.compose.config-hash=84a51289eb2809125179597b9ac42f5237596dae6b5703a25f1928e69fb2665e,com.docker.compose.container-number=1,com.docker.compose.project=mailcowdockerized,com.docker.compose.project.config_files=docker-compose.yml,com.docker.compose.project.working_dir=/etc/nginx/root/mailcow-dockerized,com.docker.compose.service=nginx-mailcow”,
    “LocalVolumes”: “1”,
    “Mounts”: “/etc/nginx/roo…,/etc/nginx/roo…,/etc/nginx/roo…,/etc/nginx/roo…,mailcowdockeri…,/etc/nginx/roo…”,
    “Name”: “mailcowdockerized_nginx-mailcow_1”,
    “Names”: “mailcowdockerized_nginx-mailcow_1”,
    “Networks”: “mailcowdockerized_mailcow-network”,
    “Ports”: “0.0.0.0:8080->8080/tcp, 80/tcp, 0.0.0.0:8443->8443/tcp”,
    “Project”: “mailcowdockerized”,
    “Publishers”: [
    {
    “URL”: "",
    “TargetPort”: 80,
    “PublishedPort”: 0,
    “Protocol”: “tcp”
    },
    {
    “URL”: “0.0.0.0”,
    “TargetPort”: 8080,
    “PublishedPort”: 8080,
    “Protocol”: “tcp”
    },
    {
    “URL”: “0.0.0.0”,
    “TargetPort”: 8443,
    “PublishedPort”: 8443,
    “Protocol”: “tcp”
    }
    ],
    “RunningFor”: “About a minute ago”,
    “Service”: “nginx-mailcow”,
    “Size”: “0B”,
    “State”: “running”,
    “Status”: “Up About a minute”
    }

    This looks wrong:

    {
    “URL”: "",
    “TargetPort”: 80,
    “PublishedPort”: 0,
    “Protocol”: “tcp”
    },

    There must be a typo or something else in your mailcow.conf or docker-compose.yml

      DocFraggle

      I just modified port, I didn’t change other things.

      I don’t know where’s my setting wrong…

      I would suggest you shut down you current non-working mailcow, completly remove the directory and start over from scratch. I suspect that your mailcow.conf currently contains invalid/invisible characters or something like that which leads to the error message “services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object”

      Start over, generate the config and change only the lines

      HTTP_BIND=
      HTTP_PORT=8080
      HTTPS_BIND=
      HTTPS_PORT=8443

      and maybe the other services ports as you did before.

        DocFraggle as well as ports:
        - “8443:8443”
        - “8080:8080”
        in docker-compose.yml ?

        I had reinstalled and reset the ports before I asked you. I could try again

          nickydream_ no, don’t touch the docker-compose.yml, it’s using the variables from mailcow.conf

            DocFraggle

            OK。 Just like before. When I start mailcow , it reports:
            root@vmi16215**:/etc/nginx/root/mailcow-dockerized# sudo docker-compose up -d
            ERROR: The Compose file ‘./docker-compose.yml’ is invalid because:
            services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object
            services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object

            I didn’t touch docker-compose.yml .

              nickydream_ How do you edit your mailcow.conf? Do you use an editor? Or vim/nano etc on the console?

                What’s the output of

                file mailcow.conf?

                  DocFraggle

                  root@vmi16215**:/etc/nginx/root/mailcow-dockerized# file mailcow.conf
                  mailcow.conf: ASCII text

                  OK, run

                  egrep "PORT|BIND" mailcow.conf

                  and paste the output

                  Ah, try it again WITHOUT sudo! You’re already root and sudo may mess up your environment

                    In case you missed my edit, try it again WITHOUT sudo! You’re already root and sudo may mess up your environment

                    Also please check if you set this to “native” in mailcow.conf:

                    DOCKER_COMPOSE_VERSION=native

                      No, don’t run

                      sudo docker-compose up -d

                      BUT

                      docker-compose up -d

                        DocFraggle

                        root@vmi1621588:/etc/nginx/root/mailcow-dockerized# docker-compose up -d
                        ERROR: The Compose file ‘./docker-compose.yml’ is invalid because:
                        services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object
                        services.nginx-mailcow.ports contains an invalid type, it should be a number, or an object

                        did you check your DOCKER_COMPOSE_VERSION variable?

                          DocFraggle

                          This is the installation record:
                          Client: Docker Engine - Community
                          Version: 26.0.0
                          API version: 1.45
                          Go version: go1.21.8
                          Git commit: 2ae903e
                          Built: Wed Mar 20 15:17:51 2024
                          OS/Arch: linux/amd64
                          Context: default

                          Server: Docker Engine - Community
                          Engine:
                          Version: 26.0.0
                          API version: 1.45 (minimum version 1.24)
                          Go version: go1.21.8
                          Git commit: 8b79278
                          Built: Wed Mar 20 15:17:51 2024
                          OS/Arch: linux/amd64
                          Experimental: true
                          containerd:
                          Version: 1.6.28
                          GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
                          runc:
                          Version: 1.1.12
                          GitCommit: v1.1.12-0-g51d5e94
                          docker-init:
                          Version: 0.19.0
                          GitCommit: de40ad0

                          [unknown]