Python API Development with FastAPI
Working with Databases
Database Windows Install
This article demonstrates how to install PostgreSQL on a Windows machine with a step-by-step walkthrough. Follow the instructions below and refer to the accompanying images to guide you through the process.
Step 1: Locate the PostgreSQL Website
Begin by opening your preferred web browser and searching for “PostgreSQL.” Typically, the PostgreSQL website appears as the first result. Click on the link that directs you to PostgreSQL.org.
Step 2: Download the Windows Installer
Once on the PostgreSQL website, locate and click the Downloads button, and then select Windows. At the top of the Windows download page, click the link to download the installer.
On the download page, you will find a list of available PostgreSQL versions. The latest version is currently 13.4, though you may choose a newer version if available. The installation process remains largely the same across versions. After the download is complete, run the installer. If a User Account Control (UAC) prompt appears, click Yes to proceed.
Step 3: Run the Installer
When the installer opens, click Next on the welcome screen. The default installation directory is pre-selected; most users do not need to modify this path.
The installer then presents you with options for the components to install:
- PostgreSQL Server: The core database engine.
- PgAdmin: A graphical tool that simplifies managing your PostgreSQL instance. It is recommended to install PgAdmin for easier database administration.
- Stack Builder: An optional feature that assists in installing extensions and additional tools for PostgreSQL. For basic usage, you can leave this option checked.
- Command Line Tools: Essential for performing database operations via the command line. It is advisable to retain these tools for future tasks.
Continue through the installer by accepting the default data directory settings.
Step 4: Configure the Database
You will now be prompted to establish a password for the superuser account. Make sure to select a secure password and remember it for future use.
Note
Keep your superuser password secure as it is critical for managing your PostgreSQL instance.
Next, you will be asked to specify the port on which PostgreSQL will run. The default port is 5432. While you can change this port, it is recommended to use the default to avoid configuration complications.
After verifying your settings, click Next to begin the installation process.
Step 5: Complete the Installation
Once the installation is complete, click Finish. To manage your PostgreSQL instance, launch the PgAdmin application. You can locate PgAdmin by searching for it in the Windows start menu.
In the next part of this lesson, we will explore how to create individual database instances and tables using PgAdmin. This foundational knowledge will help you get started with database management and development using PostgreSQL on Windows.
Happy installing!
Watch Video
Watch video content