How to: Install Nextcloud AiO using Docker and NGINX Proxy Manager

Metadata

Tested with: Ubuntu 22.04, NC AiO 9.7.0, NPM 2.11.3
Last Update: Oct 2024

Requirements

  • You need some Linux distribution of your choice like Ubuntu for instance.

Steps

1. Install Docker

curl -fsSL https://get.docker.com | sudo sh

    2. Config

    nano docker-compose.yml
    volumes:
      nextcloud_aio_mastercontainer:
        name: nextcloud_aio_mastercontainer
    
    services:
      nextcloud:
        image: nextcloud/all-in-one:latest
        restart: always
        container_name: nextcloud-aio-mastercontainer
        volumes:
          - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
          - /var/run/docker.sock:/var/run/docker.sock:ro
        ports:
          - 8080:8080
        environment:
          - APACHE_PORT=11000
          - APACHE_IP_BINDING=0.0.0.0
          - NEXTCLOUD_DATADIR=/nc-data-docker

    3. Start containers

    sudo docker compose up -d

    4. Config NPM

    • Create an SSL certificate for your chose domain.
    • Create a new Proxy Host
      • domain name: YOUR_DOMAIN
      • scheme: http
      • forward hostname: YOUR_IP
      • forward port: 11000
      • block common exploits: yes
      • websockets support: yes
      • force SSL: yes
      • HTTP/2 support: yes
      • HSTS: (optional)
      • custom Nginx configuration:
        • client_body_buffer_size 512k;
        • proxy_read_timeout 86400s;
        • client_max_body_size 0;

    5. Initial installation

    • Open https://YOUR_IP:8080
    • Write Down your setup password, which will be provided to you.
    • Domain: YOUR_FQDN (remember that your machine must be able to resolve it)
    • Choose to install NC 28 (during time of writing no fulltext-search was working in NC 29)
    • ClamAV: yes
    • Collabora: yes
    • Fulltextsearch: yes
    • Imaginary: yes
    • Timezone: (set your timezone, mine is “Europe/Berlin”)
    • After download and start of your containers, write down your randomly generated password for your admin account.

    Troubleshooting

    # how to set default phone region
    sudo docker exec --user www-data nextcloud-aio-nextcloud php occ config:system:set default_phone_region --value="DE"
    
    # how to edit config.php manually
    sudo docker run -it --rm --volume nextcloud_aio_nextcloud:/var/www/html:rw alpine sh -c "apk add --no-cache nano && nano /var/www/html/config/config.php"
    
    # how to check the log file
    sudo docker run -it --rm --volume nextcloud_aio_nextcloud:/var/www/html:rw alpine sh -c "apk add --no-cache lnav && lnav /var/www/html/data/nextcloud.log"
    
    # how to check the docker log
    sudo docker logs -f nextcloud-aio-mastercontainer

    Credits