Adventures in Nextcloud

Setup:

Nextcloud host computerOld laptop
File hostSynology DS920s NAS (Hades)
External host (for updating my IP address)Cloudflare account (free) Domain registered through cloudflare
Internet gigabit fiber connection.
RouterSynology RT6600ax

 

The plan: 

I want to replace google cloud with a self hosted version that lives in my office. Specifically, to be able to access my files , calendar, notes, and information from anywhere including a web page. 

The setup:

I have an existing synology NAS that I want to host the files upon. An old laptop (I5 processor) that I want to use for the software, these sit behind a synology router, which in turn sits behind an AT&T router that is apparently necessary for my fiber internet service. My internet speed is 1Gb up and down. 

 

 

Considerations:

Router: Needs to be able to do port forwarding and DCHP reservations. Most do but some are trying way too hard to protect you from getting anything done. Forward the ports 80 and 443 to the computer running nextcloud. 

AT&T router: If you have one, if not this paragraph can be ignored. if you have an internet service that insists on using its router and you have your router behind the service providers router, even though you probably have the providers router configured to hand over all traffic to your router, you’ll probably have to configure the port forwarding there as well. I had this issue with my AT&T service. The router is set for IP passthrough in favor of my personal router but I still needed to go to the NAT/Gaming section and add all the ports I have forwarded in my network to the synology router individually. For the Nextcloud setup that was forwarding the Apache tcp and udp ports 80 and 443 to they synology router.

Storage:  I’m hitting just over 10Tb in files hosted on Google. So to replace this, I’ll need at least 10Tb of hard disk space. Hence not using the laptop drive for storing my files and instead using my NAS. 

 

Domain Name: In order to be able to use a web browser from outside the home I either need to write a script that constantly updates my IP address and then type in said IP address every time I want to connect, or I need a domain name. Domain name seems the best choice here. Having an domain name will also help with any software I install to upload or download files automatically for instance the way google drive works.  

Cloudflare to the rescue:  Not only does cloudflare allow registering a domain name, but it has the back end to update the IP address that said domain is hosted on. As Nextcloud will be hosted on a laptop in the office, this should really help.  

Step one was setting up a free cloudflare account. I did learn not to use “log in with Google” while setting up the account. At the time of this writing, you can’t get to all the user account details with that log in method. So, email and password is the way to go. Set up a free account, done. 

Step two, register a domain name. You can use any name that is available, so may as well get creative. Let’s use suckit.net as the domain name of choice. This will cost a couple bucks, but way less than upgrading the space on google drive. 

Step three, setting up the DNS records for your shiny new domain. This menu lives under your domain section (Domain Registration, Manage domains, manage, Update DNS configuration ) in the cloudflare site.

First record: type: A, Name: suckit.net, Content: 192.168.1.1 (whatever your external IP is) Proxy Status: DNS only, TTL: Auto

Second record: Type: CNAME, Name: cloud (or whatever you want) Content: suckit.net, Proxy Status: DNS only, TTL: Auto

Third record: Type: CNAME, Name: www Content: suckit.net, Proxy Status: DNS only, TTL: Auto

API Token: Next create an API token. This is under user, profile, API . Select custom token and fill with the following :

These are all dropdowns

Zone:DNS Settings:Edit

Zone:Zone settings:Read

Zone:Zone:read

Zone: DNS: Edit

Then lastly under Zone resources

Include: All zones

Once done, view the API token and save it somewhere. It will be hard to find again later and we’ll need it later. 

 

 

Setting up the laptop: