Using doom-emacs-install-scripts: It is possible to compile and install Doom Emacs with one command.
curl -fsSL https://github.com/infstate/doom-emacs-install-scripts/raw/refs/heads/main/doom-universal-linux.sh | sh
This script should install the requirements for building Emacs 29.4 + native comp on Ubuntu 24.04.1 LTS or Ubuntu 24.10.
There are also other scripts in case you are on other distros or want to install less packages.