Ubuntu 24.04 + Nextcloud

Regarding the compose file: what you pasted is the official AIO example and it is suitable for production. There’s no need to “optimize” it, only to adapt storage location and how you expose it to the internet (reverse proxy).

I’ve already published a complete, tested setup (including docker-compose.yml, NGINX Proxy Manager, and also Ubuntu VM configuration in Proxmox – XFS + ballooning explained) here:
https://help.nextcloud.com/t/testing-large-file-synchronization-with-nextcloud-aio-and-nginx-proxy-june-2025-update/226681?u=vawaver


Compose – first run (initial AIO installation)

(without external: true; Docker will create the volume itself)

volumes:
  nextcloud_aio_mastercontainer:

services:
  nextcloud:
    image: ghcr.io/nextcloud-releases/all-in-one:latest
    restart: unless-stopped
    container_name: nextcloud-aio-mastercontainer
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /etc/cups/client.conf:/etc/cups/client.conf:ro
    ports:
      - 6789:8080  # AIO web UI
    environment:
      - APACHE_PORT=11000
      - NEXTCLOUD_MEMORY_LIMIT=4096M

(the line NEXTCLOUD_ADDITIONAL_APKS=cups imagemagick is no longer needed)


After installation / on later restarts

(add external: true so Docker will always reuse the existing volume – you won’t lose AIO configuration)

volumes:
  nextcloud_aio_mastercontainer:
    external: true

services:
  nextcloud:
    image: ghcr.io/nextcloud-releases/all-in-one:latest
    restart: unless-stopped
    container_name: nextcloud-aio-mastercontainer
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /etc/cups/client.conf:/etc/cups/client.conf:ro
    ports:
      - 6789:8080
    environment:
      - APACHE_PORT=11000
      - NEXTCLOUD_MEMORY_LIMIT=4096M

Why external: true: the volume is already created on the first run. With external: true, Docker will not create a new empty one but will always mount the existing volume with your AIO configuration.


Hardware and VM configuration (Proxmox)

  • Physical CPU: Intel Xeon E-2288G is 8 cores / 16 threads.
    Your VM is currently set to 4 vCPUs (2 sockets × 2 cores) – that’s what Nextcloud actually sees - it is OK for few modules.

  • If you plan to enable more AIO modules (Collabora, Talk HPB, preview generation, fulltextsearch), I recommend increasing the VM to 8–12 vCPUs.
    Practically: in Proxmox set Sockets = 1, Cores = 8–12, CPU type = host, enable ballooning.

  • RAM: 16 GB is fine to start for a smaller number of users. If you run the full AIO stack (Collabora + HPB + previews + FTS), consider 24–32 GB later.

  • VM disk: XFS (as in my guide), VirtIO SCSI single, SSD emulation enabled.

Do not change any lines marked as not allowed to be changed in the compose.
If you have a public IP and domain, use a reverse proxy (see my guide for an NGINX Proxy Manager example) for the simplest SSL setup.