DEV Community

Cover image for How I turned my Raspberry Pi into a private cloud server

How I turned my Raspberry Pi into a private cloud server

Rossano D'Angelo on May 26, 2020

I do like traveling and taking pictures, even if most of them are really pointless 😄 Once back at home, I'm used to moving all the pictures I took...
Collapse
 
alxtrnr profile image
Alex Turner • Edited

Good stuff. I have something similar. Using docs.nextcloudpi.com/en/how-to-ins... . Booting up and running the install from a USB stick. I have found that much more reliable than an SD card. Data directory and snapshot backups are both on dedicated external drives powered by external source. Remote access via a dns address. Just got myself a pijuice power hat for an emergency UPS should it be needed. Here it is in a shoe box... Here it is in a shoe box...

Collapse
 
rossanodan profile image
Rossano D'Angelo

This is awesome!! Do you have any hints for me about using an external hard drive as storage for Nextcloud? I tried but I had errors abour writing permissions on the external disk. I used a HDD 2 TB Toshiba.

Collapse
 
alxtrnr profile image
Alex Turner • Edited

Cheers! In order for me to be able to use an external USB drive, the USB drive must not be formatted as NTFS/FAT as these do not support the user/permission system. For me the drives needs to be formatted to BTRFS. That may be worth checking. Big drives (bigger than 2 TB) also need to be partitioned with GPT.

Collapse
 
gervais_b profile image
Blaise Gervais 🇧🇪

Well done. Please note that 8080:80 in the "ports" section of you docker-compose does not mean "use 80 if 8080 is busy". It means "expose 8080 and redirect to 80 on the container".
docs.docker.com/compose/compose-fi...

Collapse
 
rossanodan profile image
Rossano D'Angelo

Ooooh thanks for reporting this!! I'll edit it right now. Thank you! :)

Collapse
 
cristiannebunu profile image
Cristian N

Pretty cool. I'm sure you thought about it, but for everyone else, on an RP4 you have USB 3 and that means you can hook up an SSD or a any other kind of external drive and make it run on that, and when you are no longer limited by the sd card, imagine the possibilities :)

Collapse
 
rossanodan profile image
Rossano D'Angelo

There you are, that's what I'm try to do ;)

Collapse
 
brunooliveira profile image
Bruno Oliveira

Awesome awesome stuff!!! Really nice! Similar to the app related to dams I did and wrote about here, I believe these projects are the best to learn

Collapse
 
rossanodan profile image
Rossano D'Angelo

I agree. It gave me another chance to go deeper on Docker and Docker Compose. Now, as I said, I need to overcome the limitations.. Let's see if I find good advices here ;)

Collapse
 
etescartz profile image
etescartz • Edited

If I may suggest adding a Redis container to your setup, for Nextcloud caching instead of the default apcu. I'm also looking into adding a Photoprism container since it can import directly from Nextcloud, or so I keep reading.
Also I found Docker compose to be cumbersome so I started using Ansible since it has it's own "docker_module". That way I deploy my own cloud infra with really granular parameters and modulatity, and also avoiding docker-compose's "deploy my containers as a group" mentality.
The beauty of it all is that if one RaspberryPi's power isn't enough for this setup you can always buy another one and split containers among them as you see fit.

Thread Thread
 
rossanodan profile image
Rossano D'Angelo

I followed what you said but, I want to be honest, I'm not able to implement such architecture by my own. I'm only at the beginning! :)
I'll keep your comment in mind tho, it'll be useful for my next steps into docker and docker-compose. I like working with it!! :)

Collapse
 
moeletjis profile image
Moeletji Semenya

Super creative. Great work

Collapse
 
rossanodan profile image
Rossano D'Angelo

Thank you Moeletji! You made my day with these comments. Really glad you enjoyed it :)

Collapse
 
musale profile image
Musale Martin • Edited

I like this. Running docker really excited me I can't wait to try it out.

Collapse
 
jdsaraiva profile image
jdsaraiva

Thanks for sharing Rossano, I am now waiting for the second part of the article.