Nextcloud AIO unexpectedly reset to initial setup

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • Nextcloud AIO v10.13.0
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 22.04.5 LTS
  • Web server and version (e.g, Apache 2.4.25):
    • n/a
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • n/a
  • PHP version (e.g, 8.3):
    • n/a
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • 2 days ago after I stopped Nextcloud AIO docker containers
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • AIO - Docker compose
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • Cloudflare - ZeroTrust tunnel

Summary of the issue you are facing:

[ 2 days ago I stopped all the AIO Docker containers because I wanted to move the ncdata folder from my NAS ‘A’ to NAS ‘B’. Before starting the folder move, I tried to start the containers again just to confirm everything was working fine before making any changes. I was surprised that Nextcloud wanted to set up my whole server again, as the initial setup screen appeared. I don’t know why this happened and I don’t know how to regain my setup.

If I go through the initial steps again, will it rebuild the data based on the old Docker volumes and the ncdata folder? Please help me understand what happened and how it can be solved without data loss.

The only thing I did 2 weeks ago was stop my physical node and upgrade the BIOS firmware, but after that, Proxmox, the Nextcloud VM, and then the Nextcloud AIO all started without any problem and worked as expected until this point.

Since then, regardless of the original issue, I have moved the ncdata folder to the new location, so there might be some permission-related entries in the logs due to that. However, the original problem already occurred before the move, I just didn’t save those earlier logs.]

Steps to replicate it (hint: details matter!):

  1. docker stop
  2. docker compose up -d

Log entries

Nextcloud

Trying to fix docker.sock permissions internally...
Adding internal www-data to group ping
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
⚠️ Important: do always use an ip-address if you access this port and not a domain as HSTS might block access to it later!

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
[Sat May 10 05:27:20.773603 2025] [mpm_event:notice] [pid 149:tid 149] AH00489: Apache/2.4.62 (Unix) OpenSSL/3.3.3 configured -- resuming normal operations
[Sat May 10 05:27:20.774532 2025] [core:notice] [pid 149:tid 149] AH00094: Command line: 'httpd -D FOREGROUND'
[10-May-2025 05:27:20] NOTICE: fpm is running, pid 154
[10-May-2025 05:27:20] NOTICE: ready to handle connections
{"level":"info","ts":1746854840.806247,"msg":"using config from file","file":"/Caddyfile"}
{"level":"info","ts":1746854840.8081417,"msg":"adapted config to JSON","adapter":"caddyfile"}
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
⚠️ Important: do always use an ip-address if you access this port and not a domain as HSTS might block access to it later!

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
[Sat May 10 06:29:57.234978 2025] [mpm_event:notice] [pid 137:tid 137] AH00489: Apache/2.4.62 (Unix) OpenSSL/3.3.3 configured -- resuming normal operations
[Sat May 10 06:29:57.235539 2025] [core:notice] [pid 137:tid 137] AH00094: Command line: 'httpd -D FOREGROUND'
[10-May-2025 06:29:57] NOTICE: fpm is running, pid 142
[10-May-2025 06:29:57] NOTICE: ready to handle connections
{"level":"info","ts":1746858597.2603776,"msg":"using config from file","file":"/Caddyfile"}
{"level":"info","ts":1746858597.2630486,"msg":"adapted config to JSON","adapter":"caddyfile"}
Deleting duplicate sessions

Configuration

Nextcloud

version: "3.8"

services:
  nextcloud-aio-mastercontainer:
    image: nextcloud/all-in-one:latest
    init: true
    restart: always
    container_name: nextcloud-aio-mastercontainer
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - /var/run/docker.sock:/var/run/docker.sock:ro
    network_mode: bridge
    ports:
      - 80:80
      - 8080:8080
      - 8443:8443
    environment:
      APACHE_PORT: 8081
      APACHE_IP_BINDING: 0.0.0.0
      APACHE_BODY_LIMIT: 0
      NEXTCLOUD_DATADIR: /mnt/nextcloud-truenas/ncdata
      NEXTCLOUD_ADDITIONAL_APKS: imagemagick perl
      NEXTCLOUD_UPLOAD_LIMIT: 32G
      SKIP_DOMAIN_VALIDATION: true
volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer

Hi, I fear I cannot explain nor reproduce the problem. The only idea I have is that you mistakenly deleted the nextcloud_aio_mastercontainer docker volume which stores the persistent data of the mastercontainer…

I forgot to share, that I also checked the volumes and it looks pretty weird:

