Accidentally installed apache2 after using snap to install Nextcloud

I am wondering if someone know how I can revert my errors during installation of an apache2 on my cloud server.
I can just start over with a clean install, but then again - I also want to learn fom my mistakes.
I installed Ubuntu Server a few weeks ago on a file server. Clean install.
Followed the procedure write-up on and made myself a nextcloud server. I also made it accessible from the internet, so I could share a few collaboration files for my band mates.
Then, we had a network breakdown at the office. While that lasted I inadvertedly installed apache2 and more by using apt-get.
Now, that installation answers the requests from both internet and locally - instead of the Nextcloud installation that was made with Snap.
Any chance of reviving my “lost” nextcloud without reinstalling the whole thing?
I appreciate you taking the time to read this, and I value any and all input.
I am pretty new to linux servers, but I have used a few flavors of Linux desktop.

I’m not sure what’s actually contained in the snap. Nextcloud is just a php application that requires a webserver such as nginx or apache to run. You can exchange one for the other (I’ve done this admittedly with a little hair being pulled out). If you still have the original webserver config files, can’t you just remove either apache or nginx?

Thanks for answering. Will the re-routing of web traffic go back to the original nextcloud if I just remove the installed Apache2?

Well likely but there is few things you can check… is Apache2 and nginx installed on the system? What is binding ports 80/443 right now — I’m guessing its apache. Rather than uninstalling initially, what if you just stop apache right now

If youre using ubuntu the command is going to be something like the following (it’s either apache or possibly apache2 for the syntax below):

sudo systemctl stop apache

After stopping apache see if nginx binds port 80/443. You might need to restart the nginx service if the binding doesn’t work:

sudo systemctl restart nginx

query for listening services using netstat or lsof. You should see for example nginx listening on those ports.

Your problem is that the snap contains everything Nextcloud needs — including it’s own instance of Apache completely separate from the one you later installed with apt. And they are now competing for who gets to listen on TCP 80 and 443.

If you uninstall Apache from apt and restart your system, chances are good it’ll be back how it was.

apt-get remove apache2

1 Like

Yep. That actually did the trick.
I am very happy that it wasn’t ruined. So now I have backed up the files on the 3 accounts on the nextcloud installation. But the web interface has become very, very slow.

All browsers I have tried get a timeout error when trying to access the web interface. Even the Android app can’t connect, due to the server is non-responsive.
But if I SSH in, the speed seems normal. Web speeds are normal, LAN speeds too. Nothing out of the ordinary can be seen on “top”.
Even file transfers via SSH seems totally fine. Still, the web interface or Nextcloud itself, is very very slow.
Any tips on how to remedy this? I am not exactly sure what to search for, as those I have found so far seems to have a bit different set of issues.
This does not seem to be hardware related at all. The nextcloud was working just fine a few days ago.

Thank you so much for the answers so far.