Self hosted cloud server?

Here’s where I’m at now.

I managed to get PiHole installed into a Docker container but could not get it to run because of the port 80 conflict with NextCloud as expected.

I decided to follow the instructions on the NextCloud GitHub page to change the port of the NextCloud interface.

That worked and I am still able to connect to NextCloud by adding the port suffix to the IP.

I am now able to start PiHole, login to the web interface and set it up.

The next problem I ran into was setting the DNS on my router to the PiHole IP. It seemed to be working for a few minutes until the router “broke”. It didn’t like what I had done and decided to reset its IP range back to the default, which didn’t work with the DHCP reservations I had setup. This was real fun because my 8 year old started crying because YouTube stopped working and my wife started to panic that she wouldn’t be able to work the next day because the internet was down. I had to spend the next hour getting the router set back up so it works again.
Turns out, I put the PiHole IP into the wrong DNS setting in the router. After some research, I found it has to be put in under the DHCP server settings, not the WAN settings where I put it. I guess I will try again this evening and hope it works this time.

I also learned it is a good idea to make a backup of the router settings so that it can be restored quickly if needed!!!

Hopefully logging this experiment will be useful to someone else out there.

1 Like

You are doing a great job @DadTheTinkerFairy!
When you install NextCloud, it comes with the initial option to use the MySQLlite version, which works nicely for a single user, but can get loaded up rather quickly if you try it with more users or more devices.
The trick here is to link the bigger and more reliable MariaDB (database) to NextCloud. Once you get there, you’ll have a much more reliable system.

I’m working on getting my own Umbrel on raspberry pi set up now. It was easy as, well, pi . It’s been busy for a few days downloading the bitcoin core (seems to run without much work on my part).

I had installed NextCloud, but then the password stopped working. I was able to access Umbrel on my phone and uninstalled NextCloud from the pi; that seemed to work okay, but then the Umbrel password stopped working (had it written down and saved in my password manager, so not sure what happened). According to Umbrel’s troubleshooting guide, I should just let it complete the bitcoin core download (which will land on my ssd drive and be safe into the future), and then I can reflash the sd card and reinstall. Since I have no coins in my wallet and no NextCloud data to worry about, I should be fine. My raspberry pi is whirling and working like crazy, so I’ll wait until it calms down (since I have no way to verify since I can’t seem to sign into it anywhere) But I’m concerned that I’ll lose information in the future if this happens again. Thoughts?

Nextcloud will never lose your information, no matter what. It stores everything inside a specific folder structure, which varies - depending on how you installed it. There are several ways for the installation, like docker, Snap, repository, etc.

The best way to detect where your files are, is to keep note of a uniquely named file or folder. Then, install the indexing app on your Pi, by executing:

sudo apt install mlocate
sudo updatedb

So, if anything happens, you can always find your file (and everything around it) by executing the command:

locate <file>

It will give you the folder that file is in, so you can navigate with your file manager and pull everything out. Just remember this: if your file has spaces in it, enclose it in quotation marks.

Thanks so much, @vasileios!

I’ve got the btc node all downloaded (took over a week) and it’s humming along - I’d changed the password on Umbrel and was typing it in wrong (it’s veeeerrrryy long), but got that all sorted.

When I reinstalled Nextcloud, it gave me the same password as before, which makes sense with what you describe. However, now I’m getting a different error (see attached photo). I can’t even get to the point where I input my password. I found instructions in the NC manual, but I don’t know where to type anything in.

Do I pull up terminal on my MacBook? There’s no terminal in Umbrel that I can find. Is there a way to see the pi and the ssd in terminal on my computer? (On the plus side, I’ve been playing with terminal on the laptop and at least the basic commands are the same as in Linux, so I’m still learning.)

Thank you!

PS I installed NC via the app store in Umbrel.

I found Lightning Shell in Umbrel’s app store and am installing it now. This should give me the ability to type in commands in Umbrel and fix NextCloud, right?

Hey @Persephone!
I finally reached close to my deadline (always gets tough near the end), so I had the opportunity to look some things up for you.

The trusted domains problem can be resolved within NextCloud’s configuration file. First, you’ll need to find where NextCloud is installed. You can do that by looking for the folder itself:

locate nextcloud

Keep a note of the NextCloud directory. Let’s call it (for expediency) NextCloud_Folder.
Then, we’ll need to find the config.php inside that folder. However, if you use the locate command to seek that file, it will produce dozens, if not hundreds of results. That’s why I suggested you note down (copy) the folder name. We can use this to filter the results:

locate config.php | grep NextCloud_Folder

Replace the NextCloud_Folder with the folder you noted earlier. This will limit the output of only the config.php file that is inside the NextCloud directory.
The next step is to identify your IP range:

netstat -r

If the command is not there, you’ll need to install net-tools. If you’re on a Debian/Ubuntu based distro, the command is:

sudo apt install net-tools

The netstat command will give you the IP address of your router. For convenience, let’s say that the IP address is 192.168.1.1. This means that your subnet is 192.168.1.0/24.
Now that you have the location of the config.php file, it’s time to edit it:

