Intergrating TrueNas, NextCloud and Proxmox Hypervisor for Reliable File Storage and Cloud File Synching

Published on
9 mins read
––– views
thumbnail-image

Introduction

Back Story

A while back, I decided to assemble my own PC. This took sometime but eventually it was fully built and running as expected. Due to its horsepower and capabilities, I wanted to use it as a system to run various virtual machines. After looking around, I settled on Proxmox operating system as my hypervisor.

Before we proceed, let me introduce what proxmox is:

Proxmox is an open-source virtualization platform that allows you to run multiple virtual machines and containers on a single physical server. It combines two powerful technologies: Kernel-based Virtual Machine (KVM) and Linux Containers (LXC).

With Proxmox, you can create and manage virtual machines, which are complete and isolated operating system instances that run on a shared physical server. Each virtual machine has its own dedicated resources, including CPU, memory, storage, and network connectivity. This allows you to consolidate multiple virtual machines on a single server, making efficient use of hardware resources.

In addition to virtual machines, Proxmox also supports Linux Containers, a lightweight alternative to full virtualization. Containers provide an isolated environment for running applications, without the overhead of a separate operating system instance. They share the host system's kernel and resources, resulting in faster startup times and better overall performance.

Proxmox offers a web-based management interface that makes it easy to create, configure, and monitor virtual machines and containers. It provides various features like live migration, high availability, backup and restore capabilities, and comprehensive resource management options.

Software Choice

Since i already had a good PC, I decided to intergrate it with my current sysytem so that it can act as a media storage and file backup system. With such as system I am able to store large files in s central system that ensures that the data is backedup and accessible accross multiple devices. One of my key consideration as this point was a system that can guarantee reliability , open source and selfhostable. After reviewing various options available, i decided to go with TrueNas (former FreeNas) for storage management.

TrueNAS utilizes the ZFS (Zettabyte File System) storage technology. ZFS is a robust and scalable file system that provides advanced data management capabilities and data integrity protection. It offers features like data deduplication, compression, snapshots, and replication, ensuring efficient storage utilization and reliable data protection. ZFS's copy-on-write architecture and checksumming mechanisms help prevent data corruption and ensure data integrity. By leveraging the power of ZFS, TrueNAS delivers a reliable and high-performance storage platform for a wide range of storage needs.

After choosing the storage management system, the next step was to choose file synching, sharing and cloud storage management solution. My goal was to have a system that can not only sync my data but also provide the convenience provided by cloud solutions such as Google Drive, Onedrive and the likes. These services include calendar intergration, auto file sync and account management. Not forgetting my previous consideration (should be open source and self hostable), I decided to go with NextCloud.

Nextcloud is a versatile file sync and sharing platform designed to provide users with secure storage, easy access, and efficient collaboration capabilities. It offers a self-hosted private cloud environment, enabling individuals and organizations to have full control over their data. With features like file synchronization and collaboration tools, Nextcloud ensures seamless accessibility to files from various devices and locations. It prioritizes data security, implementing robust measures to protect sensitive information within its customizable and reliable cloud infrastructure. Nextcloud serves as a comprehensive solution for individuals and businesses seeking flexible and secure file management and collaboration options.

Now we have selected all the ingredients needed to build the file hosting system. The next stage is to bring them together to form a coherent system.

Installing TrueNAS

The first step in the process is to install TrueNAS to act as the base operating system and file management system.

I decided not to install NextCloud as a standlone system since TrueNAS specializes in file integrity and management while NextCloud specializes in file cloud intergration. Therefore, it was possible to get both features by having NextCloud ontop of TrueNAS.

Note: I will be using images and guidlines that are relevant to Proxmox ecosystem. However, most of the processes should have the same general outline.

Download TrueNAS

TrueNas can be downloaded from their official website. There are various options to choose from based on the expected functionality. The available options are Core, Scale and Enterprise. TrueNAS Enterprise is mostly used with entreprise clients. Core and Scale version can be used for small scall storage. However, the scale version is more advanced , with many more features such as containarization. Since was only interested in the file storage capabilities, I decided to go with the Core version. The installation process is similar irrispective of the chosen version. The core vesion can be downloaded through their website. I downloaded iso file of the stable vesion through the download button. The current vesion was 13.0.

Installation

The next step is to install the iso file. The software is installed as we would install the normal operating system such as Linux or Windows. Therefore, if you intend to install it as a standlone operating system, you can create a disk image of the file into a flash drive and proceed with the installation.

In my case, I uploaded the iso file into my proxmox storage disk by navigating to the target storage disk, in the iso images sections, clicked on upload then uploaded from my computer.

Remember you can also dwonload the iso directly through proxmox by providing the download link using the download from url. The download link can be obtained by right clicking on the download button and selecting copy link address.

After the file transfer was complete, the next process was to click on the "Create VM" button at the top right. After the populating the necessary fields such as disk space, ram and processors I was given a review page that outlined all my choices. I confirmed the settings and proceeded.

Virtual machine installation

Remeber, the disk space allocated at this point is for the OS installation and not for storage.

Before, starting the VM, we can allocate two storage spaces for TrueNAS. One storage space will be used for the actual file storage while one will act as a backup. The two drived together will give a good level of backup. You can have as many disks as possible for optimum redundancy.

The two disks should be physically different if possible to ensure that if one fails you can restore the data using the spare disk.

At this stage, we can start the VM and continue with the installation. The installation process should run smoothly and when its done, you should see the allocated IP address for TrueNAS.

The next step is to go to the browser and navigate to the url by typing the url eg https://192.168.0.100. The browser might complain that the SSL certificate is invalid but its nothing to worry about, you can accept and continue.

Install NextCloud

After navigating to the next cloud url, you can enter the username (root) and password (set during installation). The next thing is to create a storage pool, from which NextCloud will store the files.

The storage pool can be created by navigating to storage section. You should enter the pool name and select the target disks. After that is done, you can go to plugin section and select NextCloud from the list of plugins available. You can the provide the nessary configutations such as name of the installation.

The installation process will take a while. When we are done, you can check the post installation notes to get the autogenerated passsword. At this stage, create a new tab an search the NextCloud address indicated in the plugin information. We can go ahead and login.

As an administrator we, can create other accounts or account groups as needed. Now that we are done with the installation, we can move on to intergration with other systems. We can now download the NextCloud application that will facilitate synching and backup functionality among other options. The application can be downlooaded from NextCloud website and the android/IOS from applications from the respective stores. After downloading the appropriate applcation, we can login with the credentials created or the administrator credentials. Howerver, we have to note that we will provide the domain or the IP address of our NextCloud instance.

Challenges

There is no process without its challenges. Installation of TrueNAS and NextCloud was quite smooth but there were several challenges that I encountered along the way. One of the major challenge was synching of large files.

My NextCloud application could not sync files larger than 512Mbs.

An attempt to sync such files resulted in error 413, entity too large.

Howerver, I resolved the issue by editing the NextCloud configuration file.

Edited file was found through TrueNAS Jail console

Remember not to use the TrueNAS main console.

File to edit:

/usr/local/etc/nginx/conf.d/nextcloud.inc

# set max upload size
client_max_body_size 512M; #Remember this is case sensitive
fastcgi_buffers 400M;

Edited to:

# set max upload size
client_max_body_size 10G; #Remember this is case sensitive
fastcgi_buffers 64 4K;

I then restarted TrueNAS and the changes were updated. I could now upload upto 10gb single files.

This was the outline of my journey intergrating NextCloud ontop of TrueNAS in Proxmox hypervisor I hope this helps you, the reader and my future self.