This is a companion post to my latest video: How To Install Nextcloud (The EASY Way) which was sponsored by Linode.
A few notes:
- I'm going to assume you've got some kind of Linux box, here. Whether it's a Linode VPS or local hardware, it doesn't matter. You can get a free $20 Linode credit and support my work here.
- This tutorial is geared towards Ubuntu 18.10, but it should work on just about any distro that supports Snap packages.
- I'm running these commands as the root user. If you don't want to run as root, use
sudo before each command.
- If you’re running your server locally, you’ll probably need to enable port forwarding on port
443 on your router in order to be able to access your server from outside your home network. That’s outside to scope of this tutorial, but a quick search of “how to enable port fowarding [router model]” and you should be good to go.
snap install nextcloud
This is the first command you’ll want to run. This just installs the prepackaged Nextcloud Snap image. It contains EVERYTHING you need. From the web server, MYSQL server, even Lets Encrypt’s certificate installation.
snap start nextcloud
This command enables Nextcloud on your machine.
Now, you'll want to fire up the old web browser and type in your IP address. If you’re on Linode, you’ll find your IP address in your Linode manager. If you’re running Nextcloud on your local machine, you can type in
localhost into the address bar. If it's on another machine on your network, you'll need to use its local IP (or if you've configured port forwarding, your WAN IP address).
When the page loads, you’ll be prompted to create an admin account. It can be your account or it can be something like “admin.” Ensure you use a secure password!
So now you have Nextcloud set up! Congrats!
Now you’ll want to point a domain name at your IP address. HOW you do this can vary by registrar. I actually want to point a SUBdomain at my instance, so I add an A record to my DNS configuration on Godaddy.
Depending on which registrar you’ve gone through for your domain, you can do a search how to change your IP address for your domain or subdomain. Most registrars worth their salt will have documentation on this very subject.
Okay, once that’s all configured, you’ll want to make sure Nextcloud expects to be accessed by that domain name. So use
nano or another text editor to edit
Find the line that reads
trusted_domains (and modify the
array() that follows it). You'll want to make sure it looks something like this:
'trusted_domains' = array(
0 => '188.8.131.52',
1 => 'exampledomain.com',
184.108.40.206 is your WAN IP address and
exampledomain.com is your Domain Name.
Don’t change anything else. Save your work. If you’re using nano, hit
Control-X, then hit ‘y’ and press enter.
Finally, you’ll want to set up SSL encryption to protect your traffic from man in the middle attacks. Go ahead and run the command:
Type in your email address and the domain name. It will take a moment and get you fully configured.
Finally, go to your domain in a browser, log in, and you’re done! Congrats!
You can set up the Nextcloud Android app on your phone and start syncing photos or start messing around with Nextcloud apps (which is a video that I’ll be making shortly).
So, I wanted to take a moment and thank the video’s sponsor, Linode.
They offer a 40Gbps data-center-grade connection, as well as 24/7 availability with a 99.9% up-time, automatic redundancy options for backing up your server, and not mention, peace of mind knowing that your VPS is secure and private to you and you alone. Linode truly is a fantastic company and I’m gratified to be working with them again.
If you want to support the show and get a free $20 credit, click that link and sign up today.