A reliable Nextcloud VPS backup is a coordinated copy of five things: the config directory, the data directory, the theme directory, any custom apps, and the database. Put Nextcloud in maintenance mode before copying anything, keep at least one backup outside the VPS, and restore the files and database as one unit. After recovery, run maintenance:data-fingerprint so desktop and mobile clients recognize the restored state instead of treating it as an unrelated file tree.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
What a complete Nextcloud backup contains
Nextcloud stores its state in more than the visible files in the web directory. A backup that omits one of the following can produce a site that appears to work while losing files, settings, application data, or customizations.
As an Amazon Associate I earn from qualifying purchases.
Recommended Free Tools
| Component | What it preserves | Why it is required during recovery |
|---|---|---|
config/ |
Instance configuration, database connection details, trusted domains, and other settings | The restored code needs the same configuration to connect to the database and interpret the data directory. |
| Data directory | User files, file versions, trash, and other per-user data stored on disk | The database contains metadata, but it is not a substitute for the actual file contents. |
| Theme directory | Custom branding and theme assets | Without it, a restored instance can lose its customized appearance. |
| Custom apps directory | Applications installed outside the standard Nextcloud distribution | Those applications and their code are not recreated by copying only the core installation. |
| Database | File metadata, shares, users, calendars, contacts, app records, and configuration held in database tables | A filesystem-only copy does not contain the metadata Nextcloud needs to understand the files. |
Keep directory copies and database dumps together as one dated recovery point. A database from one moment paired with a data directory from another can describe files that do not exist, or omit changes that users had already made.
Prepare the VPS before taking a backup
Choose a destination outside the Nextcloud environment
Do not write the only backup inside the same Nextcloud directory, virtual machine, or VPS disk. A disk failure, accidental deletion, compromised account, or failed upgrade could destroy both the live service and its backup. Copy the completed directory archive and database dump to storage outside the VPS or outside the Nextcloud environment, and retain access controls because the files may contain private user data and database credentials.
#1 Best Overall
- [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
- [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
- [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
- [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
- [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
Use a destination with enough space for both the data directory and the database dump. Preserve the date in each name so you can identify which directory copy belongs with which SQL dump.
Confirm the web-server account and paths
The examples below use the common www-data account and a Nextcloud directory named nextcloud/. Use the actual document-root and data-directory paths on your VPS. The account running occ should be the account that owns or normally runs the Nextcloud files; otherwise permissions can change during the operation.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Lock the instance before copying
Enable maintenance mode as the HTTP user:
sudo -E -u www-data php occ maintenance:mode --on
Maintenance mode locks the sessions of logged-in users and prevents new logins. This stops active requests from changing files or database rows while the copy is being made. Check the browser response from another session and confirm that Nextcloud reports maintenance mode before proceeding.
Leave maintenance mode enabled if a copy fails. A partially copied directory must never be mistaken for a usable recovery point.
Back up the files
Copy the installation directories
From the parent directory of the Nextcloud installation, copy the required directories to a destination outside the installation. A documented pattern is:
rsync -Aavx nextcloud/ nextcloud-dirbkp_`date +"%Y%m%d"`/
The archive mode preserves permissions and other attributes, while the recursive copy includes the directory contents. The trailing slash on nextcloud/ means its contents are placed into the dated destination. If your data directory lives outside the installation, include that directory explicitly in the same recovery point rather than assuming the command found it automatically.
Make sure the copy includes config, data, theme, and any custom-app directory present in your installation. Do not exclude the data directory to save space; doing so creates an incomplete backup.
Rank #2
- 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
- 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
- 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
- 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
- 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
Check the copy before moving on
- Confirm that the destination exists and has a plausible size.
- Open the copied
config/config.phpand verify that it is present, while limiting who can read it. - Spot-check several user directories and representative files in the copied data directory.
- Record the exact directory name beside the database dump name.
Back up the database with the matching client
Use the command for the database engine configured in config.php. The password appears in the command examples because they mirror the documented syntax; on a shared shell, avoid leaving credentials in command history and restrict the resulting dump file.
MariaDB
mariadb-dump --single-transaction -h [server] -u [username] -p[password] [db_name] > nextcloud-sqlbkp_`date +"%Y%m%d"`.bak
For MariaDB installations using four-byte character support, add --default-character-set=utf8mb4 to the dump command. The --single-transaction option creates a consistent transactional dump without requiring a prolonged table lock for typical transactional tables.
MySQL
mysqldump --single-transaction -h [server] -u [username] -p[password] [db_name] > nextcloud-sqlbkp_`date +"%Y%m%d"`.bak
Add --default-character-set=utf8mb4 for a MySQL installation configured for four-byte support, as specified by the Nextcloud manual.
SQLite
sqlite3 data/owncloud.db .dump > nextcloud-sqlbkp_`date +"%Y%m%d"`.bak
The SQLite example assumes the database file is data/owncloud.db. If your data directory is elsewhere, use its actual path. Because the database is a file inside the data area, keep the SQL dump with the directory copy and do not rely on copying only the live database file.
PostgreSQL
PGPASSWORD="password" pg_dump [db_name] -h [server] -U [username] -f nextcloud-sqlbkp_`date +"%Y%m%d"`.bak
Protect the shell environment and the dump file when using PGPASSWORD. The resulting SQL or custom-format file can contain every account, share, and metadata record in the instance.
Finish the backup window
Check that the dump is non-empty and that its timestamp matches the directory copy. If both artifacts are intact, turn maintenance mode off:
sudo -u www-data php occ maintenance:mode --off
If either artifact is missing or corrupted, keep the site in maintenance mode, correct the copy, and only then reopen it.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Rank #3
- [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
- [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
- [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
- [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
- [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
Choose a backup design that can actually be restored
The backup method matters less than whether it preserves a consistent set of files and database rows and can be recovered after the original VPS is unavailable. Evaluate each design against these questions:
- Consistency control: Does it use maintenance mode or another coordinated snapshot process?
- Scope: Does it include files and the database, rather than only one?
- Restore portability: Can you rebuild on a replacement VPS, or only return to the original host?
- Off-site durability: Is at least one copy outside the Nextcloud environment?
- Encryption and key custody: Can you decrypt the backup when the original server is gone?
- Retention and deletion recovery: Can you retrieve an older point after an accidental deletion?
- Restore evidence: Have you completed a test restoration and checked real files and services?
A simple directory copy plus a matching database dump is transparent and portable when stored off-server. Coordinated VPS snapshots can also be useful, but they must capture the database and files at a consistent point and be recoverable on replacement infrastructure. Treat any automated mechanism as unproven until a restoration drill succeeds.
Restore Nextcloud on the same or a replacement VPS
1. Put the target instance in maintenance mode
Before replacing files or importing tables, stop users from writing to the target:
sudo -E -u www-data php occ maintenance:mode --on
If the original VPS is unavailable, enable maintenance mode on the rebuilt installation after its code and web server are available. The objective is the same: no user requests should modify the target while the recovery point is being installed.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problems2. Restore the directories
Copy the saved configuration, data, theme, and custom-app directories into the target installation. The documented pattern is:
rsync -Aax nextcloud-dirbkp/ nextcloud/
Use the saved directory that belongs to the SQL dump you intend to import. Confirm that config/config.php is present and that the data directory is at the path referenced by the configuration. Restore custom applications only when their files are part of the saved recovery point.
3. Recreate the database before importing
Do not import a full dump into a database that still contains the old tables. The restore procedure recommends dropping and recreating the database first, using the database administrator tools appropriate to your engine. Recreate it with the same database name and credentials referenced by config.php, then import the matching dump.
Rank #4
- Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
- Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
- All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
- Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
- Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
4. Import the database dump
MariaDB
mariadb -h [server] -u [username] -p[password] [db_name] < nextcloud-sqlbkp.bak
MySQL
mysql -h [server] -u [username] -p[password] [db_name] < nextcloud-sqlbkp.bak
SQLite
rm data/owncloud.db
sqlite3 data/owncloud.db < nextcloud-sqlbkp.bak
For SQLite, remove the existing database file before recreating it from the dump. Use the actual data-directory path if it is not relative to the current directory.
Free tools Windows power users keep installed
One-click scans. No signup required.
PostgreSQL
PGPASSWORD="password" psql -h [server] -U [username] -d nextcloud -f nextcloud-sqlbkp.bak
Use the database name and credentials that match the restored configuration. Watch the client output for errors rather than assuming that a command returning to the prompt completed every statement successfully.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Make restored clients recognize the recovered state
After restoring either the data directory or the database, run:
sudo -u www-data php occ maintenance:data-fingerprint
This changes the ETag communicated to sync clients. The new fingerprint tells desktop and mobile clients that the server-side state has changed, allowing them to reconcile the restored files instead of silently assuming that their previous cache is current. Run it after both files and database are in place, not halfway through the restore.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallValidate the recovery before reopening access
Keep maintenance mode on while checking the application. A successful database import alone does not prove that the instance is usable.
- Open the web interface and confirm that the expected login page and theme load.
- Log in with a known account and inspect several folders and representative files.
- Download a file, upload a small test file, and confirm that metadata and timestamps behave normally.
- Open a shared folder and verify that the share still exists and has the expected recipients.
- Check calendars and contacts, including a representative event or contact record.
- Review background jobs and confirm that scheduled tasks can run.
- Test each external-storage integration that the instance depends on.
- Watch the web-server and application logs for database, permission, or missing-app errors.
When these checks pass, reopen the instance:
sudo -u www-data php occ maintenance:mode --off
Have a user or test client perform a normal sync after maintenance mode is disabled. If clients report conflicts, pause broad synchronization and investigate the restored fingerprint, file ownership, and database consistency before allowing destructive conflict resolution.
Using the official Nextcloud Backup app as an additional workflow
The official nextcloud/backup project documents encrypted backup points and the occ backup:point:restore command. This is an additional workflow, not a reason to discard the fundamentals above. Its setup export contains encryption keys, so preserve the exported setup and its encryption key with the backup. Losing those keys can make encrypted backup points impossible to decrypt.
Best Value
Because behavior can vary by application version, verify the version-specific restore procedure and complete a test recovery before treating the app as your sole disaster-recovery method. Whether you use the app or manual copies, retain a recovery point outside the live Nextcloud environment.
Troubleshoot common recovery failures
The web interface reports a database connection error
Compare the restored config.php values for database name, host, user, and password with the database you recreated. Confirm that the database service is running and that the account has privileges on the restored database. Do not create a second database under a similar name and leave the configuration pointing at the first one.
Files appear in storage but not in Nextcloud
This usually indicates that the data directory and database are from different recovery points, or that the data path in config.php is wrong. Recheck the pair of dated artifacts, restore them together, and run maintenance:data-fingerprint after the correction.
Users cannot log in after the restore
Verify that the database import completed and that the restored configuration points to it. Maintenance mode intentionally prevents new logins, so confirm its status before treating a blocked login as an authentication failure.
The restored site loses its branding or an application
Restore the saved theme and custom-app directories. A core installation copy does not recreate files that were added separately.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Sync clients do not react to restored changes
Run maintenance:data-fingerprint as the web-server account after the final database and data restore. Then test with one client and inspect its conflict messages before resuming synchronization across all devices.
An encrypted Backup app point cannot be opened
Locate the exported setup and its encryption key. The backup point cannot be decrypted without the required key material, even if the backup files themselves are intact.
Run a restoration drill, not just a backup job
A backup is a recovery capability only when you can use it. Periodically build a disposable target VPS or isolated environment and perform the same sequence: enable maintenance mode, restore the dated directories, recreate and import the database, run the data fingerprint command, and test logins, files, shares, calendars, contacts, jobs, and external storage. Record which recovery point was used and any manual corrections required. Keep the resulting notes with the operational documentation, but never store database passwords or encryption keys in an openly readable file.
The minimum defensible design is therefore straightforward: a consistent files-and-database recovery point, at least one off-server copy, protected credentials and keys, and a restore drill that proves the point can be turned back into a working Nextcloud instance.
Quick Recap
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.

