Nextcloud on VirtualBox with shared folder storage

I had the idea of ​​having my own home cloud for a long time. I considered NAS options based on free distributions like FreeNAS, NAS4Free, OpenMediaVault, etc. But I wanted to have a mobile client, a simple and beautiful webUI. Previously, I somehow dabbled with different solutions and liked the ownCloud project. But at the moment he has a paid mobile application. Now it costs about 30 rubles, but I wanted to have something more free. I remembered about a good fork of ownCloud - Nextcloud . The mobile application is free (+ there are additional applications for it) and there are desktop clients (Win, Mac, Linux). Nextcloud itself has many settings, integrations, and the ability to install extensions (applications).





Nextcloud is distributed in several ways:





  1. Archive of the server application for the web server;





  2. Web-;





  3. «» VirtualBox, Docker Snap-.





VirtualBox, , .





: VirtualBox ( — VB) VirtualBox Extension Pack ( — VBEP).





1. — Nextcloud-VM.ova.





Hansson IT.





2. , VirtualBox.





( — ) , . «» , Nextcloud . , .. , Nextcloud.





3. «» .





4. , VB.





Nextcloud

Ubuntu Server 20.04.1 LTS Nextcloud.





1. .





2. . () — ncadmin, nextcloud.





Nextcloud.





3. .





4. . ncadmin.





, Enter Nextcloud.





5. . 2 ( 40 ):





  • disk1 — , ext4.





  • disk2 — ZFS.





. ( ), .





, «».





6. .





«1 Disk», .





«Tab» , «Ok» «Enter».





7. DNS :





  • Quad9





  • Cloudflare





  • Local — ( DHCP)





Cloudflare. «Ok».





8. — .





, «».





9. — http://archive.ubuntu.com/ubuntu.





, «».





10. — , , .





, ( , , ). «No» «Enter».





Nextcloud (+PostgreSQL, PHP, Apache).





11. ncadmin





. , «Enter», «Enter».





12. Nextcloud — ncadmin. .





. , «Enter», , «Enter», «Enter».





13.





«Europe», «Ok».





14. . «Ok».





15. , '/etc/sysemd/resolved.conf' :





Y I — ( ) ;





N O — ;





D — ;





Z — shell





: «Y» «Enter».





.





16. ( PuTTY). , , /home/ncadmin/welcome.sh ( ).





«Ok». — Nextcloud .





VB sudo apt install virtualbox-guest-utils







— sudo shutdown -h now







, , VB .





1. ( PuTTY)





2. 1024





3.





4. (folder): -





.





— https://enk2x.ru/2019/09/21/datanew/





, .





1.





cd /media







ls







«sf_folder» ( «sf_»), «folder» — .





2. «vboxsf» (- ) ncadmin www-data ( Apache).





sudo usermod -aG vboxsf ncadmin







sudo usermod -aG vboxsf www-data











sudo shutdown -r now







3. nextcloud





sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on







nextcloud www, html





4.





sudo cp -R /mnt/ncdata /media/sf_folder







5.





cd /media/sf_folder/ncdata







ls











6. -





sudo nano /var/www/nextcloud/config/config.php







config.php, 'datadirectory' '/mnt/ncdata' '/media/sf_folder/ncdata' ( «folder» — )





Ctrl+X, «y» «Enter».





7.





sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off







.





1. Nextcloud web- admin Photos





2. -





3. .





As a result, we got a cloud server on a virtual machine with external storage, which can be directly accessed through the file manager.





4. Reverse copy order





If we first manually upload files to a shared folder (without using the application), then they will not be visible in the application. In order for them to appear, you need to rescan the folders with the command





sudo -u www-data php /var/www/nwxtcloud/occ files:scan —all







After scanning, the added files will be displayed in the application.








All Articles