I figured it out:
1. sudo nano /etc/php/7.4/cli/php.ini
2. uncomment ;extension=pgsql and ;extension=pdo_pgsql
3. sudo apt-get install php7.4-pgsql << choose your php version here
4. sudo ufw allow 5432/tcp
5. service apache2 restart
postgresql is now an option in the dropdown