Magento 2.4.x in Ubuntu 20.04 - Requirements & Installation guide

Guide for installing Magento 2.4.x in Ubuntu 20.04

Check the requirements using this link

https://www.mageplaza.com/kb/magento-2-system-requirements.html

For installing PHP please follow this link:

https://computingforgeeks.com/how-to-install-php-on-ubuntu/

and you need this mcrypt extension and you have to manually install this by following this link:

https://computingforgeeks.com/install-php-mcrypt-extension-on-ubuntu/

During Installation follow this link as general steps.

https://www.mageplaza.com/devdocs/how-install-magento-2-ubuntu.html

Magento 2 needs you to setup and configure Varnish.

https://devdocs.magento.com/guides/v2.4/config-guide/varnish/config-varnish-configure.html

Magento 2 also needs you to setup and configure ElasticSearch.

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-elasticsearch-on-ubuntu-20-04

** You may possibly experience some issues with Elasticsearch memory problem so I would suggest you try to increase the RAM if that happen. 
Magento 2.4.x