A new self-hosted Nextcloud server needs the web server, database, cache, background jobs, certificates, and update path to move together. Nextcloud All-in-One packages that stack behind a Docker mastercontainer, which fits a host dedicated to a complete Nextcloud instance instead of a hand-built LEMP layout.
The direct Linux deployment path uses AIO's integrated HTTPS support, so ports 80, 443, 8080, and 8443 must be free on the Docker host before the deployment is completed. A server that already runs Nginx, Apache, Caddy, Traefik, or another public web app needs the reverse-proxy startup path instead of the direct port-publishing command.
Use a real DNS name that resolves to the server before completing the AIO setup interface. The mastercontainer name and nextcloud_aio_mastercontainer volume are part of AIO's update and backup behavior, so keep those names unchanged.
$ docker version Client: Docker Engine - Community Version: 29.6.1 ##### snipped ##### Server: Docker Engine - Community Engine: Version: 29.5.3
Add sudo before docker when the server requires root privileges for Docker commands.
$ sudo ss -ltnp '( sport = :80 or sport = :443 or sport = :8080 or sport = :8443 )' State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
If any listener appears for ports 80, 443, 8080, or 8443, stop before running the direct command. Free the ports or use the reverse-proxy startup path instead.
Related: How to configure Nextcloud behind a reverse proxy
$ docker run --detach \ --init \ --sig-proxy=false \ --name nextcloud-aio-mastercontainer \ --restart always \ --publish 80:80 \ --publish 8080:8080 \ --publish 8443:8443 \ --volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \ --volume /var/run/docker.sock:/var/run/docker.sock:ro \ ghcr.io/nextcloud-releases/all-in-one:latest 1bfabd6a1bdc
The named volume stores the AIO mastercontainer configuration. Do not rename it or replace it with a different volume name.
$ docker ps --filter name=nextcloud-aio-mastercontainer CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1bfabd6a1bdc ghcr.io/nextcloud-releases/all-in-one:latest "/start.sh" 44 seconds ago Up 43 seconds (healthy) 0.0.0.0:80->80/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp nextcloud-aio-mastercontainer
$ curl --insecure --head --silent https://127.0.0.1:8080 HTTP/1.1 302 Found Cache-Control: no-store, no-cache, must-revalidate Content-Type: text/html; charset=UTF-8 ##### snipped ##### Location: setup Status: 302 Found
The AIO setup interface uses a self-signed certificate on port 8080 until the first-run setup creates the final HTTPS configuration.
https://cloud.example.com:8080
Replace cloud.example.com with the DNS name that points to the server. Use https://SERVER-IP:8080 only for the first local setup check when DNS is not reachable from the workstation yet.
AIO uses the initial domain for the instance. Changing it later requires editing the AIO configuration volume manually, so confirm the DNS name before starting the first-run setup.