Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Update a Dockerized Nextcloud instance by replacing the container, not by patching files inside the running container. Pull the image, stop and remove the old container, then start a new container with exactly the same persistent volumes, ports, environment variables, and runtime options. For a Compose stack, run docker compose pull followed by docker compose up -d. The image startup script detects the version stored in persistent storage and runs the required Nextcloud upgrade automatically.

What changes during a Dockerized Nextcloud update

A Docker image is immutable application software. The supported update model is to download a newer image and create a replacement container from it. The old container is disposable; your files, configuration, installed custom apps, themes, and database must live in persistent storage that is mounted into the replacement.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Nextcloud’s Docker maintainers describe the lifecycle as pulling the new image, throwing away the old container, and starting the new one. Removing a container does not remove a named volume, but data can become inaccessible if the replacement is started without the old mounts. Treat the original container definition as part of your backup: record its image tag, volume mappings, port mappings, environment variables, user settings, restart policy, network attachments, and any reverse-proxy or database options.

Prepare before touching the container

Make a fresh, complete backup

Nextcloud recommends regular backups and a new backup before every upgrade. A container recreation is not a database backup. Preserve all of the following, using a method appropriate to your storage platform:

#1 Best Overall
Sale
UGREEN NAS DH2300 2-Bay for Beginners & Personal Users, Phone Backup | AI Album, Private Cloud/Remote Access, File Sharing, Multi-Device Backup, Home Entertainment, 4GB RAM on Board (Diskless)
  • Entry-level NAS Personal Storage:UGREEN NAS DH2300 is your first and best NAS made easy. It is designed for beginners who want a simple, private way to store videos, photos and personal files, which is intuitive for users moving from cloud storage or external drives and move away from scattered date across devices. This entry-level NAS 2-bay perfect for personal entertainment, photo storage, and easy data backup (doesn't support Docker or virtual machines).
  • Set Your Devices Free, Expand Your Digital World: This unified storage hub supports massive capacity up to 64TB.*Storage drives not included. Stop Deleting, Start Storing. You can store 22 million 3MB images, or 2 million 30MB songs, or 43K 1.5GB movies or 67 million 1MB documents! UGREEN NAS is a better way to free up storage across all your devices such as phones, computers, tablets and also does automatic backups across devices regardless of the operating system—Window, iOS, Android or macOS.
  • The Smarter Long-term Way to Store: Unlike cloud storage with recurring monthly fees, a UGREEN NAS enclosure requires only a one-time purchase for long-term use. For example, you only need to pay $459.98 for a NAS, while for cloud storage, you need to pay $719.88 per year, $2,159.64 for 3 years, $3,599.40 for 5 years. You will save $6,738.82 over 10 years with UGREEN NAS! *NAS cost based on DH2300 + 12TB HDD; cloud cost based on 12TB plan (e.g. $59.99/month).
  • Blazing Speed, Minimal Power: Equipped with a high-performance processor, 1GbE port, and 4GB RAM on Board, this NAS handles multiple tasks with ease. File transfers reach up to 125MB/s—a 1GB file takes only 8 seconds. Don't let slow clouds hold you back; they often need over 100 seconds for the same task. The difference is clear.
  • Let AI Better Organize Your Memories: UGREEN NAS uses AI to tag faces, locations, texts, and objects—so you can effortlessly find any photo by searching for who or what's in it in seconds. It also automatically finds and deletes similar or duplicate photo, backs up live photos and allows you to share them with your friends or family with just one tap. Everything stays effortlessly organized, powered by intelligent tagging and recognition.
  • The Nextcloud configuration folder, including config.php.
  • The data folder containing user files and file metadata that is stored there.
  • The custom-apps folder, when your installation uses one.
  • The theme folder, when a custom theme is installed.
  • The complete Nextcloud database, including its schema and application data.

Verify that the backup can actually be read or restored before relying on it. Keep the database backup coordinated with the filesystem backup; restoring only one side can leave file metadata and database records out of sync.

Capture the current container definition

Before removal, write down the exact command or Compose file used to create the running container. At minimum, capture:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • The image repository and tag.
  • Every -v or --mount entry.
  • Published ports and attached Docker networks.
  • Environment variables, restart policy, and container name.
  • The database service name, credentials references, and any reverse-proxy settings.

If you cannot reconstruct these settings, inspect the existing container configuration before stopping it and save the result outside the container. The replacement must attach the same application and database storage; otherwise it may appear to be a new, empty Nextcloud installation.

Check release compatibility

Read the release notes and system requirements for the target image. Review critical changes and confirm that third-party apps support the target major release. Maintenance releases address critical functionality or security bugs, but the newest available tag is not automatically the right choice for every deployment.

Update a standalone container with Docker commands

Use this sequence when the container was created with docker run. Replace the container name and options with the values from your existing deployment; do not simplify the mounts or environment settings for convenience.

  1. Pull the target image.
    docker pull nextcloud

    This downloads the image referenced by the tag. If your deployment uses a version-specific tag, pull that tag instead of silently changing to a floating tag.

    Free tools Windows power users keep installed

    One-click scans. No signup required.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  2. Stop the current container.
    docker stop <your_nextcloud_container>

    Stopping cleanly lets the process finish active shutdown work before the container is removed.

    Rank #2
    Sale
    UGREEN NAS DXP2800 2-Bay for Advanced Home Users, Remote Workers & Creators | Home Media & Data Center, Docker & VM, Plex, Fast File Transfer, Intel N100, 8GB DDR5, 2.5GbE, 2x M.2 NVMe, 4K HDMI(Diskless)
    • 【Advanced Home Data & Media Hub】For advanced home users who need phone backup, file storage, and centralized data management. Centralize family photos, 4K videos, movies, computer backups, and personal files in one place while running multiple apps for home entertainment and everyday data management. Suitable for households with growing digital libraries and multiple NAS use cases.
    • 【Built for Creators, Media Servers & Advanced Apps】Powered by the Intel N100 Quad-Core CPU, 8GB DDR5 RAM, 2.5GbE networking, and dual M.2 NVMe slots, DXP2800 handles large files and heavier workloads with ease. Run Docker, virtual machines, and media server applications compatible with Plex—ideal for content creators, tech enthusiasts, and advanced home users managing 4K videos, RAW photos, personal media libraries, and multiple NAS apps.
    • 【Up to 80TB for Growing Digital Libraries】 Supports up to 80TB of storage using two HDD bays and two M.2 NVMe SSD slots for family photos, movies, RAW photos, 4K videos, work files, and device backups. AI photo management supports recognition of people, objects, scenes, and locations, album organization, and duplicate photo detection. HDDs and SSDs are not included.
    • 【AI-powered Home Surveillance】Turn DXP2800 into a centralized home surveillance hub by connecting compatible network cameras and storing recordings locally on your NAS. AI-powered features include Face Recognition, People Detection, and Pet Detection, helping advanced home users review important events more efficiently while managing home surveillance and personal data in one place.
    • 【One data Center Across Your Devices】Keep files from desktops, laptops, phones, tablets, and other devices together instead of scattered across cloud accounts and external drives. Access, back up, organize, and share data across Windows, macOS, Android, iOS, web browsers, and compatible smart TVs—ideal for creators and advanced home users working across multiple devices.
  3. Remove only the container.
    docker rm <your_nextcloud_container>

    Do not add volume-removal flags. The goal is to discard the container layer while retaining the named volumes or host directories that hold Nextcloud and database state.

  4. Run the replacement with the original definition.
    docker run <OPTIONS> -d nextcloud

    Use the same persistent mounts, ports, environment variables, networks, restart policy, and other options as before. Reattach every volume used by the old container, including the volume mounted at /var/www/html and the separate database volume.

The image’s startup script compares the Nextcloud version in persistent storage with the version included in the image. When they differ, it starts the upgrade process. Do not interrupt that process simply because the container has restarted; wait for the service to complete its migration and then inspect its status and logs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Update a Docker Compose deployment

Compose is usually more repeatable because the image, mounts, ports, environment, networks, and dependencies are declared together. That reduces configuration drift when a container is recreated, provided the Compose file is kept under version control and its referenced secrets remain available.

  1. Change the image tag if you are targeting a specific release. Keep the existing tag when you intentionally want the current policy, or edit the Compose file to the reviewed target tag.
  2. Pull the image.
    docker compose pull
  3. Recreate services from the Compose definition.
    docker compose up -d
  4. Watch startup output and service state. Confirm that the app, database, and any proxy services are running, then review logs for migration errors.

Compose will recreate a service when its image changes while preserving declared named volumes. It will not preserve a volume that you accidentally removed from the file, renamed, or replaced with a different host path, so compare the mounts before running the update.

How the automatic Nextcloud upgrade behaves

The application files and non-database data are stored under /var/www/html in the official image. A named Docker volume or host bind mount should persist that path. The startup script reads the installed version from the persistent volume and compares it with the image version. A mismatch triggers the Nextcloud upgrade routine during startup.

This automatic step updates the application’s database schema and files as required by the target release. It does not create a backup for you, and it cannot restore a database that was not persisted. Keep the database in its own persistent volume or external database service and back it up independently.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
BUFFALO LinkStation 210 2TB 1-Bay NAS Network Attached Storage with HDD Hard Drives Included NAS Storage that Works as Home Cloud or Network Storage Device for Home
  • Value NAS with RAID for centralized storage and backup for all your devices. Check out the LS 700 for enhanced features, cloud capabilities, macOS 26, and up to 7x faster performance than the LS 200.
  • Connect the LinkStation to your router and enjoy shared network storage for your devices. The NAS is compatible with Windows and macOS*, and Buffalo's US-based support is on-hand 24/7 for installation walkthroughs. *Only for macOS 15 (Sequoia) and earlier. For macOS 26, check out our LS 700 series.
  • Subscription-Free Personal Cloud – Store, back up, and manage all your videos, music, and photos and access them anytime without paying any monthly fees.
  • Storage Purpose-Built for Data Security – A NAS designed to keep your data safe, the LS200 features a closed system to reduce vulnerabilities from 3rd party apps and SSL encryption for secure file transfers.
  • Back Up Multiple Computers & Devices – NAS Navigator management utility and PC backup software included. NAS Navigator 2 for macOS 15 and earlier. You can set up automated backups of data on your computers.

Maintenance mode during the migration

Maintenance mode locks existing sessions and prevents new logins, reducing the chance of writes arriving while maintenance is underway. If maintenance mode remains enabled after the upgrade, turn it off as the web user:

docker compose exec --user www-data app php occ maintenance:mode --off

The exact service name may differ from app. Run the command against the Compose service that contains Nextcloud. The Docker README also documents the shorter form:

docker compose exec -u33 app ./occ

Alpine-based images use UID 82 instead of UID 33. Use the user ID appropriate to the image variant, or use the explicit --user www-data form where supported.

Upgrade major versions one at a time

Nextcloud major versions cannot be skipped. First bring the current major version to its latest point release. Only then move to the next major version, repeating the backup, compatibility review, image pull, recreation, and validation steps for each major release.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Identify the currently installed major and point version.
  2. Install the latest maintenance release in that same major series.
  3. Back up the application state and database again.
  4. Review critical changes, system requirements, and third-party app compatibility for the next major.
  5. Update to the next major version and allow its migration to finish.
  6. Repeat until the desired major version is reached.

Skipping directly from an older major release to a newer one can leave migrations unapplied and is outside the supported upgrade path. A floating image tag may move farther than intended, so inspect the tag and release notes before pulling it.

Protect the paths that contain your data

The main application mount

Use a named volume or host bind mount for /var/www/html. This location contains the installation and non-database data used by the Docker image. The replacement container must mount the same volume at the same path; mounting it elsewhere does not preserve a working installation.

Custom paths under the application tree

Custom mounts placed below /var/www/html are upgrade-sensitive. During an upgrade, files in that tree can be overwritten or removed unless the paths are included in upgrade.exclude. When possible, mount custom storage outside the application tree and reference it through the supported Nextcloud configuration rather than overlaying files inside the image-managed path.

Rank #4
Sale
UGREEN NAS DH4300 Plus 4-Bay for Beginners, Home Users & Remote Workers | Photo & Video Backup, AI Photo Album, File Hub, Private Cloud & Secure Home Surveillance, 8GB LPDDR4X, 4K HDMI (Diskless)
  • Entry-level NAS Home Storage: The UGREEN NAS DH4300 Plus is an entry-level 4-bay NAS that's ideal for home media and vast private storage you can access from anywhere and also supports Docker but not virtual machines. You can record, store, share happy moment with your families and friends, which is intuitive for users moving from cloud storage, or external drives to create your own private cloud, access files from any device.
  • Smart Photo Backup & AI Album: Automatically back up photos and videos from your phone in real time and keep growing family memories organized with AI-powered photo albums. Semantic search, custom learning, and recognition of people, objects, pets, and similar photos help you quickly find the moments you want. Duplicate photo removal also helps keep your library organized—ideal for families and users with large photo collections.
  • User-Friendly App & Easy Setup: Connect quickly via NFC, set up simply and share files fast on Windows, macOS, Android, iOS, web browsers, and smart TVs. You can access data remotely from any of your mixed devices. What's more, UGREEN NAS enclosure comes with beginner-friendly user manual and video instructions to ensure you can easily take full advantage of its features.
  • More Cost-effective Storage Solution: Unlike cloud storage with recurring monthly fees, A UGREEN NAS enclosure requires only a one-time purchase for long-term use. For example, you only need to pay $629.99 for a NAS, while for cloud storage, you need to pay $719.88 per year, $1,439.76 for 2 years, $2,159.64 for 3 years, $7,198.80 for 10 years. You will save $6,568.81 over 10 years with UGREEN NAS! *NAS cost based on DH4300 Plus + 12TB HDD; cloud cost based on 12TB plan (e.g. $59.99/month).
  • Your Data, You Control:No third-party clouds, no hidden access, UGREEN NAS provides a more secure and private data storage solution. It stores data locally on your private hard drives and does automatic backups. Thus, you can keep full control over it. The advanced encryption is TRUSTe certified in the United States and is awarded the first (and only) ETSI EN 303 645 certification mark for NAS products by TÜV SÜD Group.

The database mount

Keep the database on its own persistent volume or external database service. Recreating the Nextcloud container does not recreate the database, but starting a replacement without the original database connection can make the application report connection errors or initialize against an unintended database. Preserve the database service name, credentials, network, and storage settings exactly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run and interpret Nextcloud CLI checks

Run occ as the web user so that files and generated configuration retain the permissions expected by Nextcloud. In a Compose deployment, check status with:

docker compose exec --user www-data app php occ status

The status output should identify the expected installed version and indicate whether the instance is in maintenance mode. If the image is Alpine-based, use the image’s documented web-user UID (82 rather than 33) when an explicit numeric user is required.

After the migration, inspect container logs and confirm:

  • The reported Nextcloud version is the target version.
  • The upgrade completed without database or file-migration errors.
  • The web interface loads through the normal URL and reverse proxy.
  • Users can authenticate and access existing files.
  • Background jobs run and do not repeatedly fail.
  • The database connection remains healthy.
  • Critical third-party apps are enabled and compatible.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose image tags deliberately

A floating tag is convenient because a later pull can provide a newer image without editing the deployment definition. Its target is less explicit, however, and a routine recreation may move the installation farther than expected.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A pinned version tag makes the target reproducible and gives you a controlled change window. It also makes a planned rollback possible: restore the compatible backup and recreate the container with the previously selected image tag. Rolling back only the image while leaving a database already migrated to a newer major version is not a safe recovery plan.

Tag strategy Convenience Reproducibility Best use
Floating tag Pulling can follow the current image automatically Lower; the same command can resolve to different releases over time Operators who review every pull and accept less predictable timing
Pinned version tag Requires an intentional tag change Higher; the target release is explicit Controlled upgrades, staged testing, and documented recovery plans

Apache and FPM image architecture

The Apache image includes a web server, so it can serve HTTP directly when its ports and proxy arrangement are configured accordingly. An FPM image provides PHP-FPM rather than a complete web server; it requires a separate web server or reverse proxy to handle HTTP and pass PHP requests to FPM.

Best Value
Synology 2-Bay DiskStation DS223j (Diskless)
  • Secure private cloud - Enjoy 100% data ownership and multi-platform access from anywhere
  • Easy sharing and syncing - Safely access and share files and media from anywhere, and keep clients, colleagues and collaborators on the same page
  • Automated Backup Protection - Set-and-forget backups for Macs, PCs and mobile devices to multiple destinations including cloud and external drives
  • Home Security System - Record and monitor your property 24/7 with support for multiple IP cameras and remote viewing
  • 2-Year Warranty - Reliable hardware backed by Synology's expert customer support team and ongoing software updates
Image architecture Included Additional requirement Update consideration
Apache Nextcloud application plus Apache web server Expose or proxy the Apache port according to the deployment Recreate the Apache container with its existing port and proxy settings
FPM Nextcloud application plus PHP-FPM Separate web server or reverse proxy Update the FPM service and keep the web server’s upstream, network, and shared-path settings intact

Do not switch architectures during an ordinary version update unless you have separately designed and tested the web-server configuration. The image replacement procedure assumes the same architecture and runtime options as the existing deployment.

Troubleshoot common update failures

The site shows a new, empty setup

The replacement probably started without the original /var/www/html mount or database connection. Stop it, verify the old volume name and host path, restore the original mounts and environment variables, and recreate the container. Do not create users or upload files into the empty instance before correcting the mount.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The container starts but the web page is unavailable

Check that the published port, Docker network, reverse-proxy upstream, and container health are unchanged. An FPM image cannot serve HTTP by itself; confirm that its separate web server or proxy is running and connected to the same network.

Upgrade errors appear in logs

Leave the original backup untouched, capture the logs, and identify whether the failure concerns a database migration, permissions, a system requirement, or an incompatible app. Do not repeatedly restart while an incomplete migration is still writing. Restore the documented backup only according to your recovery plan, then address the release or app compatibility issue before another attempt.

Maintenance mode stays enabled

Once logs show that the migration has finished, run occ maintenance:mode --off as the web user. If the command fails, inspect the database connection and filesystem permissions before retrying.

Custom files disappear after recreation

Review mounts below /var/www/html. They may have been overwritten or removed during the upgrade unless listed in upgrade.exclude. Move custom storage outside the application tree where possible and restore any required custom-app or theme files from backup.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Post-update verification checklist

Use this checklist before declaring the maintenance complete:

  • Application and database containers are running from the intended image tags.
  • The expected Nextcloud version is reported by occ status.
  • Maintenance mode is off unless you intentionally left it on for further work.
  • The web interface, login, file listing, and representative downloads work.
  • Background jobs execute successfully.
  • Database connectivity and migrations report no errors.
  • Critical apps, custom themes, and custom storage are present.
  • Reverse-proxy routing, HTTPS termination, and network connections behave as before.
  • The pre-upgrade backup and the exact new container definition are retained.

When to use a staged update instead

For a production instance with many users or third-party apps, perform each supported major-version step in a staging copy first. Use the same image tag, volume layout, database engine, proxy architecture, and app set as production. Staging cannot replace a production backup, but it can expose incompatible apps, missing system requirements, and custom-mount problems before the maintenance window.

The safest operational pattern is therefore deliberate: pin or otherwise identify the target image, back up both filesystem and database state, recreate the container from the unchanged definition, let the image perform its supported migration, and verify the application before reopening normal access.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.