Week 2 - Software Setup
Last updated
Last updated
This lab's purpose is to set up a data warehousing development environment (Layer 1 in the OLAP Architecture, as shown below) on your local machine. This includes installing PostgreSQL, and visualization tools such as Power BI (for Windows users) or Tableau (for Mac users). By setting up the environment on your own machine, you will have full control over all the software tools. We strongly recommend completing this setup on your own device.
What we will need for this:
git
: we only need you to have git installed and can git
clone
docker
and docker compose
If you are not familiar with Docker, we know that there is no Unit in UWA officially teaching Docker, so we wrap up a tutorial .
To install and learn about git, check this .
We have several options to get a PostgreSQL database. You only need to choose ONE of these three options.
Option 1: Install databases locally
Download and set up the database environment on your own device independently
Option 2: Running database with Docker locally
This is the easiest way, as we have done the complex setup work for you. However, you will need to understand how it works.
Note: Errors may occur if you have previously installed PostgreSQL locally.
Option 3: Uni Shared Server
Uni IT has deployed a shared server for all students enrolled in this Data Warehousing unit. You can use your assigned account name and password to log in to the shared server. However, this is the slowest solution. We only recommend this option for users who cannot use their own devices.
No matter which option you choose, you should be able to connect to the PostgreSQL database via either a GUI tool or a command-line tool and perform operations on the database.
In the PostgreSQL ecosystem, there is a tool called pgAdmin 4, developed by the official PostgreSQL team. It provides capabilities for running SQL queries, monitoring database status, viewing data, setting up users, and more.
But do not mess it up here. All the GUIs or command-line tools are methods for connecting to the database engine; they are not database engines and can not replace them.
You can install and run PostgreSQL directly on your machine. You can download PostgreSQL using the links below.
During the installation process, you'll be prompted to set a password for the default 'postgres' superuser account. Make sure to remember this password.
Complete the installation by following the prompts, and uncheck the 'Launch Stack Builder' box before clicking Finish.
To manage your PostgreSQL server, launch pgAdmin 4 by searching for it on your machines.
When logging in for the first time, you'll need to configure a new server connection. Click the 'Add New Server' button.
Under the 'General' tab, enter your preferred Server name.
Under the 'Connection' tab:
Set 'Host name/address' to 'localhost'
Enter the password you created during installation
Verify the port number (default is 5432, but you may change it during the installation process)
Click 'Save' to complete the configuration"
Once connected, you can view your server in the Object Explorer panel. The server will appear under 'Servers' with the name you provided (e.g., 'DW_2025').
To use the Docker solution, first, clone a GitHub repository.
Subsequently, installing and running Docker on your machine.
The process of installing Docker Desktop is straightforward. You use the installer for your particular operating system.
Use the command below in the terminal to run the hello-world file in Docker:
After running the above command, you should see a message below, which means your docker has been successfully installed on your device.
This command below will bring up a PostgreSQL database.
If the previous command doesn't work, please try the command below:
If any errors regarding SQL Server are encountered, please ignore them. We won't use SQL Server this semester anymore. As long as PostgreSQL works well, that will be sufficient.
All the variables can be found in the docker-compose.yml
file within the repo, you can try to find out how they match together.
User name: admin@admin.com
Password: root
After you login to the pgAdmin, then you will need to add a new server if it is your first time to log in.
Click on 'Add New Server', and enter your preferred Server name under General.
Switch to the Connection tab, and enter the Host name/address. The username and password can be found in docker-compose.yml
. also
username: postgres
password: postgres
host name/address: pgdb
port: 5432
Finally, click on 'Save'.
If you have done all the steps above successfully, you will see the screenshot in the Object Explorer panel below.
After this, clean your docker images, then you can run it with docker image prune
(or docker system prune
if you want to clean all unused Docker objects).
This solution is highly not recommended. Use this solution only if you have failed the Docker solution and the local solution.
The shared server solution only works with Unifi. If you implement this solution on a network other than Unifi, you must first set up the UWA VPN - UniConnect on your machine.
Under the 'Connection' tab:
Set 'Host name/address' to 'ems-win-058.uniwa.uwa.edu.au'
Enter the Username you received in the email from Luke.
Enter the Password you received in the email from Luke.
Verify the port number: 5432
Click 'Save' to complete the configuration"
Once connected, you can view your server in the Object Explorer panel. The server will appear under 'Servers' with the name you provided.
You can use any code editor, such as VSCode or Jupyter Notebook while working with psycopg2
.
Use the command below to install psycopg2
.
Set up connection parameters.
Connect to the database. These two lines establish a connection to the PostgreSQL database using the provided connection parameters and create a cursor object that allows you to execute SQL commands and fetch results.
Connection test. If you connect the database successfully, you can see the PostgreSQL version.
You have 2 options to install and run visualization tools.
Windows users: either Power BI or Tableau
Mac users: Tableau only
Below, you will find detailed instructions for downloading and installing these applications on your respective operating systems.
Download now: Clicking this button will redirect you to Microsoft Store.
Advanced download options: Download the .exe installer and follow the setup steps.
Alternatively, you can open the Microsoft Store on your machine, then search for "Power BI". Click "Power BI Desktop" to open the installation page.
Activate with product key:
If you already have a copy of Tableau Desktop installed. Update the license key in the application Help menu → Manage Product Keys or activate with a product key.
Important: You can only use Tableau with the product key for non-commercial academic research.
Please feel free to explore the features of PostgreSQL and Power BI/Tableau.
Mac OS X: Click .
Windows x86-64: Click .
Move to to install visualisation tools.
There are multiple approaches to clone the repository. For example, download the zip file via the link or use the git
command to clone the repository. But we do recommend you do it via git clone
.
For more details read .
If you are not familiar with Docker, we know that there is no Unit in UWA officially teaching Docker, so we wrap up a tutorial .
You can get a more comprehensive overview of what Docker is from .
Mac - Intel Chips: Click .
Mac - Apple Silicon: Click .
Windows - AMD64: Click .
Windows - ARM64 (Beta): Click .
Once you test Docker successfully, run your terminal under the cloned repository folder (e.g. DW_2025), and then run the file. (please note, the process may take a while on your machine).
Read the file and the whole project, understand what we are trying to do first.
After starting the container, click the for pgadmin4 to open PostgreSQL with your browser. (You don't need to download PgAdmin 4 on your devices). Use the following information to login pgAdmin:
Please refer to download and install PostgreSQL on a device. Launch pgAdmin 4 by searching for it on the device and add a new server.
There are multiple Python libraries that can be used to connect a PostgreSQL server. For example, , , , and so on.
Visit and download Power BI Desktop.
First an existing account, or a new account using your student email.
Once signed in, visit the to download the 2024.3.4 or 2024.3.3 versions of Tableau Desktop and Tableau Prep Builder
For more information , you can search and (Mac version).