Cannot setup Nextcloud AIO

Hello!

I’m currently trying to install Nextcloud AIO using the official Nextcloud AIO GitHub page. Set up the docker container and setup nginx proxy manager, but to no avail.

Here is my docker-compose:

version: "3.8"

volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer # This line is not allowed to be changed

services:
  nextcloud:
    image: nextcloud/all-in-one:latest # Must be changed to 'nextcloud/all-in-one:latest-arm64' when used with an arm64 CPU
    restart: always
    container_name: nextcloud-aio-mastercontainer # This line is not allowed to be changed
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config # This line is not allowed to be changed
      - /var/run/docker.sock:/var/run/docker.sock:ro # May be changed on macOS, Windows or docker rootless. See the applicable documentation. If adjusting, don't forget to also set 'DOCKER_SOCKET_PATH'!
    ports:
      - 80:80 # Can be removed when running behind a reverse proxy. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
      - 8080:8080
      - 8443:8443 # Can be removed when running behind a reverse proxy. See https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md
    environment: # Is needed when using any of the options below
      - APACHE_PORT=11000

My nginx proxy manager setup for Nextcloud (Note: I know Nginx, the container, is set up properly since other services are working with it):


Nextcloud’s forums won’t allow me to post more links than I already put so here is the rest of my config (Includes nginx proxy manager, my ASUS router port forwarding rules, my Cloudflare DNS settings and my error message)
(Imgur: The magic of the Internet)

After all of this config, when you visit https://nextcloud.mydomain.com:
https://i.imgur.com/3nrXXjK.png

I have no idea what could be wrong. I followed the official nginx proxy manager guide and the Nextcloud AIO guide, but to no avail.

Any help? TIA

Hi, did you follow all-in-one/reverse-proxy.md at main · nextcloud/all-in-one · GitHub step-for-step?

When I set it up, I couldn’t get it to work with compose. I had to start the mastercontainer with normal docker. It was last summer so I don’t recall exactly what happened but it was giving me errors on the management page during setup.

@KarlF12 did you follow the mentioned instructions back then? Or is your instance running without reverse proxy?

I followed that exact guide + the reverse proxy section

Can you post the docker-compose of nginx proxy manager?

version: '3'
services:
  app:
    container_name: ngingx-proxy-manager
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '40080:80'
      - '40081:81'
      - '40443:443'
    volumes:
      - .docker-data/ngingx-proxy-manager/data:/data
      - ./letsencrypt:/etc/letsencrypt

Here is my port forwarding rules in my router:

Just wanted to add my other services using nginx proxy manager (home assistant, Jellyfin and others) work with no issues

Okay is 192.168.50.101 the ip-addrip-address of the host that is running AIO?
Also you need to open the AIO interface which should bring up the domaincheck container and allow you to successfully enter your domain. If you are sure that you did everything correctly and you still cannot pass the domain validation, see GitHub - nextcloud/all-in-one: Nextcloud AIO stands for Nextcloud All In One and provides easy deployment and maintenance with most features included in this one Nextcloud instance.

Btw, you can find here some complete and working examples for nginx proxy manager: docker-compose examples for reverse proxies and other guides · Discussion #588 · nextcloud/all-in-one · GitHub

As soon as I added the SKIP_DOMAIN_VALIDATION=true it started working

I doubt that this is the reason but great that it works now.

Now I cannot get past this

I tried running the command it showed, and it sent me to this after I enter my admin password:
https://i.imgur.com/u7vLcea.png

I tried to log out and log back in, sends me back to the same page.

If I try the “Open your Nextcloud” button, it just sends be back to the same page.

Can you post the nextcloud-aio-mastercontainer logs here?

Also, what is the output of docker inspect nextcloud-aio-apache?

nextcloud-aio-mastercontainer logs:

