hello, welcome to NETVN channel
In this video I show you how to build your own private cloud server with much larger storage capacity than other free clouds like OneDrive GoogleDrive
In this example I have prepared a computer in three hard drives
A solid state drive for operating system installation
traditional hard drives left to store your cloud data
You can also install more hard drives to increase storage capacity if desired
The OS I use is dietpi
I use dietpi because it makes it easier for me to build a cloud server
and reduces a lot of the complicated commands I have to remember
First of all go to dietpi homepage and download the ISO file suitable for your computer
Here I choose UEFI
Next, you use a USB stick to create the dietpi installer
The tool used to create the dietpi installer is Rufus
After downloading the rufus tool, select the dietpi iso file and the USB stick
Then press start
It will take a few minutes to create the dietpi installer
Once you have the dietpi installer, plug the USB stick into the target computer
Don't forget to adjust the boot order to USB storage
To avoid confusion when installing, I only installed the solid state hard drive first into the computer
I will install 2 traditional hard drives later
The installation is quite simple, you just need to select the solid state drive you want to install dietpi on
and wait a few minutes to finish
After the installation is complete your computer will automatically power off
Then you will remove your usb stick
Next, you will change the boot order of your computer to a solid-state drive with the dietpi operating system installed
This is the result when your computer has finished booting
I recommend accessing from another computer on the same local network to make the installation easier
Username is root, ip address is 10.11.32.134 and password is dietpi
I recommend you skip this options to move on to the next settings
And the software installation screen appeared
The nextcloud app is a great choice to build a private cloud server
You can browse the list of software or type in the search box to find the nextcloud application
You use space key to select nextcloud application to install
You scroll to the bottom and select install to install the nextcloud application you just selected above
Nextcloud will take a few minutes to install please wait patiently
I'll fast forward so you don't have to wait any longer
Try to check if nextcloud is working or not
You open any browser enter the IP address slash and nextcloud
Username is admin
Password is dietpi
You can change your password if you want
Installing nextcloud is quite simple, right?
As you can see my cloud storage is 50gb
But for the purposes of this video, I want to increase my cloud storage even more
So I'm going to add two more traditional hard drives to increase the storage capacity
For that I will shutdown the target computer with the poweroff command
If you are having trouble accessing remotely via ssh
delete the file as above on your computer and make access again using ssh
You use the lsblk command to check if the target computer has detected two additional traditional hard drives
Here I have seen two additional hard drives,
sdb and sdc
Before using these two traditional hard drives
you need to delete all existing partitions on these two traditional hard drives
You use the fdisk command to do this, command d to delete partitions
For sdb hard drive there are 3 partitions so I will delete 3 times
You then use the w command to save the changes
Next I will merge these two traditional hard drives into a single partition
For that I will install lvm
You use the command apt install lvm2
Next you create a physical volume with two traditional hard drives
Something went wrong with the sdc hard drive
because I haven't deleted the old partitions on it
We will use the fdisk command to delete the partitions on the sdc hard drive
Don't forget to use the w command to save the changes
As you can see the error no longer occurs
Next you create a volume group for two traditional hard drives
and name it vg0
As you can see the capacity after pooling is about 930 GB
You can merge more hard drives if your computer can install more hard drives than this
Now I will create a logical volume with all the free space above
You do the above command this volume is called cloud and uses 100% of the free space
of vg0
After creating the logical volume I will format it as ext4
Now you need to mount it in a directory to use for your cloud
To do that you need the uuid information of the logical volume you just created
blkid command will get you UUID information
Please write down this information to use in the next step
I will create a new folder named the cloud and will Mount the new logical volume created in the previous step to it
You add a line in the fstab file to create the desired mount
The information includes the uuid you just obtained in the previous step
Path to the folder named cloud you just created and format ext4
For this example the line to add should look like this
Next use the df -h command to check the results
Next you use the command mount -a to mount
Next use the df -h command to check the results
So I have successfully merge two traditional hard drives into one
Next, I will use it for my private cloud
You use the command dietpi-software to migrate cloud data
Scroll down and select User Data Location
In the list of available drivers,
select the driver you just created in the previous step
It will take a few minutes to transfer the data to the new location
Now let's check it for cloud storage has changed or not
As you can see the current storage capacity is 869 GB
a huge increase from the old 50GB
If you have a larger storage capacity your cloud storage will also be larger
The next part will help us access the private cloud from anywhere
First you setup a static IP address for your computer
You use the dietpi-config command to set up a static ip address for your computer
I will copy the current ip address into a static ip address for the computer
You can set up another ip address if you want
Don't forget to save your changes before exiting
To access from the internet you need to forward the port on your router
Depending on the type of router you are using the forwarding method will be different
But our goal is to forward ports 80 and 443
Port 443 I forwarded is available that last step of this video
In this example, the ip address to forward is 10.11.32.134
You need to change the ip address to match the static ip address you set up in the previous step
To access from the internet you open a web browser
enter the public ip address, slash and nextcloud
That way I can access my private cloud from the internet
But my public ip address is dynamic so I will use ddns service
The ddns service I use here is duckdns, it's free
I will create a new domain name netvncloud.duckdns.org
Let's create a domain name that suits your wishes
Let's see how to install duckdns on linux and follow the steps
First create a folder named duckdns
Next create a file named duck.sh in the folder duckdns
You copy and paste the content as instructed, content will include your domain name and token
Grant permissions to the duck.sh file
Next you schedule the duck.sh file to execute as instructed
You copy and paste the content as instructed
Now let's check if the duck.sh file is working properly
Want to know if the domain is working properly or not you can see the results from the log file
As you can see a result is okay then we have succeeded
Now we will access our Cloud using this domain name
That way we don't need to worry about our dynamic public IP address anymore
Once we transmit data on the internet the safety factor is very important
Therefore, we need to encrypt data when transmitting on the internet environment
To do that, you need to install certbot
Just like installing nextcloud, you enter certbot in the search box and install it. It will take a few minutes to complete
After installing certbot you use the command dietpi-letsencrypt to set it up
Here you enter your domain name in the previous step
And you enable redirect from HTTP to https
Then wait a few minutes to complete
Now go back to your cloud,
you will see https appear and your data will be encrypted when transmitted over the internet environment
That is all
Thank you for watching
If the video is useful click like share and subscribe to the channel
Next you will download the nextcloud clients on desktop
ios and android to access your private cloud like any other cloud application