I'm grateful to matigo for taking the time to derive an uninstall process from the web setup, and to document it in a great answer.
I'm providing this supplementary answer with a few differences I encountered (which may or may not relate to the fact that this Ubuntu 20.04 machine is a Linux Mint installation). Hopefully this will help any other Linux "semi-noobs" using the process in the future.
These are the differences I found, and what I did about them:
Apache root:
I found my Apache root was one level lower, at /var/www/html
. This didn't seem to cause any particular problem, just needed additional care to use the right path where commands refer to the Apache root.
Nextcloud not in sites-available: I could find no mention of Nextcloud in any files in /etc/apache2/sites-available
(even with grep -i; nor in any other /etc/apache2/
subfolder). This remains unexplained, and is strange, as Nextcloud had been working quite recently for a few test connections to the website. Anyway, so I had to skip the a2dissite
, but the rm
(with additional www
in path as noted above) was successful (Nextcloud folder gone), and the apache reload, which I did anyway for good measure, didn't report any errors (I assume it would say at least something at the console if the reload had problems? And the remaining sites are working without any issues).
Nextcloud database: in the MariaDB/MySQL step, I found I had no database called "nextcloud" but there was one called "ncexample" which I thought was probably the one. A web search revealed that the Nextcloud database contains a bunch of tables prefixed "oc_" (Nextcloud being a fork of ownCloud), which helped to confirm that the db I was about to delete was at least some Nextcloud database on that server. In my case that was all I needed to know before deleting it.

Nextcloud firewall rules: I went into the graphical UI for UFW (GUFW) by choosing Firewall Configuration from the main menu in Linux Mint. There, by selecting each of the profiles in turn (Home, Office, Public etc), I located and deleted the Nextcloud rules. The UI made this very easy because the displayed table of rules has a Name column, and there were rules with Nextcloud in the name. (I don't know whether the Nextcloud firewall rules were added automatically by setup; given that matigo makes no mention of them, I'm guessing not, meaning they would have been added manually afterwards. So it looks as though this step would be needed in any case following any auto-uninstall, should such a thing ever be found to exist and be used.)
That's it! By making these or similar adjustments applicable to your own server, you should find that matigo's process works very well to uninstall Nextcloud when the web installer was used to install it. If at any point I find anything further related to uninstalling Nextcloud this way, I'll post an update. I'd welcome comments regarding others' experiences with the process.