I have been messing around with a Raspberry Pi 4 with the goal of learning how to self host. I’m learning a lot but dynamic IP and DNS is tripping me up. It may be that what I want to do isn’t possible so I thought I’d ask the smart people here.
I would like to host Nextcloud, maybe try my hand at a matrix .org synapse server or a just a yuno host server etc. I have a domain with Namecheap, and a WordPress site on bluehost that uses that base domain. I would like to use sub-domains (I think that’s what they’re called ie. nextcloud.mydomain .com, matrix.mydomain .com) to access those self hosted instances on my Pi.
I’m not exactly sure of the steps/concepts to make that happen. I have a dynamic IP so I need to set up some dynamic DNS to track that I assume. Maybe set something up in Namecheap to direct to sub domains? Do I need to do port forwarding?
I can find information on individual sections of this problem but I’m having a difficult time stringing them all together for my use case. Anyone have any guides or pointers that could be provided? Any help is appreciated.Thank you
You can use ddclient with namecheap. They have page setup to do that.You will have to do port forwarding to the device and port you wish to use on the router you are using.
Its totally awesome that you are beginning the journey of self hosting. It is fun and rewarding to accomplish self hosting from home. Just be cautious when opening up ports at home and allowing traffic to flow in. Make sure your server is well hardened and you know what you are doing. If your server is compromised and not set properly, the attacker may have access to your local LAN. You need to have firewall rules that protect your Lan and its recommended to have your network segmented.
Some Tips to get you started.
Ipchicken.com --This will tell your current Wan IP.
DdClient --Available through most distros. Software that checks your current WAN IP and sends the IP to your DNS provider (NameCheap) When your IP changes at home, this will update your settings automatically.
Links to what you are looking for since you are using Namecheap
a. DDCLIENT set-up on Fedora for Namecheap - Make Gadgets Work A overall setup of ddcleint, the install of ddclient may vary depending on your distro
Tip for Namecheap:
Where it says Host, that is your subdomain name. For nextcloud.example.com you would put nextcloud.
Tip for DdClient:
The following is the format of the DDClient configuration:
password=your dynamic dns password
Where it says ‘yourhost’ you put the name of your subdomain. Example: nexcloud.example.com you would put nextcloud
Hope this gets you started.
Really appreciate the reply’s. I will start with these points and go from here.
@douhunt Does it matter where I host ddclient? I would by default put it on my Pi but does it have to be on the Pi?
Thanks for laying it out like you did. It makes me less wary about trying network stuff and doing something that gets me hacked.
@tenthousand Sorry for the late response. It does not matter which host you use it on, as long as its on the network from which you are hosting.
How’s your journey with self hosting going? I’m doing a similar thing. Just got wire guard up and running so that I can VPN into my local network. I want to get next cloud up and running next.
I actually have not progressed much further than this. I recently got a job among other things which has taken up my time.
I am hoping in the new year to restart my pursuit of self hosting.
I am trying to get some “study group” or “LUG” going I guess with people in the community. If you ever want to get together in the Mumble room, let me know and we can connect and maybe solve problems together!