this post was submitted on 12 Mar 2024
26 points (88.2% liked)

Selfhosted

39435 readers
3 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

TL,DR: beginner tries to set up NextCloud via docker components without having a domain. Trying to access via IP doesn’t work. Probably made a few mistakes/missed some important stuff along the way

Hi everyone,

I am completely new to self hosting. Like many others I want to move away from Google, Apple, Microsoft... for my Calendar, Tasks and Contacts, and I thought I would try self hosting all that in NextCloud. I have already tried a 3rd-party hosted NextCloud instance and I feel comfortable with it, so now I want to do the next step and host it myself on a RaspBerry Pi 4 (4GB) that I recently purchased.

I have read around and searched for tutorials, and although I am still a bit lost I decided I would start working on it and see what problems I find along the way, and learn from this. Once I’m done I hope to have learned properly, and I plan to wipe everything and do it again, this time knowing better what I’m doing.

So, to begin with I decided to do it using Docker Compose, as I’ve read it makes setup and troubleshooting easier. I found 2 tutorials that looked good to me: tutorial 1 and tutorial 2, but going through them I see the most frequent case they require that I have my own domain (tutorial 1 has only that option, tutorial 2 offers that option or using an IP address). Do I need to have my own domain to have NextCloud calendar, tasks and contacts shared between my computer and my smartphone? If both options are possible, is one of them more secure than the other? is there some strong reason to avoid one of them?

Since I don’t have a domain (I’m completely new to this), I opted to try tutorial 2 with IP address, but I got stuck in the end, where I am supposed to access my NextCloud Web Interface. Tutorial 2 suggests getting my Raspberry Pi IP address with hostname -I (step 17), but this way I get five different IP addresses (4 IPv4 and one IPv6), not just one. When I try any of those IPs on a browser (step 18) none of them work. I guess I am missing something basic here, so I’d be grateful if someone can point me in the right direction.

Searching for an answer I found a comment on reddit saying that I can skip getting a domain and host locally (no domain) and set up a VPN.

Would it be necessary in my case to get a domain? If I skip the domain, what steps am I missing to be able to access my current NextCloud docker installation? What mistakes have I made so far, and what resources can I use to learn about what I’m missing? Do you have any other tips for an absolute beginner (who is comfortable around the linux command line)?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 4 points 8 months ago (1 children)

At a glance your first issue is finding the correct ip address, you should only have one local ip address to access it with (inside your home network).

To find your local ip, type “ip a” into the terminal, and look for the address under “eth0“ for a wired connection, or “wlan0” for wireless. This will allow you to connect using the ip and port while on your home network to test the connection and make sure it works right.

After that, I highly recommend the vpn option, it will simplify connecting to it while not at home without creating security issues like setting it up with a domain. I personally use zerotier, that guide will help you get it set up on the raspberry pi. Not the last bit about a “managed ip.” That will be the address to tell your phone to connect too once you have the vpn set up on the phone as well.

[–] [email protected] 2 points 8 months ago* (last edited 8 months ago) (2 children)

