New Installation with data stored on RAID. Trouble with Permissions

So I’m somewhat new to Linux. I’ve been around the block with various OS’s thoughout the years, but this problem just keeps stumping me. I’ve tried just about every “sure fix” I’ve found on the forums here, reddit, etc. to no avail.

This should be simple enough, so I am missing something, and could really use some help finding it.


I’m going to explain everything I’ve done, in an attempt to paint a picture of my current setup, in the hopes that maybe something stands out to the people who know more than me, ha.

Brand new Ubuntu Server installation. 3 drives total. 1 SSD for OS. 2 NAS drives for RAID. Soft RAID created by Linux installer during OS installation. Usual update/upgrade packages as soon as I get to CL for the first time. Then installed GNOME. (ubuntu-desktop) variant.

Other than that, it’s a blank canvas. Then proceed to install LAMP stack. Using LinuxBabe instructions for reference. Move on to Nextcloud Installation. Also using LinuxBabe instructions. I should note the instructions work flawlessly when using default locations listed in the instructions. (/var/www & /var/www/nextcloud etc.)

Trying to change the “data” directory to the RAID is not as simple as it “should” be. So I feel I am missing something. First issue was that the nextcloud web interface during initial setup would kick back a message saying it couldn’t access the directory of my choosing (RAID). I had set www-data as the owner:group for the RAID itself, not just a folder within. Well technically I tried both, after a folder didn’t work I tried just giving the whole partition to www-data. No luck. I changed the directory in every .conf file. Apache, PHP, Nextcloud etc. to no avail. At one point in doing so, I lost the browser installation interface to a 403 forbidden error. Even though ports 80 and 443 where set the same as previous attempts that worked.

So, if someone who’s well versed could maybe explain it like I’m 5, because I’m missing something, and it’s most likely something simple. I hope. I can include links to the two install instructions at the bottom that I followed if it helps at all. Any help is appreciated.

LAMP Stack Instructions:

Nextcloud Instructions:

Ideally, don’t install a desktop on your server.

The ONLY steps you need to do for this are:

  1. Mount your filesystem e.g. /mnt/raid
  2. Create your data folder on it e.g. /mnt/raid/nextcloud-data
  3. Chown it to the user your web server runs as (on Ubuntu this is www-data:www-data)
  4. Set it as the data folder path when setting up Nextcloud

Under NO CIRCUMSTANCES change any permissions on/under the data folder from this point forward.

Also quite often this kind of problem is the result of “trying too hard” and changing stuff that shouldn’t be changed when the answer is something simple like a typo or a skipped step. What you described above should have worked, so I suspect there’s some other detail that’s out of place.

Why don’t you try this again doing only what was described above, and if you get to the NC setup wizard and it won’t work, stop there and post some info. Don’t change any config files or permissions or move anything else. Show the output of ‘mount’ and ‘ls -l’ of your data folder path and a screenshot of the error.

1 Like

Thank you for the detailed response. I will try your method and report back!

The reason for GNOME installation is for 2 reasons. 1: It helps ease the learning curve a bit when I’m stuck. (Still learning the ropes with CL, although I have “cheat sheets” hanging all over ha) I started “learning” on a VM install to play around and break for fun but found that I was having trouble retaining the information without a practical use/application of the commands. Having to use CL to actually get results in a real working environment has helped me retain the commands and functions. 2: the machine will primarily house a large amount of images and it’s made navigating through them much easier. However, I do understand that the general consensus is to not have desktop on server. Just curious, why is that the case? I genuinely do not know.

It worked! Thank you again. Funny enough, I kind of answered my own question as to why you shouldn’t have desktop as well. I think I figured out why it didn’t work the first time, even though I did what you recommended. I feel this is worth mentioning for others having trouble, if it is not obvious. Due to having desktop installed, when I use “Disks” to mount my RAID for the first time, by default, GNOME placed the mount point in my users media folder and even though I created a folder for “nextcloud-data” with www-data having ownership, the parent folder was owned by me (user) and not root. Even having changed ownership after the fact, I was still getting errors.

Either way, thank you for ridding me of a 3 week headache.

You’ll get different answers as to why you don’t want a desktop on your server. The most common one being attack surface. The less code is running on your server, the more secure it’ll be. It also uses resources unnecessarily. The general consensus among server admins is that the GUI interface is simply not needed.

And, as you have discovered, the desktop environment changes the way certain things are done where the desktop software may handle things in a “non-server” way. Another good example is configuration of your network interfaces. On Ubuntu Server this is done with netplan whereas the GUI uses a completely different method.

So having the GUI installed will also cause you confusion as all the guides are written for a CLI-only server and you’ll run across things such as the disk mounting that are just not handled the same way.

1 Like