Nextcloud Box Setup Guide
I ended up finding about the Nextcloud Box after searching for a alternative to Dropbox. I’m pretty pleased with the whole Box. It works well and I can sync between all devices just like I can with Dropbox, all without the recurring cost. This is a guide with how I setup my device.
Initial Setup #
You may be wondering where to put that SD card that came with your Nextcloud Box. It has to go in on the underside of the Raspberry PI 2.
First Boot #
On first boot, the Nextcloud Box will take about 8-10 minutes to install Ubuntu Core on the hard disk. When that is finished, you should be able to access it at ubuntu-standard.local
or ubuntu-standard.localdomain
or nextcloud.local
, if you have
Bonjour installed.
You’ll first need to go the browser at one of these addresses and create a user account before SSH-ing in.
SSH #
Otherwise, if you cannot find the local domain name, follow the rest of Step 1 in the connecting by SSH guide.
ssh ubuntu@nextcloud.local
You’ll be able to log in with the password ubuntu
. Make sure you change this password with the passwd
command after you SSH in.
Updating #
The version of Nextcloud box that I ordered utilizes
Nextcloud Snap with
Ubuntu Snap. It was incredibly easy to update. Run a refresh to update the whole nextcloud version. Upon writing this, it brought me from version 10.0.1
to 11.0.2
.
sudo snap refresh nextcloud
There is a bug sometimes where it won’t take your box off maintenance mode, and thus won’t allow you to go to your box through the browser. You can continue the upgrade process with the below commands. But normally, just a refresh should update everything.
sudo nextcloud.occ maintenance:mode --off
sudo nextcloud.occ upgrade
Connecting to the internet #
I ended up exposing the Nextcloud box to the internet by forwarding ports 80
and 443
on my router to the Box. I was then also able to access the web application by going to my
public ip.
To make life easier, I pointed a domain name I owned to my public facing IP, so that I could sign in from the domain name (using Cloudflare). I then added the domain name to the trusted domains of the Nextcloud box: [1]
sudo nextcloud.occ config:system:set trusted_domains 2 --value=your.domain.com
Enabling HTTPS #
We can then go ahead and enable HTTPS with the following command:
sudo nextcloud.enable-https lets-encrypt
It won’t say that the certificate was successful, it will just say it’s done when it finishes with
certbot. You should now be able to go to your https://your.domain.com
and have it use TLS.
Using DDNS #
Since I’m using this behind a router, and my ISP is not always going to give me the same IP, I ended up utilizing this handy Cloudflare DDNS script.
git clone https://github.com/thatjpk/cloudflare-ddns.git ~/cloudflare
After going through the setup guide, I was able to successfully use cron (crontab -e
) to have it update the domain records every fifteen minutes.
*/15 * * * * /home/ubuntu/cloudflare/cloudflare_ddns.py /home/ubuntu/cloudflare/site_naked.yaml >> /home/ubuntu/cloudflare/logs/ddns_cloudflare.log