Ever since WordPress 5.1 it has not installed correctly, no idea why.
Every time I have to manually configure wp-config.php because of errors with establishing a database connection.
Ubuntu 16.04 clean install tested on 2 different servers.
Both times, empty wp-config.php
I recommend installing older version to get it to work possibly.