Taking NextCloud Backup hosted on Amazon EC2

I have NextCloud AIO Version 28.0.5 hosted on an Amazon EC2 instance. I deployed the NextCloud application using the official AMI. The application and all of its components are deployed as docker containers.
How can I take the backup of the NextCloud application?
Would this be enough if I just take the AMI of running the instance where I have deployed the NextCloud application?
I remember while going through the installation, it asked me to use a backup or fresh installation. I want to know how to take that backup which we can use during the installation of AIO software.

thank you so much in advance.

Regardless of how you deploy Nextcloud, ie. normal installation vs. docker, there are two key things you always want to back up:

  • database, ideally using the database means itself (ie. mariabackup/mysqlbackup when using one of these)
  • user data (the persistent volume mounted / used for data for the docker container)
  • add to it backup of any custom configs ie. reverse proxies, nextcloud config itself if/when customised

That way when you do restore: bam, redeploy docker images, restore DB + data + config, and you’re back online.

Doing an machine snapshot / instance: I would not go down that route. I’m not saying it would not work, but: you’re taking a snapshot of a running database, stuff possibly cached in memory, therefore possible inconsistent backup. Databases could be a$$ for this and could bring you more trouble than benefit + the level of granularity of such backup is not great - one large image, uncertain result.

2 Likes

Hi, see GitHub - nextcloud/all-in-one: 📦 The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance.

2 Likes

Hi @LeoStehlik thanks for the swift response. What you are saying completely makes sense. I will go through the doc you have shared, I hope I will find my answer there.

1 Like