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)?
The domain makes proper security certificates for HTTPS much more usable and easy to manage.
The reason you are finding it hard to use IP only is because yiu have to disable certain security features ti make it work.
You can get a domain for $1 per year. I would highly suggest getting a domain and setting up a proper reverse proxy which will allow to to easily setup any service you want after that.
Nextcloud is also one of the harder things to setup.
You could start with something easier like a simple dokuwiki site as a test to get the reverse proxy and domain name part working.
There is a reason why this is the “correct” way to do this. It will make all future projects much easier.
Thank you for your answer. I will look into getting a domain, but I want to try to fight with this a bit more, mainly as a learning experience. I will also look for easier projects for a beginner, like the dokuwiki you recommended.
There’s free domains too. I can’t recommend any but I know .tk should be free.
You don’t need a domain. However it is probably a good idea.
- You can’t get a globally trusted SSL certificate for an IP address. So you will need to use a self-signed certificate and manage trusting it on every device.
- If you don’t have a stable IP you will need to update bookmarks whenever it changes and memorizing it may be a chore.
If you don’t want to purchase your own domain you can likely use a free subdomain, this will often come from a dynamic DNS provider.
However if you can I would strongly recommend getting your own domain sooner rather than later. If only because it means that you can own your email address which is basically the keys to all third-party services you use these days. Domains are pretty cheap, probably <$20/year for a generic like .com or the TLD of your country. Personally I would happy skip out on eating out once a year to have my domain.
Thank you for your reply. I think I will look into getting a domain, however I still want to try this, to use it as a learning experience. Try to make it work like this, then keep learning and probably switch to a domain, which seems to be the common thing.
If you don’t want to get a domain name perhaps you can go with Duck DNS then use Caddy for the reverse proxy to your NextCloud instance. Download the DuckDNS plugin for Caddy and set up DNS Challenge to have Caddy fetch a Let’s Encrypt cert for you and update it when needed.
You also have the option to point your DuckDNS domain name to a private IP address on your LAN if you need to.
The only bad part is that you have to type a long URL but you will also get a valid cert with a free domain.
This doesn’t help with your current issue, but you should use Nextcloud All-In-One instead of setting up individual containers like in the tutorials you linked. It will create and manage all the containers that are needed.
Domains are pretty cheap, so you may want to consider whether not using one is really worth the effort.
Thanks, the tip for Nextcloud All-In-One is actually a very good one. I want to try to make my current setup work, as I said mainly as a learning experience. But I will definitely consider that option once I’m done with this experiment. I guess I will also get a domain.
If you don’t want to buy a domain you can try a reverse DNS lookup, your ISP may already give you one. Mine was C-XX-XX-XX-XX.hsd1.pa.comcast.net and I could get a let’s encrypt certificate with that. I did end up buying a domain but it was good for personal use
There is also sslip.io which works for all addresses.
Can you reach the dockercontainer? i have used docker only once (without any Proxy settings )but i had to specify which ports from inside go to which on the outside, something like: “docker run --name docker-nginx -p 80:80 nginx” https://www.digitalocean.com/community/tutorials/how-to-run-nginx-in-a-docker-container-on-ubuntu-22-04
You don’t need a Own Domain, you can use a dynamic-dns-service to reach your server from everywhere, even if your ISP changes your ip. I use dedyn.io. (its free) here is a turtorial: https://desec.readthedocs.io/en/latest/dyndns/configure.html
Thanks for your reply. I am not sure about this. Following the tutorial I created a compose.yaml file that had proxy settings:
proxy: ports: - 80:80 - 443:443
so I would assume that already takes care of the ports?
I will have a look at dedyn.io and the tutorial you shared once I manage to reach NextCloud locally via the IP address. Thanks