Thank you, the ip a command helped me get the IP clear, however I am still not sure about the port. I tried with :80, :8080 and :443 (because 80 and 443 are the ones mentioned in the compose.yaml file, and I saw online that 8080 is also a common one?) but none of them worked :(.

I think I will try zerotier, but first I need to be able to access NextCloud from my home network via the IP, which I'm currently unable to do. The tutorial I followed says

The other option is to use a self-signed certificate. This certificate is signed by your own server and won’t be verifiable by any web browser unless you manually install the certificate.

However, it doesn't explain where that certificate will be stored nor how I can manually install it in the browser I want to use to access NextCloud. Could that help with my issue?

[–] [email protected] 1 points 8 months ago* (last edited 8 months ago) (1 children)

You would be given a safety risk warning page by your browser if you did the self signed certificate that you’d need to tell it to connect anyway, so that likely isn’t the issue. Looking at ports, how are you trying to connect to the server? If you did not assign a certificate at all, you would want to use port 80, port 443 if you did install a certificate.

For instance, my Nextcloud is on ip 192.168.50.30 With that in mind I would be using:

No certificate: http://192.168.50.30:80 Certificate: https://192.168.50.30:443

Does this look like what you are typing in?

As two additional questions, what is the output of “docker container ls” typed into the terminal? And what operating system did you install on the pi, was it raspbian?

[–] [email protected] 3 points 8 months ago (2 children)

Thanks for your answer. I am indeed getting no warning on my browser, just "Unable to connect" on LibreWolf and "This site can't be reached" on Chromium. I tried the same format (https://192.168.50.30:80) with ports 80, 8080 and 443. The only difference is it was always https:// (since I think my browsers are configured to force https everywhere).

The out put of docker container ls looks like this:

CONTAINER ID   IMAGE              COMMAND                  CREATED        STATUS                                  PORTS     NAMES
95a71b3ce4f6   nextcloud:apache   "/entrypoint.sh apac…"   24 hours ago   Restarting (1) 30 seconds ago                     nextcloud-app-1
590b07333fa1   nextcloud:apache   "/cron.sh"               24 hours ago   Restarting (1) Less than a second ago             nextcloud-cron-1
337fd48a72e8   nextcloud-proxy    "/app/docker-entrypo…"   24 hours ago   Restarting (1) 17 seconds ago                     nextcloud-proxy-1
401d57a50ec8   mariadb:10.6       "docker-entrypoint.s…"   24 hours ago   Restarting (1) 57 seconds ago                     nextcloud-db-1
c6093edc9f71   redis:alpine       "docker-entrypoint.s…"   24 hours ago   Restarting (1) 9 seconds ago                      nextcloud-redis-1

I notice that the "PORTS" column is empty. I am running Raspbian GNU/Linux 11 (bullseye) on my Raspberry Pi, yes.

[–] [email protected] 1 points 8 months ago (1 children)

We can get the port list another way. From the terminal on the raspberry pi run the command "nmap localhost". Let us know what that shows, but I would expect to see either 80, 443, or both.

As a side note, if you did not give the nextcloud container a certificate when you made it, you cannot use https:// on the browser, as it has no way to talk using that security mechanism. It is only capable in that case of using http:// and port 80. You will need to disable forced https to access the site (this is fine on the local network if every device is trusted, and only encrypted vpn service in like zerotier is used imo). This might be your problem here, especially if you are seeing both ports listed as open on the pi.

[–] [email protected] 1 points 8 months ago (1 children)

Thank you for this new tip, I think we found the problem: ports 80 and 443 are not open. After I installed nmap (which was surprisingly not present in my Raspbian installation), the output of nmap localhost reads:

Not shown: 997 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
53/tcp  open  domain
631/tcp open  ipp

I guess I did something wrong when following the tutorial (or the tutorial had some mistake, but I'd me more inclined to think the mistake was mine). I will try to clear this installation on docker and start all over again, then I will check nmap localhost again to see if it works fine then.

Thank you very much for your support. I still feel quite lost, but I finally found out why this is not working and I can repeat the steps and pay special attention... or look for a different method (someone here suggested using Nextcloud All-In-One).

[–] [email protected] 1 points 8 months ago

Glad we got to the root issue! As others have said this is a learning process and you picked one of the more complicated ones to start with. Once this is done e everything else will start to feel much easier!

[–] [email protected] 1 points 8 months ago

If you are on the raspberry pi with a physical screen/keyboard and mouse you can also try accessing with the ip address "localhost:80" and see if there's a connection that way as well.

[–] [email protected] 1 points 8 months ago

You have to use https, so something like https://192.168.100.40:443 or without port like https://192.168.100.40

I use LSIO docker containers Nextcloud and MariaDB, but I've seen most recommendations for Nextcloud AIO