root@homelab-nextcloud:/opt/docker_nextcloud# ls -la /var/lib/docker/volumes/
total 76
drwx-----x 11 root root   4096 May  1 20:10 .
drwx--x--- 12 root root   4096 May  1 20:03 ..
brw-------  1 root root 253, 0 May  1 20:03 backingFsBlockDev
-rw-------  1 root root  65536 May  1 20:10 metadata.db
drwx-----x  3 root root   4096 Dec  4 07:58 nextcloud_aio_apache
drwx-----x  3 root root   4096 Dec  4 07:55 nextcloud_aio_clamav
drwx-----x  3 root root   4096 Dec  4 07:55 nextcloud_aio_database
drwx-----x  3 root root   4096 Dec  4 07:55 nextcloud_aio_database_dump
drwx-----x  3 root root   4096 Dec  4 07:55 nextcloud_aio_elasticsearch
drwx-----x  3 root root   4096 May  1 20:10 nextcloud_aio_mastercontainer
drwx-----x  3 root root   4096 Dec  4 07:57 nextcloud_aio_nextcloud
drwx-----x  3 root root   4096 Dec  4 07:55 nextcloud_aio_redis
drwx-----x  3 root root   4096 Dec  4 07:56 nextcloud_aio_talk_recording

Only the mastercontainer’s volume was recreated at 1st of May. That’s 100% sure that I didn’t delete it manually.

It looks like your instance has unintentionally started a new setup because the original Docker volume wasn’t properly reattached to the mastercontainer.

I had a very similar issue recently — after manually stopping the nextcloud-aio-mastercontainer and starting it again, I was prompted with a message saying that the volume already exists, but it couldn’t be accessed, and Docker offered to create a new one. If that prompt is confirmed, a new empty volume gets created and Nextcloud AIO launches into its initial setup screen.

If you’re using docker compose to manage your containers, the correct way to recover the original instance is to explicitly tell Docker to use the existing volume by adding this section to your docker-compose.yml:

volumes:
  nextcloud_aio_mastercontainer:
    external: true

With that in place, Docker will properly link to the original configuration volume and your previous setup should be restored.

TL;DR:

  • You most likely created a new nextcloud_aio_mastercontainer volume.
  • Your original data may still be intact.
  • To recover it, update your docker-compose.yml and declare the volume as external.

Hmm, I’m in the same boat. AIO on the same version, installed via docker-compose on a Proxmox VM (MX Linux). I’m using cloudflare as well. I did a pull for the first time in a month or two to update it, and my other things. But since then, it hasn’t worked. I’m given the “initial setup” dialogue.

I have almost the same setup as OP, though looking at my volumes, they are all still there but also the creation date is correct for the nextcloud_containers, back in October, but the metadata.db and backingFsBlockDev are today’s date. Also I have a two containers, one from today and one from last week that are just named a huge string of random numbers/letters, not sure what those are about.

Anyway, it’s been a while since I’ve set this up and I’m a bit lost as to how to begin troubleshooting. And just as a precaution, how would I manually backup all of the actual data nextcloud has? Or just, kind of view it? I don’t have much, but I’d like to ensure it’s safe and I don’t accidentally overwrite it or something.

Hi all,

Following up on my post — I’ve been investigating what happened when my Nextcloud AIO instance unexpectedly reset to the initial setup screen. After reviewing the contents of /var/lib/docker/volumes/, I found some potentially relevant details and would appreciate input on how to proceed.

Findings:

  • Most service volumes (e.g. nextcloud_aio_database, nextcloud_aio_apache, etc.) still contain data with timestamps from December 2024.
  • However, several files — including Docker metadata such as /var/lib/docker/volumes/metadata.db — were created on May 1, 2025.
  • I did not receive any prompt or confirmation related to resetting or reinitializing the master container. I did a simple docker compose down and docker compose up -d.
  • It appears that the nextcloud_aio_mastercontainer volume may have been recreated around this time, potentially causing the AIO setup process to restart.
  • Some files inside the database volume also have May 1 timestamps, though it’s unclear whether this indicates the database was reset or whether new files were created as part of an automated initialization attempt.

Questions:

  1. If the ncdata volume mount is still intact, and the database volume has not been fully reset, is there a supported path to restoring the Nextcloud instance from this state?
  2. Is it possible to deploy a new AIO instance and point it to the existing ncdata and database volumes to regain access?
  3. If not, what would be the recommended recovery path? Manual data recovery, full reinstall, reimport from ncdata, or other?

Happy to provide more detailed information if needed (e.g. full volume tree output, docker inspect, etc.). Just trying to determine whether a recovery is feasible before proceeding further.

Thanks in advance for any guidance.

Yes, see all-in-one/migration.md at main · nextcloud/all-in-one · GitHub

In theory yes. See all-in-one/migration.md at main · nextcloud/all-in-one · GitHub

You need to back up the current state, export all your data that is intact and then follow all-in-one/migration.md at main · nextcloud/all-in-one · GitHub

1 Like