Localhost Drupal Install on Linux shows file and not site
Just to get the question answered:

You missed the step about setting up Apache and PHP in the installation guide you read. In particular, you have to follow the How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 16.04 guide from DigitalOcean - linked to in the installation guide.