Trying to fix docker.sock permissions internally...
Creating docker group internally with id 1001
Initial startup of Nextcloud All In One complete!
You should be able to open the Nextcloud AIO Interface now on port 8080 of this server!
E.g. https://internal.ip.of.this.server:8080
If your server has port 80 and 8443 open and you point a domain to your server, you can get a valid certificate automatically by opening the Nextcloud AIO Interface via:
https://your-domain-that-points-to-this-server.tld:8443
INF ts=1673815728.664755 msg=using provided configuration config_file=/Caddyfile config_adapter=
WRN ts=1673815728.6658065 msg=Caddyfile input is not formatted; run the 'caddy fmt' command to fix inconsistencies adapter=caddyfile file=/Caddyfile line=2
INF ts=1673815728.6664805 logger=admin msg=admin endpoint started address=localhost:2019 enforce_origin=false origins=["//127.0.0.1:2019","//localhost:2019","//[::1]:2019"]
WRN ts=1673815728.6666915 logger=http msg=server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server server_name=srv0 http_port=80
WRN ts=1673815728.6668186 logger=http msg=automatic HTTP->HTTPS redirects are disabled server_name=srv1
INF ts=1673815728.666699 logger=tls.cache.maintenance msg=started background certificate maintenance cache=0xc000180d20
WRN ts=1673815728.6669824 logger=tls msg=YOUR SERVER MAY BE VULNERABLE TO ABUSE: on-demand TLS is enabled, but no protections are in place docs=https://caddyserver.com/docs/automatic-https#on-demand-tls
INF ts=1673815728.6671104 logger=http.log msg=server running name=srv0 protocols=["h1","h2","h3"]
INF ts=1673815728.6671169 logger=tls msg=cleaning storage unit description=FileStorage:/mnt/docker-aio-config/caddy/
INF ts=1673815728.6671393 logger=tls msg=finished cleaning storage units
INF ts=1673815728.6671624 logger=http msg=enabling HTTP/3 listener addr=:8443
INF ts=1673815728.66723 msg=failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.
INF ts=1673815728.6673355 logger=http.log msg=server running name=srv1 protocols=["h1","h2","h3"]
ERR ts=1673815728.6673615 msg=unable to create folder for config autosave dir=/root/.config/caddy error=mkdir /root/.config: permission denied
INF ts=1673815728.6673687 msg=serving initial configuration
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.21.0.2. Set the 'ServerName' directive globally to suppress this message
[Sun Jan 15 20:48:48.671945 2023] [ssl:warn] [pid 120] AH01906: 172.21.0.2:8080:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sun Jan 15 20:48:48.672043 2023] [ssl:warn] [pid 120] AH01909: 172.21.0.2:8080:0 server certificate does NOT include an ID which matches the server name
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.21.0.2. Set the 'ServerName' directive globally to suppress this message
[Sun Jan 15 20:48:48.684804 2023] [ssl:warn] [pid 120] AH01906: 172.21.0.2:8080:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sun Jan 15 20:48:48.684816 2023] [ssl:warn] [pid 120] AH01909: 172.21.0.2:8080:0 server certificate does NOT include an ID which matches the server name
[Sun Jan 15 20:48:48.686653 2023] [mpm_prefork:notice] [pid 120] AH00163: Apache/2.4.54 (Debian) PHP/8.1.13 OpenSSL/1.1.1n configured -- resuming normal operations
[Sun Jan 15 20:48:48.686665 2023] [core:notice] [pid 120] AH00094: Command line: 'apache2 -D FOREGROUND'
Deleting duplicate sessions
Deleting duplicate sessions

The docker inspect nextcloud-aio-apache:

