I dockerized my Nextcloud (github.com)
from flor0@sh.itjust.works to selfhosted@lemmy.world on 06 Apr 2024 21:05
https://sh.itjust.works/post/17435057

For years I’ve been running my Nextcloud on bare metal. Now I finally decided to switch it to docker. I looked into Nextcloud All-In-One and it seems easy to deploy but it lacks configuration options like multiple domain names and putting it behind a traefik reverse proxy is kind of a pain to set up.

You can check out my solution on GitHub. I decided on a docker compose setup with nginx, php-fpm and redis(redis is now replaced by KeyDB) in separate containers. Obviously it’s for experts but it’s a lot more configurable. than AIO. It’s also just as easy to migrate to as with any bare metal setup and just as configurable.Yes it’s still a pain to set up, but better than the bare metal version lol

What do you guys think about putting the different components (webserver, php, redis, etc.) in separate containers like this, as compared to all in one? Feedback is greatly appreciated!

#selfhosted

threaded - newest

chiisana@lemmy.chiisana.net on 06 Apr 2024 21:39 next collapse

NextCloud’s trusted_proxies setting supports CIDR notation, so it mught be better to set the subnet of Traefik’s network as opposed to the IP address. That way, if you ever need to do anything with the container (I.e. upgrade traefik), the IP can change but the subnet is less likely to change.

flor0@sh.itjust.works on 06 Apr 2024 21:49 collapse

True. That’s a good improvement. Thanks a lot! By the way do you know if the nextcloud trusted_proxies setting allows for hostnames such as “traefik” as compared to just IP addresses?

chiisana@lemmy.chiisana.net on 06 Apr 2024 21:59 collapse

The documentation seems to suggest just IP address and CIDR notation.

flor0@sh.itjust.works on 06 Apr 2024 22:00 collapse

Alright, thanks a lot! You probably saved me a lot of headache in the future

chiisana@lemmy.chiisana.net on 07 Apr 2024 01:13 collapse

No problem! It’s a small change that might not affect most people :)

redcalcium@lemmy.institute on 06 Apr 2024 22:17 next collapse

People usually come here looking for advice on how to replace their dockerized nextcloud setup with a bare-metal setup. Now you came along presenting a solution to do the reverse! Bravo!

What do you guys think about putting the different components (webserver, php, redis, etc.) in separate containers like this, as compared to all in one?

I actually has a similar setup, but with nextcloud apache container instead of php-fpm, and in rke2 instead of docker compose.

flor0@sh.itjust.works on 06 Apr 2024 23:16 next collapse

Thanks for the kind words! Could you link me to the apache container you use? I would like to replace nginx since it’s not officially supported but still need to do some research on apache

redcalcium@lemmy.institute on 07 Apr 2024 01:52 collapse

I’m currently using nextcloud:26-apache from here because some nextcloud apps I use is not compatible with v27 and v28 yet. The apache version is actually less hassle to use because nextcloud can generate .htaccess configuration dynamically by itself, unlike php-fpm version where you have to maintain your own nginx configuration. The php-fpm version is supposedly faster and scale better though, but chance that you won’t see that benefits unless your server handles a large amount of traffics.

atzanteol@sh.itjust.works on 07 Apr 2024 05:00 collapse

Docker is bare metal

redcalcium@lemmy.institute on 07 Apr 2024 13:14 next collapse

Aye. Docker on linux doesn’t involve any virtualization layer. What should the direct the installation setup be called? Custom setup?

atzanteol@sh.itjust.works on 07 Apr 2024 22:54 collapse

Just non-container if you need to distinguish?

ilmagico@lemmy.world on 08 Apr 2024 03:17 collapse

Well, since we want to be technical … Docker is not bare metal. Linux apps are not bare metal. Arduino is bare metal.

atzanteol@sh.itjust.works on 08 Apr 2024 11:44 collapse

No. The phrase means that you’re not running in a virtual machine.

ilmagico@lemmy.world on 08 Apr 2024 14:08 collapse

That’s only the meaning you’re used to, and that’s my point. It depends on the context. I can assure you that, in the context of microcontrollers, for example, “bare metal” means running without an OS.

atzanteol@sh.itjust.works on 08 Apr 2024 21:24 collapse

Either way its pretty stupid to use it in reference to containers.

ilmagico@lemmy.world on 09 Apr 2024 02:57 collapse

My point is, since its meaning depends on the context, I don’t see the issue for it to mean, in the context of containers, “outside of a container”. Just like in the case of VMs, or OS vs No OS, it means there’s one fewer layer between the app and the hardware, whether that’s a VM, Container runtime, or the OS.

I’m pretty sure everybody, including you, understood its meaning in this context, it didn’t really cause any misunderstanding.

atzanteol@sh.itjust.works on 09 Apr 2024 11:43 collapse

No, it’s confusing. Because some people do use VMs. So it makes it far less clear about what a person’s setup is.

An application running in a container runs exactly the same as a non-container application. It uses the same kernel. And it all runs directly on the CPU. There is no metal/non-metal distinction to make. People just say it because it “sounds cool”. And there are a lot of people in this community who don’t understand what containers are. So it further muddies the water

Decronym@lemmy.decronym.xyz on 06 Apr 2024 23:25 next collapse

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

Fewer Letters More Letters
HTTP Hypertext Transfer Protocol, the Web
IP Internet Protocol
nginx Popular HTTP server

2 acronyms in this thread; the most compressed thread commented on today has 8 acronyms.

[Thread #661 for this sub, first seen 6th Apr 2024, 23:25] [FAQ] [Full list] [Contact] [Source code]

atzanteol@sh.itjust.works on 07 Apr 2024 04:58 next collapse

Docker runs on bare metal

EinfachUnersetzlich@lemm.ee on 07 Apr 2024 09:04 collapse

So does Hyper-V, what’s your point?

atzanteol@sh.itjust.works on 07 Apr 2024 12:37 collapse

The second sentence implies otherwise.

EinfachUnersetzlich@lemm.ee on 07 Apr 2024 20:40 collapse

They’re saying they’ve moved away from running things on bare metal and onto using them inside Docker instead.

atzanteol@sh.itjust.works on 07 Apr 2024 21:32 collapse

Which is running on bare metal too.

lemmyvore@feddit.nl on 07 Apr 2024 13:22 next collapse

What do you guys think about putting the different components (webserver, php, redis, etc.) in separate containers like this, as compared to all in one?

It’s much better to separate them. You can update them separately, you can configure and fine-tune them separately, you can reuse the images for different apps, you can reuse a container for multiple apps etc.

Not to mention not having to rebuild the all-in-one image yourself, which can get very finicky.

gaf@borg.chat on 07 Apr 2024 14:05 collapse

If you weren’t aware, Nextcloud provides non-AIO compose files in their docker repo: github.com/nextcloud/docker/…/docker-compose.yml

flor0@sh.itjust.works on 07 Apr 2024 18:51 collapse

Seems similar to what I’m doing but it uses the nextcloud:fpm-alpine image, which is community maintained. It’s a valid approach but I prefer to tweak my php-fpm config myself. By using their docker image you basically lose a bunch of freedom to configure your setup, but it’s easier to set up for sure