How to setup an Ubuntu Linux VM For Udacity NanoDegree

These are the items to setup a Linux virtualbox machine using Linux Ubuntu to practice you projects and create your projects. This will help you if you have a windows computer and you don't have to buy a new Macbook OS computer. Best of all, its free!

  1. Virtual Box - First thing you will need a virtual box, you can download at - very easy to install
  2. Linux Ubuntu - Download the latest version of ubuntu ISO file at [My current version is 20]
  3. Create a Virtual Machine in VirtualBox
  4. Install VirtualBox Additions [Optional]
  5. On the new machine, go to settings > Storage and attached the ISO file you downloaded from ubuntu. This will allow the virtual machine to boot from your ISO file. Then start the virtual machine and follow the installation prompts, its very easy, just follow the instructions. When you get to the prompt to install the minimal or regular version, I suggest you install the regular version which includes some useful tools like openoffice and browsers.
  6. By now you should have a brand new clean install of Ubuntu in your virtual Machine. The following you software, apps and utilities you will need to install:

Important: I am putting this here for beginners to clear confusion. Do not enter the $ in the command, the dollar sign is not part of the command, therefore, omit it from the commands below, this is only used to reference a linux command.

Install Python3:

To install python version 3 open a terminal and execute this command:

$ sudo apt-get update

$ sudo apt-get install python3

After the installation is completed, validate you have it installed with this command:

$ python3 --version

Install pip

$ sudo apt install python3-pip

After pip completes installation, validate you have it installed with this commnad:

$ pip3 --version

Install PostgreSQL

To install PostgreSQL, as well as the necessary server software, run the following command:

$ sudo apt-get install postgresql postgresql-contrib

* If you need help installing postgresql, here a nice tutorial with more details
Follow these steps:

Install pgAdmin

UPDATE: follow these instructions to install:


To install pgAdmin in ubuntu, I did not have to send a command. You can install it by going into the Ubuntu Software Application and searching for pgadmin. This person create a nice video showing you on to install and configure postgresql with pgAdmin and it shows how to install pgadmin with ubuntu software.

Install psycopg2

$ sudo apt-get install python3-psycopg2

The commands in the instructions by Udacity did not work well with me, so I used these commands to do certain functions like:

To create database :
$ sudo -u postgres createdb udacity

$ sudo -u postgres dropdb todoapp

$ sudo su - postgres
# psql

These are the psql commands I used the most during their videos:


show all the tables

\d table1

\c <dbName>


Install Visual Studio Code

To install VS Code, is simple as installing pgAdmin, just go to the Ubuntu Software application and seach for vs code and click the install button

Install Flask

$ sudo pip3 install flask

Install Flask-Migrate 

$ sudo pip3 install Flask-Migrate

Install flask-sqlalchemy

$ sudo pip3 install flask-sqlalchemy

This setup worked for me, I followed along the code with the instructor and my scripts worked.