sudo nano </path/to/config.php>

Remember to replace the “path/to/” with the complete folder structure. When you enter nano, you can navigate with your keyboard’s arrow keys.
Then, look for the ** trusted_domains** section. Each address it has (or name) is in a form of a numbered list like the example below:

'trusted_domains' =>
  array (
   0 => 'localhost',
   1 => 'server1.example.com',
   2 => '192.168.1.50',
   3 => '[fe80::1:50]',
),

Add an extra number just like the example and after the => input:

'192.168.1.0/24',

And replace the IP above with the one your router has. Then hit CTRL+O and then Enter to save. Press CTRL+X to exit.
Once done, you will need to restart your NextCloud system so that it reads the new configuration file.

I hope this helps!

Thank you, @vasileios. I’m glad to hear you’re knocking that deadline out. It always feels good to achieve a goal!

The ‘locate’ command didn’t work, but I was able to drill down through the directories on the raspi and find nextcloud. Then I drilled down some more and found the config.php file, but when I run a ‘more’ command, it tells me I don’t have permission to open the file. Is there a way around this?

1 Like

Bravo on finding the file! It’s an elusive one that took me a while to find on my docker deployment.

Some files (or even directories) have elevated privilege requirements. So, if you execute:

sudo su

You will become root and will gain access to it. :slight_smile:

:rofl: I just did sudo su and laughed out loud.

I try to find a connection between the commands and English to hang them on hooks that are already in my mind - so cd is change directory, ls is obviously list and ls -al is list all of it.

I’m not sure yet what ‘sudo’ means, but the last part of the command became SuperUser - think of a superhero in The Incredibles (‘No capes!’ ~Edna Mode). That command is like Clark Kent’s phone booth, turning me into a superhero.

Then I saw the warning that came up and the last one was too funny! I am a superhero!!!

Okay, @vasileios, I checked my Airport Utility and got my router address.

When I looked under trusted domains in config.php and tried one of them on my phone, it worked (ooh rah!). However, I’m at home and am not sure it’ll work when I’m not here (I installed Tailscale, but one step at a time).

But using a trusted domain (one that’s already listed) isn’t working on my laptop. I’m getting this error:

Parse error: syntax error, unexpected integer “4”, expecting “)” in /var/www/html/config/config.php on line 36

Edited to add:

How do I restart my NextCloud system?

Hey @Persephone!
What you basically need is to identify your gateway. Then, keep the three first numbers the same as the gateway and then replace the last with a zero. So, if your gateway is i.e. 192.168.1.1 then your entire subnet is 192.168.1.0/24. Naturally, there is also the subnet IP, which is basically a mask (like 255.255.255.0 or 255.255.0.0). You can ignore that.

If you still get an error, like the one you described, then all you need to do is identify the IP address of your NextCloud computer and use that one instead of the one with the .0/24. I only recommended that in case your router re-assigns IP addresses (some do on restart, others on factory-reset).

To find your local IP (the system that runs NextCloud), use:

ip r | grep default

Then add it to the trusted domains inside the config.php. Remember to remove the /24 line.

To get NextCloud to utilize the new settings, basically restart your server.

Thanks, @vasileios! So far, so good. I just got back from a short trip and am tackling this again. I’ve added lots of different addresses to the trusted domains list (from TailScale and any that I can find that seem to be associated with my devices; I figure the more the merrier and it’s better to have too many than too few). Still not working. This time, the error message is

syntax error, unexpected integer "4", expecting ")" in /var/www/html/config/config.php on line 36

It seems to be expecting the list of trusted domains to end after #3 and is looking for that closing parenthesis (which is down a few lines after the ones I added). Is this something that I can fix elsewhere in config.php?

This error happens on all my devices and in Tor.

Update: I saw the commas in the video after each of the trusted domains, so I added them to all but the last entry and the error I had went away. Now to sort out the domains themselves.

It’s slow, but I’m in no hurry and having to sign in and get to where I need to go over and over and open and edit the file is good practice and is setting the commands into my mind better than if I’d just tried to brute force memorize them, so it’s all good. Thanks for the workshop today!

Update #2: IT’S WORKING!!!

I still need to figure out how to make it secure, but it’s working on both my phone and my laptop. Glory!!!

1 Like

Bravo, @Persephone!
I just ran my first, fully successful test on setting up NextCloud for our next LMS course too. Now it’s the stage for the fine-tuning.

It doesn’t rely on Snaps or any installation script. It’s based on the new Debian 11.3 distro under KDE, so that it gives a graphic user environment for easier changes to configurations. Also, it utilizes the fast and lightweight NGINX (EngineX) as its web server, PHP, MariaDB (the full MySQL for multiple devices and users), and the direct deployment from NextCloud. It also has its self-issued SSL for encrypted transfer.

However, for the time being, I have it confined within a local network - as I don’t want people to place it out on the Internet and risk hacking. At least not until everyone becomes familiarized with cybersecurity. Even if someone wants to take it online, it’s just a few steps in the configuration process.