How to Build Personal DIY Cloud Storage With Remote Access

In this article, we will show you how to build personal DIY cloud storage with remote access. Personal cloud storage software or cloud backup services allows you to store your files in the cloud with more control than traditional cloud storage. You generally access your personal cloud through a sync desktop PC with Google Drive or pCloud. Like if you want to store your startup important files in the cloud, you can choose from dozens of cloud services for startups. Most of them do the work for the average person or family. Setting up these services is straightforward and does not require any additional web hosting control panel as the cloud storage company has already allocated server space for its customers.

Creating a DIY cloud storage solution is more complicated, but you have control over where your files are stored, how they’re accessed, and how secure you are. DIY storage is also great for large businesses, as many of these services offer fax online with HIPAA compliance and LDAP/Active Directory options. If you’ve ever thought about creating your own personal cloud storage, apart from PCs there are android cloud storage apps also available for the mobile users to take the benefits of clouds backup services.

How to Build Personal DIY Cloud Storage With Remote Access

Things You Will Need to Build a DIY Cloud Storage

You will need the following to build a DIY cloud storage solution with secure remote access:

A Raspberry Pi Zero 2 W or better. You may also use an old laptop or PC with Ubuntu or any other Linux distro.

An SD card (4GB minimum)

External USB storage, such as an external SSD or hard drive with a power supply.

Install and Set Up NextCloud Server

To install and set up a NextCloud server on a Raspberry Pi Zero W, 2, 3 or 4, follow the steps below. If you are using an old laptop with Linux distro (Ubuntu), you can skip this step.

Flash Raspberry Pi Lite OS

Step 1: Download, install and use the Raspberry Pi Imager tool to flash the micro SD card with Raspberry Pi Lite OS.

Step 2: After the flash, open the boot partition and create an ssh file and a wpa_supplicant.conf file. In the wpa_supplicant.conf file, paste and save the following code. Make sure to update the code with your Wi-Fi SSID and password

country=USctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdevupdate_config=1network={ssid=”NETWORK-NAME”psk=”NETWORK-PASSWORD”}

Step 3: Remove the card from the system, insert it into your Raspberry Pi and connect the power supply to turn it on.

Install NextCloud

Next, follow the step-by-step instructions below carefully to avoid any confusion:

Step 1: On Windows, open Putty and enter the IP of Raspberry Pi to access the SSH. On Mac and Linux, you can use the terminal window to log in to the Raspberry Pi with the username pi and password raspberry.

Step 2: Once login, execute the following command.

sudo apt update && sudo apt upgrade

Step 3: Press Y and the Enter key to continue.

Step 4: After the update, install Apache2 and PHP.

sudo apt install apache2

Step 5: Visit the Raspberry Pi IP after installation to confirm if the Apache2 is installed successfully.

sudo apt install php8.0 php8.0-gd php8.0-sqlite3 php8.0-curl php8.0-zip php8.0-xml php8.0-mbstring php8.0-mysql php8.0-bz2 php8.0-intl php-smbclient php8.0-imap php8.0-gmp libapache2-mod-php8.0

Step 6: This will install the PHP and the packages required for NextCloud. Restart Apache.

sudo service apache2 restart

Step 7: Install MySQL server.

sudo apt install mariadb-server

Step 8: After the installation, use the following commands to create a user and database.

sudo mysql -u root -pCREATE DATABASE mynextclouddb;CREATE USER ‘YourUserName’@’localhost’ IDENTIFIED BY ‘[YOURPASSWORD]’;GRANT ALL PRIVILEGES ON nextclouddb.* TO ‘YourUserName’@’localhost’;FLUSH PRIVILEGES;

Step 9: Finally, download and extract NextCloud on Raspberry Pi using the following commands,

cd /var/www/

Step 10: Now, create a data directory.

sudo mkdir -p /var/www/nextcloud/data

Step 11: Assign permissions and control over the NextCloud files and folders.

sudo chown -R www-data:www-data /var/www/nextcloud/sudo chmod 750 /var/www/nextcloud/data

Step 12: Create a configuration file.

sudo nano /etc/apache2/sites-available/nextcloud.conf

Step 13: Paste the following in the editor window and then press CTRL+X followed by Y and the Enter key.

Alias /nextcloud “/var/www/nextcloud/”<Directory /var/www/nextcloud/>Require all grantedAllowOverride All OptionsFollowSymLinks MultiViews<IfModule mod_dav.c>Dav off</IfModule></Directory>

Step 14: Now, tell Apache to use the configuration file.

sudo a2ensite nextcloud.conf

Step 15: Restart Apached2 for the changes to take effect.

sudo systemctl reload apache2

Step 16: You can now visit the HTTP://<IP Address>/nextcloud to access NextCloud. For instance,

192.168.0.136/nextcloud

Step 17: Enter the username and password you created in the MySQL database in step 8.

Step 18: Now, click Finish Setup and wait. Once done, you can start uploading and sharing the files locally.

To expose your DIY cloud storage, i.e., NextCloud, to the internet for remote access, follow the next steps.

Install and Set Up a Cloudflare Tunnel

To install and set up a Cloudflare Tunnel to securely access your DIY cloud storage from anywhere, follow these steps.