[
    {
        "Id": "6943d088b6822fa6d6cfc29848604a9eaa03cff0c7287e89c8bfb812e8accc75",
        "Created": "2023-01-15T21:00:22.085902902Z",
        "Path": "start.sh",
        "Args": [
            "/usr/bin/supervisord",
            "-c",
            "/supervisord.conf"
        ],
        "State": {
            "Status": "exited",
            "Running": false,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 0,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2023-01-15T21:00:22.364109194Z",
            "FinishedAt": "2023-01-15T21:03:09.653283202Z",
            "Health": {
                "Status": "unhealthy",
                "FailingStreak": 0,
                "Log": [
                    {
                        "Start": "2023-01-15T16:00:52.364565316-05:00",
                        "End": "2023-01-15T16:00:52.406990495-05:00",
                        "ExitCode": 0,
                        "Output": ""
                    },
                    {
                        "Start": "2023-01-15T16:01:22.414380908-05:00",
                        "End": "2023-01-15T16:01:22.459023609-05:00",
                        "ExitCode": 0,
                        "Output": ""
                    },
                    {
                        "Start": "2023-01-15T16:01:52.466597624-05:00",
                        "End": "2023-01-15T16:01:52.506503282-05:00",
                        "ExitCode": 0,
                        "Output": ""
                    },
                    {
                        "Start": "2023-01-15T16:02:22.514682776-05:00",
                        "End": "2023-01-15T16:02:22.558918003-05:00",
                        "ExitCode": 0,
                        "Output": ""
                    },
                    {
                        "Start": "2023-01-15T16:02:52.566258613-05:00",
                        "End": "2023-01-15T16:02:52.611208882-05:00",
                        "ExitCode": 0,
                        "Output": ""
                    }
                ]
            }
        },
        "Image": "sha256:bfa611cbaf671cff9bb7773b169b4f9cb2e66575829bca17b09c6518baf281e2",
        "ResolvConfPath": "/var/lib/docker/containers/6943d088b6822fa6d6cfc29848604a9eaa03cff0c7287e89c8bfb812e8accc75/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/6943d088b6822fa6d6cfc29848604a9eaa03cff0c7287e89c8bfb812e8accc75/hostname",
        "HostsPath": "/var/lib/docker/containers/6943d088b6822fa6d6cfc29848604a9eaa03cff0c7287e89c8bfb812e8accc75/hosts",
        "LogPath": "/var/lib/docker/containers/6943d088b6822fa6d6cfc29848604a9eaa03cff0c7287e89c8bfb812e8accc75/6943d088b6822fa6d6cfc29848604a9eaa03cff0c7287e89c8bfb812e8accc75-json.log",
        "Name": "/nextcloud-aio-apache",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "docker-default",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "nextcloud_aio_nextcloud:/var/www/html:ro",
                "nextcloud_aio_apache:/mnt/data:rw"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "default",
            "PortBindings": {
                "11000/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "11000"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "unless-stopped",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "CgroupnsMode": "private",
            "Dns": null,
            "DnsOptions": null,
            "DnsSearch": null,
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "private",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "DeviceCgroupRules": null,
            "DeviceRequests": null,
            "KernelMemory": 0,
            "KernelMemoryTCP": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": null,
            "PidsLimit": null,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/3dd9fa63fc7a68a70ebf4bf76085ccf3186a1514faf98916d746bfc31a33a7ea-init/diff:/var/lib/docker/overlay2/ab4c581aa2798081c15b392e85282b6142b09fb52664ece088df8e777287e245/diff:/var/lib/docker/overlay2/4fc20d3723aadbf8b9e871dba7cf972f8308b06e0a5a75d245348724092f5d35/diff:/var/lib/docker/overlay2/b0da476d1cec36b7d57dcdfb124108712745507a2dda1f031bdea8a3e605019c/diff:/var/lib/docker/overlay2/d4863fd8e6257f09d4412aee3efd7b51d2300ef2a0917b11e19446e4ae9d372f/diff:/var/lib/docker/overlay2/f6e8e20c071755efd528f6c0db54722ccc6aa3c75bc444202f8a155ebd52c8ef/diff:/var/lib/docker/overlay2/d1ce37ecaab4ab1fec865944018eee7be154c976f1b6ce2490655748e9392022/diff:/var/lib/docker/overlay2/a0c5e8472bbe8b0ff95248409fa2e6c3662282be8a855f674fc7cecda07a5c87/diff:/var/lib/docker/overlay2/7546f22c36e2b08964d90b924bf8eb76d5ae4ffb32e3d7596fed103678af6cd9/diff:/var/lib/docker/overlay2/ca49c3b56cf5de778ce736d9bab3ca557b79a54526160d0ad1a3942bf4674a1a/diff:/var/lib/docker/overlay2/7918e365fcc37790b57cb9404d402bfc3c41c4473d9cb5250089d0580da68afd/diff:/var/lib/docker/overlay2/b7ebe6325255715f1459bdd528483e3d1b8c56a90d77663cb816c8e654885943/diff:/var/lib/docker/overlay2/aa96d5917e02a0468bb7ab4c4f7eae1e44e027ca43fe7607aadbfa3e29ab82d9/diff:/var/lib/docker/overlay2/6b87e49c1eb2a751985186547038fac3efcef38e9ae4892f095df6415573d10a/diff:/var/lib/docker/overlay2/a1ef69dc714936869fa6212c39ea9b9122449df50d7d165f7bd0da972926fe12/diff:/var/lib/docker/overlay2/5038d76dd5356927dc5e915ac99f53c6b156a1899fdc572a6270f806f74529e1/diff:/var/lib/docker/overlay2/47b0868da652fa5ae0054b6630cf743cecad4d82fefe7e28ad65a1289fd35f04/diff",
                "MergedDir": "/var/lib/docker/overlay2/3dd9fa63fc7a68a70ebf4bf76085ccf3186a1514faf98916d746bfc31a33a7ea/merged",
                "UpperDir": "/var/lib/docker/overlay2/3dd9fa63fc7a68a70ebf4bf76085ccf3186a1514faf98916d746bfc31a33a7ea/diff",
                "WorkDir": "/var/lib/docker/overlay2/3dd9fa63fc7a68a70ebf4bf76085ccf3186a1514faf98916d746bfc31a33a7ea/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "volume",
                "Name": "nextcloud_aio_nextcloud",
                "Source": "/var/lib/docker/volumes/nextcloud_aio_nextcloud/_data",
                "Destination": "/var/www/html",
                "Driver": "local",
                "Mode": "ro",
                "RW": false,
                "Propagation": ""
            },
            {
                "Type": "volume",
                "Name": "nextcloud_aio_apache",
                "Source": "/var/lib/docker/volumes/nextcloud_aio_apache/_data",
                "Destination": "/mnt/data",
                "Driver": "local",
                "Mode": "rw",
                "RW": true,
                "Propagation": ""
            }
        ],
        "Config": {
            "Hostname": "6943d088b682",
            "Domainname": "",
            "User": "www-data",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "11000/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "NC_DOMAIN=nextcloud.ericthunder.com",
                "NEXTCLOUD_HOST=nextcloud-aio-nextcloud",
                "COLLABORA_HOST=nextcloud-aio-collabora",
                "TALK_HOST=nextcloud-aio-talk",
                "APACHE_PORT=11000",
                "ONLYOFFICE_HOST=nextcloud-aio-onlyoffice",
                "TZ=UTC",
                "APACHE_MAX_SIZE=10737418240",
                "APACHE_MAX_TIME=3600",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "Cmd": [
                "/usr/bin/supervisord",
                "-c",
                "/supervisord.conf"
            ],
            "Healthcheck": {
                "Test": [
                    "CMD-SHELL",
                    "healthcheck.sh"
                ]
            },
            "Image": "nextcloud/aio-apache:latest",
            "Volumes": {
                "/mnt/data": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "start.sh"
            ],
            "OnBuild": null,
            "Labels": {}
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "51f015caa499f4289647733be99323aa5dec02093d58bc97e09fade87bf7b40c",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/51f015caa499",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "1663f234c065aae309a3ddbbfc01e2f055a5e9e29f388c51c8c4fc2ff5a34152",
                    "EndpointID": "",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 0,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "",
                    "DriverOpts": null
                },
                "nextcloud-aio": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                        "6943d088b682"
                    ],
                    "NetworkID": "532eaf394f9f31df3a641f5d07cb3589b6d29937c3e81c765f8264f19f8269cc",
                    "EndpointID": "",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 0,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "",
                    "DriverOpts": null
                }
            }
        }
    }
]

