Asking for help, optimizing my setup

Dear Nextcloud Community!

I started my Nextcloud journey a few months ago with the intent of re-purposing my “old” PC and have a private backup and sharing solution. I love the software, and I managed to do a self hosting with proper setup.
Now after the honeymoon phase, I started thinking about a few things, which I don’t know how to tackle without a complete re-installation and losing my current data. I would like to ask for your insight, support, mentoring, etc. on how to make my setup better.

My journey so far
My pc is an i5-6600 with 16GB ram and 256GB SSD + 2x1TB HDD in Raid1

I’ve installed the Nextcloud server on a Ubuntu Server 22.04 LTS, and selected the Nextcloud installation during the setup. It turned out to me that it is a SNAP package, which was convenient, but many things (as it turned out) are not 100% working in it (like imageick.php). But that’s not a big deal to me. The basic functions are working nicely. However I am guessing there must be a better, more flexible way of administering Nextcloud than this. → to the questions

During the install I made the following decisions:

  1. Installed the /boot on the 256GB ssd
  2. created a Raid1 for the 2x1TB HDD and utilized it for the root (/). This is where all my data is going. I would’ve prefered to install the OS and then Nextcloud on the SSD and only store my data on the HDD, but couldn’t find any specific tutorial to this, so I stuck with it.

After the install I did the setup, used DuckDns to be able to perform the backups from my phone, and using Chat, etc. I was and am happy. It works, I can share my photos with family. All is good.

But then some questions occured to me…

The questions

  1. I think it’s absolutely not optimal to have the OS and Nextcloud instance run on my Raid1 HDD setup. Is there a better way of setting things up?
    I couldn’t find anywhere, how to tell Nextcloud where to place the data. I am guessing, that I have to install the Ubuntu server to the SSD without the Nextcloud SNAP, and then manually installing Apache, SQL, and Nextcloud as apt, or something… But everywhere I look in tutorials everybody does what I did in my journey. Can you please suggest a more optimal setup?

  2. Since my motherboard is capable of accepting 6 SATA drives (2 are now in use) I want to add additional HDD to my system in order to have more storage with redundancy. If I buy 2x8TB HDD (would be sufficient for all my family) how can I upgrade my storage space in Nextcloud?

  3. I want to regularly backup my setup (not the storage, since I sync it to my desktop PC and I can create backups through there), but I have no idea how to do it on Ubuntu Server… I am running Linux Mint and Windows, and for both of them I have a sollution in place for backups. Can you please advise what would be a good solution? - Bonus question to this: can I plug in a USB hdd to perform the backup?

Many thanks!
RedBoyforCE

hi @RedBoyforCE welcome to the community :handshake:

I’m sorry no idea about snap but with my nearly 5y long experience with Nextcloud and 20y in IT jobs I think I can share some insights.


I used Docker for my NC installation from the beginning. AFAIK it’s similar to snap and has it own issues but it is far more customizable and there are multiple solutions

In my eyes Docker (or maybe podman) is very good solution for self-hosting because you can easily run multiple instances side-by-side using different settings and versions - e.g. I’m running two Nextcloud setups, one for production with real data and one where I test upgrades and new apps (and third one just for throw-away testing) on an old desktop PC similar to your.

Docker allows to store data wherever you want, so you could store apps and database on fast SSD while all your files, photos and backups live on cheap magnetic disk (see Docker persistent data).


There are more solutions like Hansson VM and the “traditional” bare-metal install as most powerful but most complex install (in my eyes) - no additional complexity because of virtualization but more problem due to upgrades, package dependencies backup and restore.

I think you will find good Nextcloud installation tutorial for almost every common setup today. I would suggest you choose the one you are most comfortable with - there is always a way to move your installation to another server running different hardware or software. It might be harder or easier depending on your knowledge or software but as long you backup all important parts you are on the safe side.


Regarding your storage design - one can discuss days and weeks about it but this doesn’t address maybe the most important topic in your plans - backup. I doesn’t really matter which level of RAID and how many disks you add to the system your still suffer form “single point of error” which is still your server… in case of disaster like fire or flood, human error killing all the data (e.g. you as an admin run “rm -rf” command in wrong place) you will loose everything… for this reason you definitely should plan for backup on a second system - which is OK to run in the same place and another “offsite” backup outside of your home - this could be a simple USB drive you give to your parents, store in the holiday home etc…


