0% found this document useful (0 votes)
26 views18 pages

How To Install Next Cloud

Uploaded by

Ali Alasfoor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views18 pages

How To Install Next Cloud

Uploaded by

Ali Alasfoor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Chapter 1: Infrastructure Setup

1.1 Setting up DNS and Gateway IP Address for TrueNAS

1.2 Assigning IP Address to TrueNAS

1.3 Installation of Nextcloud

1.4 Configuring Storage Location for Nextcloud

Chapter 2: Configuring Nextcloud

2.1 Accessing the Nextcloud Management Page

2.2 Resolving Initial Error Encountered

Chapter 3: Enabling Remote Access

3.1 Setting up a Domain Name with DuckDNS

3.2 Updating Public IP Address using Cron Jobs

3.3 Configuring Port Forwarding on the Router

Chapter 4: Enhancing Cloud Security

4.1 Installing and Enabling Encryption on Nginx

4.2 Configuring Nginx for SSL/TLS

4.3 Encrypting Communication between Users and Nextcloud Server

4.4 Resolving "Too Many Redirections" Issue

4.5 Modifying Nextcloud Configuration File

4.6 Renewing SSL Certificates with Cron Jobs

4.7 Accessing Nextcloud from Anywhere on the Internet

I will explain the process of building our own cloud using Nextcloud on TrueNAS.

installing Nextcloud on TrueNAS is the solution we will explore, for overcome hard drive failure and data
loss
Chapter 1: Infrastructure Setup

setting up DNS and Gateway IP Address for TrueNAS


First, we need to set up the DNS and gateway IP address for TrueNAS.

This step is crucial to avoid any errors during the installation of Nextcloud.

Assigning IP Address to TrueNAS


I assigned the IP address 192.168.1.28 to my TrueNAS.
Installation of Nextcloud
Click on the plugins option in the left menu and select the storage location for Nextcloud.

In my example, I chose "Pool1" as the storage location and named it "Vol1" for easy reference.

To assign a private IP address to Nextcloud, choose DHCP and uncheck NAT.

Chapter 2: Configuring Nextcloud


Once Nextcloud is installed, we need to configure it for full functionality.
Accessing the Nextcloud Management Page
Access the management page by clicking on the manager or entering the IP address of Nextcloud in any
web browser.

we encounter an error Access though untrusted domain at this stage, we will address it next.

Resolving Initial Error Encountered


Click on "Jails" in the left menu to open the command window for Nextcloud. Edit the Nextcloud
configuration file using the "ee" command as shown below
Within the configuration file, we locate the trusted domain block and make the necessary modifications.
In my case, I allowed access from all addresses and domains by adding the asterisk character(*). Save
the changes by pressing the Esc key.

The error message should now be resolved.


Changing default admin password

Nextcloud generates a random password during installation, but I recommend changing it to a more
secure and memorable password to protect data.
Chapter 3: Enabling Remote Access
Currently, Nextcloud can only be accessed within our local network. To make it accessible from
anywhere on the internet, we need to set up a domain name and configure port forwarding.

Setting up a Domain Name with DuckDNS


assign a domain name to Nextcloud using DuckDNS.

In my example, I created the domain name "psauproject.duckdns.org". Make a note of this domain for
the upcoming steps.

Updating Public IP Address using Cron Jobs


To automatically update the public IP address on your TrueNAS, we'll use Cron Jobs. Follow the
instructions on the DuckDNS website and copy-paste the provided command.
We Choose "nobody" as instructed. we can customize the update schedule based on our preference,
whether it's hourly, daily, weekly, or monthly. For now, let's choose "run now".

Configuring Port Forwarding on the Router


However, updating the public IP address alone won't enable access to Nextcloud from the internet. We
also need to forward the necessary ports on your router.

In this case, Nextcloud's IP address is 192.168.1.34.

Forward Ports on the Nokia G-240W-B Router

Most routers support port forwarding. Start by forwarding port 80 to the IP address 192.168.1.34, and
then do the same for port 443.
Accessing Nextcloud from Anywhere on the Internet
After obtaining the domain name and configuring port forwarding, we can now access your Nextcloud
from anywhere on the internet.

We have successfully setting up the private cloud with TrueNAS and Nextcloud.

Chapter 4: Enhancing Cloud Security

I've successfully setting up a private cloud with TrueNAS. Now, let's take the next steps to enhance the
security of your cloud.

Installing and Enabling Encryption on Nginx


To begin, open the Nextcloud configuration command window. Since Nextcloud uses Nginx, we'll focus
on installing and enabling encryption on Nginx.
Next, we fill in all the required information, starting with the email address. When prompted, we choose
"Yes" for the first choice and "No" for the second choice. After completing these steps, we 'll have the
necessary files but will need to configure Nginx to use them.
Configuring Nginx for SSL/TLS
We Open the Nginx config file and edit it, replacing occurrences of "truenas" with our domain name.
(psauproject.duckdns.org) we Make sure to replace it in all three lines. Once done, restart Nginx.
To ensure the configuration is applied, we restarted Nextcloud as well.

To verify if the changes have taken effect, we refresh the web browser or open a new tab. If it's still not
working, try using a different web browser. For example, Google Chrome often works well. You can also
test it with Microsoft Edge.

Resolving Initial Error Encountered


After installing Nextcloud on TrueNAS and obtaining an SSL certificate from. However, we are
experiencing an issue where we can't access our fully qualified domain name (FQDN) and encounter the
error of too many redirections.
The problem arises because the Nextcloud plugin decided to make some changes to the
Nextcloud.config file, which conflicts with the SSL Mod settings.

To fix this issue we have done the following

Modifying Nextcloud Configuration File


first, we access the jail by going to the shell command within the jail.

Once you're inside the jail, we need to open the Nextcloud.config file located at
/usr/local/etc/nginx/config.d/nextcloud.config.

Now, let's address the issue. The problem lies in having duplicated "listen" and "server_name"
directives, which creates an infinite loop resulting in the "too many redirections" error

To fix this, we can either remove the entire duplicated lines or simply comment them out by adding a
"#" in front of each line. Additionally, we will need to combine the two server settings into one by
deleting the duplicate "server" block.
Once we have made the necessary changes, we saved the file and exit the editor.

Now, we need to restart the Nginx server to apply the changes. Run the command service nginx restart
in the shell or terminal.

Resolving "Too Many Redirections" Issue


now refresh Nextcloud page, we should be able to access it without the "too many redirections" error.

Accessing Nextcloud from Anywhere on the Internet


Renewing SSL Certificates with Cron Jobs
By following these steps, we have successfully encrypted the communication between the users and the
Nextcloud server.

However, the certificates are valid for only 90 days, so it's important to schedule their auto-renewal.
Create a new cron job to handle the certificate renewal, with options for automatic renewal every hour,
day, week, or month.

We have successfully built your Nextcloud cloud. Now you can connect to Nextcloud from your
computer or smartphone. In this case, you tested it on a Windows computer.

You might also like