Yes. That’s the recommended way to install additional PHP versions, if you must do so. We don’t recommend it, but if you have to, that’s the best way we know how to do it. But, PHP 7.4 is compatible with pretty much everything, you don’t need to use anything else, and you probably do not need multiple PHP versions; you should try your deployment with 7.4 and see how it goes.
You cannot remove the default PHP version. It is a hard dependency in lamp or lemp stack packages (see: virtualmin-lamp-stack-ubu/virtualmin-lamp-stack-2004.ctl at master · virtualmin/virtualmin-lamp-stack-ubu · GitHub)
Install the php-opcache package and optionally configure it.
Install Virtualmin with the --bundle LEMP
option.
Don’t follow random instructions you find on the internet (even if they are linked from our forums, anybody can post to the forums). While we appreciate folks writing up their experiences with Virtualmin, we can’t possibly vet every random tutorial on the web. You’re just as likely to get yourself into a mess as you are to solve problems, when following tutorials from random folks.
Do not do either of those things. Just use the version of nginx provided by your distribution, and the default database. Doing anything else is just asking for a lot of work for literally no benefit. MariaDB is a very fine MySQL compatible database that has widespread adoption and works with every major web app. The version of nginx provided by Ubuntu 20.04 will be better maintained and more secure than anything you can cook up on your own.
We can’t easily support you if you go off the rails and cut your own path through the wilderness.
Very experienced users can do whatever they want, of course, but if you have to ask basic questions like these, you should not even consider replacing major components of the system. Really, this is a bad idea. Don’t do it. You aren’t making your server better, you’re just making your life worse.
Edit: Wait, you’re wrong about default database in Ubuntu 20.04. MySQL is currently the default database for Virtualmin installations on all Ubuntu versions. You should not switch that either. Just use what you get when you install. They’re both fine!