How to: Build a Free, Secure, and Unlimited Personal Cloud
Data is essential in the 21st century. A quarter-century of digital transformation has gotten us here: to the advent of the Data Age. From floppy disk to CDs and hard disk to cloud, storage technologies have come a long way, transforming our memories and experiences from physical devices to virtual spaces. The impact and value of data has never been more profound. With all these advancements, learning how to access data securely from anywhere in the world has become extremely important.
When done effectively, a cloud-based infrastructure can offer advantages over traditional storage technologies in the areas of performance, scalability, and even security. Most people would choose to use a third-party service to host your data, aka cloud storage. Amazon Web Services said a cloud storage is, “a cloud computing model that stores data on the Internet through a cloud computing provider who manages and operates data storage as a service.” Why would you bother spending the time and resources to make your own cloud when so many are already available? Do we really need to reinvent the wheel?
Unlike public cloud services, personal cloud storage does not charge users monthly subscriptions. Users use their own hardware and free open-source software to host their data. Personal cloud is easy to scale up. If you need more storage, just add another or a bigger hard drive. Most importantly, you own your data. If you rely upon a third-party for your cloud, you have little to no control over how that cloud can be used and how it’s deployed. If you build that cloud by yourself, you are in complete control. No matter how large your cloud, how many users, how strong your security — it’s all in your hands. To most people, building a personal cloud is unreachable due to lack of tools and knowledge. In this article, we are going to introduce an easy way to build a free, secure, and unlimited personal cloud that you will be able to access from any device, anywhere in the world. Here are the parts you will need for this tutorial:
- An old laptop. Laptop is great in building a cloud storage as it comes with a battery that can serve as a UPS in case of power outage. Alternatively, many would choose to use a Single Board Computer, like Raspberry Pi 4. However, the supply of SBC has been disrupted and is very hard to find one with a reasonable price during this pandemic. The price you pay for a Raspberry Pi 4 Kit is almost the same as purchasing a low-end laptop from Walmart. A low-end laptop is also much more powerful than a Raspberry Pi 4. It also comes with built in storage, screen, keyboard, touchpad, and battery. So an old laptop is the recommendation.
- An operating system (OS). There are many OS available for this purpose. We chose to use a Linux system. We cover how to use Linux in our classroom, so computer science students should not have any problems operating it. But for most people, operating Linux is an adventure. Modern day Linux distributions, like Ubuntu, is a user-friendly OS. Operating it is not much different than operating a Windows or MacOS. It also comes with a lot of free software that you can download from its store. However, setting up services and packages in Linux is a little bit daunting to most people. To quickly build a secure cloud server without going too technical, I am going to use a versatile distribution, Dietpi, for this tutorial.
- A USB drive at least 4 GB large. Please backup your data before writing the image on it. A portable drive, as large as you want for your cloud. You may want to use a 500GB or larger drive. These are relatively cheap. You can add more storage later.
- Time: 30-60 minutes.
- Step 1: Download a proper image from https://dietpi.com
At the bottom of the download page, you should be able to find a lot of disc images like what is shown in Figure 1. We will use the Native PC disc image. There are two kinds of Native PC disc images. If your laptop is more than five years old, you need to download the Native PC (BIOS/CSM) image, otherwise, you should download the Native PC (UEFI) image.
- Step 2: Download the Etcher from: balena.io/etcher/. You will find the download link as shown in Figure 2. Once downloaded, run the Etcher and follow the instruction on the screen to write the image to the USB drive.
- Step 3: Connect an Ethernet cable to your laptop, restart your laptop, and boot from the USB drive. You may need to consult your laptop manual on how to boot from a USB drive.
- Step 4: Once started, it will show something like what is shown in Figure 3.
- Step 5: Choose the only disk available on the screen and use Tab key to navigate. Press Enter key to move on to the next step. The installer will show a lot of texts on the screen and on the installation progress. Wait for a few minutes to allow it to finish the installation.
- Step 6: After the installation, the system will restart. If it does not restart, you can power cycle it. Once it is up, you should be able to see the same screen in Figure 4. You may want to write down important information on the screen: Username, Password, and LAN IP. Use the credential to login to the system for the first time. When typing the password, you will not be able to see what you are typing for security reasons.
- Step 7: After logging into the system, you should change your default password as prompted and install Serial driver. Afterwards, you should reach the following screen shown in Figure 5. Notice, this password is the system password, not the password to your cloud. Choose Browse Software. Use Arrow keys to move from one option to another. Use Enter key to choose an option.
- Step 8: Dietpi will show software on screen as what is shown in Figure 6. Feel free to browse the software offered using up-arrow and down-arrow keys. Use Space key to choose an option. Use Tab key to move between browsing, Ok, and Back options. For this tutorial, we will use Nextcloud and Certbot:
- Step 9: Once Ok is chosen, it will move back to previous screen. Now we are ready to install the software. Move to Install and then choose Ok.
- Step 10: The next screen will say Would you like to begin? Select Ok, then Apache, and then Confirm. The installation should start after Confirm. At the end of the installation, it will ask if you want to participate in a survey. After making your own choice, you will be back to the Terminal. If you wrote down your IP address when you first logged into the system, use a device (phone, laptop, PC, or tablet) to open a browser and enter the following address (replace the IP address shown with the one you wrote down when you logged into the system):
- Step 11: You will see the following screen. Use admin as username and dietpi as password. You will be able to change it later. Notice, this password is your cloud password, not the system password you set-up in Step 7.
- Step 12: At the upper-right corner, you should be able to create a new user, similar to the following:
- Step 13: Now, you can download the nextcloud client from Apple Store or Google Play Store and sync your data with your own personal cloud! Alternatively, you can download from Nextcloud website if you cannot access the Apple Store or Google Play Store. You can sync your data from anywhere in the world as long as you know your public IP address. To make it easier to use, you can bind your Public IP address to a domain name using a dynamic DNS service. However, this is beyond the scope of this tutorial.
- Step 14: To make your online cloud storage safe, we will use Certbot. It will help you create a certificate for your domain. You must first complete Step 11 and then register a domain name for your website from a Free DNS service before continuing. The service is free of charge. Once a domain is registered, go to your home router’s setting, and then Port Forward to your nextcloud IP address. In my case, I will forward port 80 and port 443 to 192.168.68.117.
- Step 15: In Dietpi terminal, type the following command:
- Step 16: Enter the following information and then you are done!
Note: You must keep your laptop on and make sure it is connected to the Internet the entire time for this tutorial to complete smoothly.
Dr. Yu-Ju Lin is a professor of computer science and director of the computer science graduate program.