I tried lot of different configurations and for the moment my preferred setup looks like “very simple Nextcloud ‘server’” running with one SSD and one HDD. This one preforms daily backups to a NAS running in another room (with RAID)… from there I do pseudo-automatic backup to 3 different USB disks which remain offline most of the time and only connect with the NAS for backup every 3 disk (each week another disk). This is definitely nothing professional but I’m pretty confident this backup strategy will survive most even catastrophic scenarios I can imagine… Definitely recovery is not really easy but I know I can recover the majority of my data if one of the systems survive the incident - I loose few hours to maximum 3 weeks of data maximum (if only the oldest USB disk survive)

1 Like

Wow thank you wwe for giving me such detailed ideas to my question. I will experiment with docker leaving the snap trail behind!
I really appreciate your help!

Hello,

Refer here → Moving Nextcloud Data to external USB drive - :information_source: Support / :package: Appliances (Docker, Snappy, VM, NCP, AIO) - Nextcloud community

You can have the entire OS / Nextcloud Snap on your SSD, where as user data can be stored separately at different location (which can be on raid)

Thanks.

1 Like

Hello NaXal!
This was an excellent guide for one of my greatest issues! I really apreceiate it!
What I am planning to do:

  1. Since (as I understand) only the boot “sector” is on the SSD, I somehow need to move the OS to the SSD. Meaning the most clean thing to do is to start from scratch. Not a biggie, because I now know, how to move my files to an external USB HDD as a backup. I’ll do that by following the guide Step 1 and Step 2.

  2. Now if that is done, I will continue with Step3 of the guide, with the difference, that once the moving is done to the USB drive, I will re-install Ubuntu 22.04 with Snap Nextcloud.

  3. I’ll install them on the SSD both the /boot, and both the “/” folder. I’ll format the HDDs again, and configure for Raid1

  4. Once that is done, I’ll create the folder structure in the Raid1 and copy my data to it.

  5. I’ll then continue to shutdown nextcloud, update the PHP, give permissions, and re-start the service, and the server.

What do you think? DId I miss something?

Thanks again for your support!

András

1 Like

Hello,

Snap doesn’t allow you such action. It is kind of a self contained package and all the dependencies inside can only be updated by the snap release team by pushing their update, as per their own update schedule.

Snap is for people like me who wants a plug n play solution and doesn’t want to go too deep into customization. Snap doesn’t allow such actions at all. It is very limited in terms of customization.

In open source world, the key is flexibility and choosing your own way. There may be multiple ways to achieve a result. So no way is actually the only way.

For example,

Looking at this configuration, it seems it is a repurposed business PC. I have similar configuration. I prefer a different route for my approach, which is more suitable for my overall setup. For example,

Since these business PCs come with Windows 11 Pro license, I use the Windows 11 Pro as base OS as hypervisor. I deploy my nextcloud as a Hyper-V Ubuntu VM. I use Windows storage sense to mirror my HDDs. I have two vDisk in that (Nextcloud) Ubuntu VM, a smaller 8GB boot disk VM containing the OS+Nextcloud and another larger vDisk for (Nextcloud) user data. That user Data vDisk is kept in HDDs, which are in mirror mode via Windows storage sense.

Benefit?

I can have easy off site backup via local LAN, where all I need to do is copy both the vDisk out to a second machine or in some other cloud (via Internet).

In case the main server goes down for whatever reason, I can simply redeploy the VMs in any other Windows hyper V machine and nextcloud will be back up and running in minutes.

Is it the right way? → Doesn’t matter to me, as long as it is giving me the desired result and I feel comfortable about maintaining the process, I am happy with it.

Thanks.

PS. If you are sticking with Snap, refer here, this snap backup command will be helpful for snap users and helps to easily backup the database only. Since user data is safe in raid storage but database is not.

sudo nextcloud.export -b

Refer here → How to backup your instance · nextcloud-snap/nextcloud-snap Wiki · GitHub