Command to download the files stored in nextCloud

Thanks, who can tell me how to download files stored in nextCloud using commands? What was the order? thank you !

I only thought of this one way, but I haven’t thought of how to download the files in the entire directory.sorry.

If you have access to the command line on your Nextcloud server you can use the following to download the entire Nextcloud data folder.


  1. create backup folder
  2. cd into parent folder containing data folder (normally /var/www/)
  3. Compress entire data folder.
sudo mkdir backups
cd /var/www/
sudo tar -czvf ~/backups/filename.tar.gz DATA_FOLDER_NAME

Download compressed data file to your machine


  1. cd into receiving folder where file will be downloaded to
  2. transfer compressed data file
  3. change owner of compressed data file to personal computer user
sudo scp -r -i ~/.ssh/SERVER_Key server_user@192.168.###.###:~/backups/fielname.tar.gz .
sudo chown newuser:newgroup filename.tar.gz

Decompress data file

sudo tar -xzvf FILENAME.tar.gz /DESTINATION_FOLDER

That will get all of the data files from Nextcloud.

Warning: Be aware that you may need a lot of available room on the Nextcloud server because you are basically duplicating the data folder when creating the compressed file.