Ubuntu Server and Nextcloud Problem


I purchased a Raspberry PI and installed Ubuntu Server on it and NextCloud. NextCloud was running good locally, but I want to be able to access my NextCloud over https and wanted to harden my server to protect it from outside access.

I had been accessing NextCloud locally by entering my servers IP address into the browser address bar.

I changed my server port from 22 to another port number and installed UFW firewall and blocked incoming traffic except on my port number, allowed outgoing traffic and allowed access over http and https and stopped response to ping requests. I followed a Youtube video on securing a Linux server to do this.

Now I can not access my NextCloud locally. I can ssh into my server fine so don’t know why I can not access NextCloud. I am not sure what happened other than my firewall settings are not letting me in but I am not sure what to do.

If someone can give me some help that would be great.

Hello @Shane!
Once you setup your NextCloud locally, you don’t need to alter any ports as - by default - it is not visible to the outside network (Internet). In order for it to become “exposed” you’ll have to create port forwarding on your router.
The connection for the files comes from SAMBA, which means that its port is most likely blocked when you changed the port and your firewall settings.