Add Site to Cloudflare

Get a free domain name at Freenom or purchase one from a domain registrar, such as GoDaddy or BigRock and add the domain to Cloudflare by following the instructions given below.

Step 1: After purchasing or getting a free domain, update your name servers with the following:

serena.ns.cloudflare.comelmo.ns.cloudflare.com

Step 2: Once done, sign up and log in to Cloudflare.com.

Step 3: Click Add the site.

Step 4: Enter the domain name and click Add the site.

Step 5: Choose the free plan and click Complete.

Since we have already updated our name servers, we don’t need to add any records at this time. You can click Complete and hit Sure.

Install Cloudflared Service on Raspberry Pi

To install the Cloudlfared service on your Raspberry Pi, open Terminal or Putty and connect via SSH. Then follow these instructions:

Step 1: Run the following commands to download, extract and install the Cloudflared service in your Raspberry Pi.

sudo apt wget https:sudo tar -xvzf cloudflared_2022.7.1_arm.tar.gzsudo cp ./cloudflared /usr/local/binsudo chmod +x /usr/local/bin/cloudflaredcloudflared -v

Step 2: Now, run the following command. It will display the URL.

cloudflared login

Step 3: Copy the URL and open it in a web browser and authorize the domain you added to Cloudflare.

Set up Cloudflare Tunnel

Step 1: To create a secure tunnel to access your DIY NextCloud storage, run the following command in the terminal window,

cloudflared tunnel create <TunnelName>

Step 2: Now, copy the UUID of the displayed tunnel and the path of the JSON file.

Step 3: Create and edit a Cloudflared configuration file or config.yml file using the following command.

sudo nano ~/.cloudflared/config.yml

Step 4: In the editor terminal window, paste the following code.

tunnel: a2efc6c1-2c75-45f83eecredentials-file: /home/pi/.cloudflared/a2efc6c1-2c75-45f83ee.json>ingress:– hostname: nextcloud.YourDomain.comservice: http:– service: http_status:404

Step 5: Make sure to replace Tunnel UUID And the Credentials file road. Also, update the file hostname Want to give it to your DIY cloud storage and update IP in Services: area.

Step 6: To save changes, press CTRL + X and then sAnd the followed by Enters a key.

Step 7: Finally, create a DNS entry in Cloudflare by executing the following command,

cloudflared tunnel route DNS <TunnelName> <HostName>

Step 8: Now, you can start the secure tunnel.

cloudflare tunnel run <TunnelName>

Step 9: Once the tunnel has started, you can add the domain name in the NextCloud trusted domain to avoid the next access error.

Step 10: To fix this, run the following command in the SSH terminal window.

cd /var/www/nextcloud/data/configsudo nano config.php

Step 11: In the editor, add your own domain (hostname) to include it as a trusted domain, as shown in the code below.

<?php$CONFIG = array (‘instanceid’ => ‘ocuxxxxxxxx’,‘passwordsalt’ => ‘x6Bxxxxxxxxxxxxxxxxxxxxxx’,‘secret’ => ‘ol2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2x’,‘trusted_domains’ =>array (0 => ‘192.168.0.136’,1 => ‘nextcloud.MyDomain.org’,),‘datadirectory’ => ‘/var/www/nextcloud/data’,‘dbtype’ => ‘sqlite3’,‘version’ => ‘24.0.2.1’,‘overwrite.cli.url’ => ‘http://192.168.0.136/nextcloud’,‘installed’ => true,);

Step 12: press CTRL + X followed by s and the Enters A key to save changes.

Now, you can open a web browser or install the NextCloud app on your Android or iOS smartphone or tablet to remotely access, upload or sync your files or data to and from your DIY NextCloud storage.

Final Words

We hope our article on how to build personal DIY cloud storage with remote access will help you and resolve all your problems. Personal cloud storage works by connecting a DIY cloud storage service like Nextcloud to a hosting platform. The DIY service provides an interface to manage your files in the cloud. This gives you control over things like the amount you pay and the features you can use. For even more control, you can install most of our DIY options on your own hardware instead of an online hosting platform.

I hope you understand this article, How to Build Personal DIY Cloud Storage With Remote Access.

Editorial Staff
Editorial Staffhttps://www.bollyinside.com
The Bollyinside editorial staff is made up of tech experts with more than 10 years of experience Led by Sumit Chauhan. We started in 2014 and now Bollyinside is a leading tech resource, offering everything from product reviews and tech guides to marketing tips. Think of us as your go-to tech encyclopedia!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Related Articles

Best Telemedicine Software: for your healthcare practice

Telemedicine software has transformed my healthcare visits. It's fantastic for patients and doctors since they can obtain aid quickly. I...
Read more
I love microlearning Platforms in today's fast-paced world. Short, focused teachings that engage me are key. Microlearning platforms are great...
Think of a notebook on your computer or tablet that can be changed to fit whatever you want to write...
As of late, Homeschool Apps has gained a lot of popularity, which means that an increasing number of...
From what I've seen, HelpDesk software is essential for modern businesses to run easily. It's especially useful for improving customer...
For all of our important pictures, stories, and drawings, Google Drive is like a big toy box. But sometimes the...