Thanks, can you also post the nextcloud-aio-apache logs here?

Waiting for Nextcloud to start...
nc: getaddrinfo for host "nextcloud-aio-nextcloud" port 9000: Name or service not known
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.8. Set the 'ServerName' directive globally to suppress this message
INF ts=1673816448.478465 msg=using provided configuration config_file=/Caddyfile config_adapter=
WRN ts=1673816448.4800425 msg=Caddyfile input is not formatted; run the 'caddy fmt' command to fix inconsistencies adapter=caddyfile file=/Caddyfile line=2
INF ts=1673816448.4808342 logger=admin msg=admin endpoint started address=localhost:2019 enforce_origin=false origins=["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]
WRN ts=1673816448.4810207 logger=http msg=automatic HTTPS is completely disabled for server server_name=srv0
INF ts=1673816448.481031 logger=tls.cache.maintenance msg=started background certificate maintenance cache=0xc000566850
INF ts=1673816448.4816592 logger=http.log msg=server running name=srv0 protocols=["h1","h2","h3"]
INF ts=1673816448.4816816 logger=tls msg=cleaning storage unit description=FileStorage:/mnt/data/caddy
INF ts=1673816448.4816983 logger=tls msg=finished cleaning storage units
INF ts=1673816448.4818163 msg=autosaved config (load with --resume flag) file=/var/www/.config/caddy/autosave.json
INF ts=1673816448.4818268 msg=serving initial configuration
INF ts=1673816589.637623 msg=shutting down apps, then terminating signal=SIGTERM
WRN ts=1673816589.6376824 msg=exiting; byeee!! đź‘‹ signal=SIGTERM
INF ts=1673816589.6378493 logger=tls.cache.maintenance msg=stopped background certificate maintenance cache=0xc000566850
INF ts=1673816589.6379242 logger=admin msg=stopped previous server address=localhost:2019
INF ts=1673816589.6379333 msg=shutdown complete signal=SIGTERM exit_code=0

Ah I see, so you stopped the apache container because you were not able to log in otherwise.

Can you show your nginx-proxy-manager config again?

I changed to port to 8080 or else, I get 502 Bad gateway error from Cloudflare
(I deleted this first screenshot since I forgot to mask a thing)

Ah I see. You need to point to http and port 11000 instead of https and 8080.

Did that, still gives me 502 bad gateway