Docker or LAMP?

Good evening community,

Currently I have Nextcloud installed via a LAMP stack on Ubuntu but various challenges as I can’t figure out which php.ini is being used even via <? phpinfo(); ?>. As a result, I initially changed memory_limit etc via the .htaccess, meanwhile I do it directly in the VHost config. But I can’t get the changes regarding the OPcache in there myself & the cron jobs don’t run for me until today.

This and the fact that I would like to get not only Wordpress but also RocketChat (reverse proxy via LAMP stack overwhelms me) running on my server has now led me to the consideration to make the server completely flat again and set up via Docker. Is this advantageous or recommendable for a beginner like me, especially if I want to run several applications side by side? What is there to consider?

Kind regards and many thanks in advance!

1 Like

Docker has advantages like very fast application deployment but it comes with some cost - as every other abstraction method it adds complexity. You need to understand some docker concepts to deploy applications successfully (beyond very simple whoami container). Fiddling around with specific configuration files like fine-tuning the system for your demands is harder/unexpected with docker, backup is different - some aspects are harder, others are easier.

I don’t think this changes with docker - at least if you keep the same product - expect similar complexity. I feel traefik easy to setup - but hard to find advanced examples as almost every google search is polluted with “start in 5 minutes” tutorials…

it’s easy to try docker on your server or even on desktop… spend one or two week with tutorials and docs and you will see if the idea makes sense for and you are willing to go this way…

2 Likes

Can you recommend me a good tutorial for nextcloud and docker?

I would suggest you familiarize with docker and docker-compose first. I find tutorials from Nana good - no idea about this specific docker tutorial. Don’t hurry, understand the concepts and ideas - this saves lot of pain later. Then try official docker-compose example and add complexity slowly once simple functions work as expected… and try things out before you start product: upgrade (use older image version initially), backup and restore… try to intentionally brake and recover you system - if this works you are ready to solve later problems…

3 Likes

Thanks for the tutorial! Im watching it right now and it helps a lot.

@wwe Is there also a possibility with Docker to run the user management only via a single login? I have already searched for it but have not found anything yet via google.

I don’t get the question. Do you mean Single-Sign-On? something other?

1 Like

Yes, exactly! Otherwise I’d have to create logins for nextcloud, wordpress and rocket chat.

I made this tutorial+workshop with plenty of examples and working code… you might find it useful.

I prefer the container-based (e.g. Docker) approach (rather than bare metal / virtual machines) because you get lightweight service encapsulation/isolation… each service is bundled along with its dependencies. You can have a really simple “host” server and all the complexity for each service cleanly hidden in separate containers. Working with containers also necessitates “configuration as code” and reproducible automation rather than manual sysadmin work. These practices can then lead to better disaster recovery and scalability.

And I agree with everything @wwe wrote above. It’s probably not easier nor harder, it’s just a different approach. Containers can be worse, such as when you are trying to run a service that requires many open ports. It’s doable, just probably easier on bare metal or a virtual machine. I found Jitsi hard to containerize, for example.

So I guess I’d say containers are important to learn, and you’ll still find cases where you’re better off with bare metal or a virtual machine instead. For example, video conferencing, ad-blocking or a voice assistant). That said, I run a Pi-hole in a container and it works fine.

The maintainers for Nextcloud’s Docker images do an excellent job… this makes a huge difference.

Back to your original post… changing approaches at this point doesn’t directly address the issues of being able to confirm/know which version of PHP is being used, making sure cron jobs run, and maintaining a reverse proxy in front of multiple services. You might get lucky and something might just work, but I wouldn’t count on it. I recall having to fiddle with cron a bunch with my Nextcloud app container, and I think I ended up just relying on the host’s cron daemon (although there are several ways to solve the problem).

2 Likes

Ooh, single sign-on… I want that too. The more services I run, the more I want it. I’ve done some poking around and have not figured this out. It looks hard. gluu, aerobase, authelia, keycloak, uaa, freeIPA… I’m a bit lost. LMK if you figure it out!

1 Like

There are multiple ways to implement SSO with Nextclooud. Modern approach uses OpenidConnect with Social Login app or OpenID connect app (unsure how it’s called)