Secure NEXTCLOUD with HTTPS - Domain name, DNS, and certificate

preview_player
Показать описание
A while ago, I showed the easiest way to get set up with a nextcloud instance, through snaps. Now it's time to make sure that instance is properly secured through HTTPS, so we'll see how to add that layer of security for the Nextcloud snap.

(USE OFFER CODE LINUXEXP19)

What I use to make my videos:

To get an SSL certificate, you'll need to grab a domain name. It's possible to add an https certificate to a bare IP address, but not all browsers will consider your website as secure, and might show warnings.

Once you bought your domain name, you have to register it with a DNS service. Think of DNS as the internet's phone book, where a domain name is linked to its associated IP address.

Most domain name registrars provide a DNS service and automatically register the domain name for you, however, they don't know your server's IP address, so we'll need to enter that ourselves.
To get your ip address, just type ifconfig in your server's console, or grab the IP address from your hosting service's dashboard. We could also change the other various records, that are linked to email services or subdomains, but I won't go into that level of detail here.

Either go to your registrar's dashboard to enter the IP address associated with the domain name, or use your hosting service interface to do the same. Here, I'll do it with Linode in the domains tab, since it already has all the information needed. I'll just type the domain name, the email address associated with it, and tell it to use the records from my Nextcloud server so that it can transfer all the needed information to the DNS service.

Enabling HTTPS for the nextcloud SNAP
Now, we'll log onto our server. i'll still use my Nextcloud box I set up in the last video.

By default Nextcloud only responds to requests made by the localhost hostname, so we'll have to set it up to make sure it can respond to requests made from the domain name or the IP address, so we'll type:

The nextcloud SNAP does not just ship Nextcloud: it ships the whole stack with the server, and a nextcloud instance running on top of it.
Thankfully, Nextcloud allows to generate a free certificate from let's encrypt.

First, we'll open the ports needed by let's encrypt to validate that you really own the domain name:

sudo ufw allow 80,443/tcp

Then, we'll ask let's encrypt to create a certificate for our domain name:

You'll have to accept the conditions, and then provide an email address for recovery operations.
Finally, you'll have to type the domain name for which you want to create a certificate.
If all goes well, your domain name is now electronically signed by let's encrypt. We can check that by going to our domain name, and look at the site's infos in our browser to check that everything is set up properly.

And now you're all set ! Your nextcloud instance is properly configured, and secured. in the next videos, we'll see how to configure Nextcloud, and add applications to it !
Рекомендации по теме
Комментарии
Автор

Did you set up your own Nextcloud instance ? Do you plan to ?

TheLinuxEXP
Автор

After completing the first part of this tutorial 48 hours ago: I just completed the steps above and got my https on a new cloud server with a new domain. Thank you SO much.

ChukwumaOnyeijeMD
Автор

I'm setting up my own Nextcloud on Linode using your code and following your videos. So far so good! Please continue.

billgross
Автор

These tutorials are great, I will be accessing them more often once I get my server up and running

HiMyNameIsColdguy
Автор

I've been pulling my hair out trying to get this working. I've installed docker on my own hardware, installed nextcloud in docker, installed mariadb in docker, got nextcloud working with mariadb. So far, so good...

All docs I'm finding online don't fit what I'm trying to do for let's encrypt.

The commands that you're typing... are those IN the running docker container for nextcloud? Or are they on the host? I tried both and when I'm in the terminal for my nextcloud container, sudo isn't available, nor is nextcloud.enable-https. When I'm on the host, sudo IS available, but not nextcloud.enable-https.

I presume I need to be IN the nextcloud container while doing this, because that's where the web server is and the let's encrypt docs seem to indicate it's making modifications to the web server.

I'm so confused and worn out. I'm about to throw my computer out the window.

csharpner
Автор

Damn this was easier than I was expecting, great content as always!

Naeidea
Автор

I nerd some help, I have set my nextcloud on a proxmox server, and I am getting the same issue, I don't have putty for my NextCloud, and I am really new to tech tho, so can you help me with that please. I did tried the same instructions a shell in proxmox and the output I got as.
-Bash: nextcloud.occ: command not found
Can you help me ?

saifanis
Автор

I got completely lost at 2:00
I have already registered a domain but it seems like you are giving most of this process a dry run without actually doing it and being vague about which ip address we should be using.

treloarw
Автор

hello..NextCloud does not have Domain, can open SSL for it .. thanks

thanhkhanhnguyen
Автор

I was eager to watch this. I'm going to implement something similar on a RasPi

juxuanu
Автор

The host name did not match any of the valid hosts for this certificate
i host my server and i have noip.com dns and i forword my ip.
is there is any solution to this _!

nayaart
Автор

I get an error when creating an https. I get "No valid IP addresses found for domainname"

TheCaptainRaiders
Автор

I signed the wrong domain! How can I remove that certificate ?

Berkshire-Hathaway
Автор

Can you do this after you installed Nextcloud?
Also, I already have a website. Can I add my Nextcloud to that domain?

RealMTBAddict
Автор

3:12 I hate this bug. Is there any way to get rid of?

ministerstein
Автор

4:06 anyone else getting a permission denied error?

diesel
Автор

This is what I do.
I have a sub domain nextcloud.domain.com
Nextcloud is in a docker container listening on port 8083

I'm currently working on transitioning to DNS-01 certs from lets encrypt and switching from the Synology nginx which is getting in my way to a docker nginx with macvlan networking so I can assign it a static IP as Synology's nginx reserves ports 80/443.

praetorxyn
Автор

I do not like that this is a paid method to a free solution.

georgei
Автор

there are so many developers, cant they make these steps gui based... which can be simpler for noobs like me😢

ManishKumar-vczg
Автор

I need things
So respond me
First. I need commands to install elemntary plus icons

Second how old can change elemntary file manger to natilus
Give me commands
I am on elemntary os 5.0 juno
Third. How I change super key to open application menu

abdallahtarek