PostgreSQL – Installing PostgreSQL Without Admin Rights on Windows
Last Updated :
04 Nov, 2024
For developers working in corporate environments, admin privileges to install software might be restricted. But if we’re looking to explore PostgreSQL on our own, here’s a step-by-step guide on installing PostgreSQL without admin rights on a Windows system. Follow this guide to set up PostgreSQL manually, create a database, and verify the installation without requiring administrative permissions.
Installing PostgreSQL Without Admin Rights on Windows
This section covers the entire process of manually setting up PostgreSQL, from downloading binaries to configuring our environment for easy access. By following these steps, you’ll have PostgreSQL running on your system, enabling us to work with databases seamlessly without admin access.
Step 1: Download PostgreSQL Binaries
To begin, we’ll need the PostgreSQL binary files rather than the standard installer:
- Visit the official PostgreSQL binaries download page.
- Choose and download the version you want in ZIP format (e.g., PostgreSQL 13).
- Save the downloaded file in a location where you have full access, such as
D:\PostgreSQL
.
Step 2: Extract and Organize the Files
After downloading, follow these steps to organize PostgreSQL on your system:
- Create a new folder (e.g.,
D:\PostgreSQL\pgsql
) to serve as your PostgreSQL directory.
- Extract the ZIP file into this folder. Your directory should look like this after extraction:

PostgreSQL zip binaries after extraction
Step 3: Set Environment Variables for PostgreSQL
Adding PostgreSQL to your Environment Variables allows you to run PostgreSQL commands from any command prompt window:
- Go to System Properties > Advanced System Settings.
- Under Environment Variables, find the Path variable in your user section and add the path to the PostgreSQL
bin
directory, such as D:\PostgreSQL\pgsql\bin
.

Configuring User Environment Path Variable
Well, Congratulations!!. At this point, we have successfully configured PostgreSQL in your windows system.
Step 4: Verify the Installation
To verify if it is installed properly, use the following commands. Hence, the below command checks the PostgreSQL server version:
postgres -V

Check PostgreSQL Server Version
The below command checks the PostgreSQL client version:
psql -V

Check PostgreSQL Client Version
Step 5: Initialize the Database
Now it is time to initialize the database and associate a user to this. The database will be initialized at the location given by us (data folder in this case). The command for this is as follows:
initdb -D D:\PostgreSQL\pgsql\data -U postgres -E utf8
Explanation of flags:
- –D path/to/db/server/: Specifies the directory where PostgreSQL data files are stored.
- -U name: Creates a superuser with the specified name.
- -W: Prompts for a password for the superuser.
- -E encoding: Sets the character encoding for the database (e.g., utf8).
- -A: Encrypts the superuser’s password for added security.

PostgreSQL initdb
Step 6: Start the PostgreSQL Server
Start the database by running the following command. This command starts PostgreSQL and logs its activities in a logfile
.
pg_ctl -D D:\PostgreSQL\pgsql\data -l logfile start

Start Database Server
Step 7: Configure pgAdmin for Database Management
- Now navigate to the location of your PostgreSQL binary folder and traverse to the following path as shown in the figure.

- Double click on pgAdmin4 application. Now a pgAdmin4 instance will load into the system’s default browser.

pgAdmin4 Home Page
- Set a master password to secure the server.
- Now click on Servers on the right-hand side to create a new server for your database. Fill in the required details.
Step 8: Creating a Database
Once our server is running, we can create a new database using either psql
or pgAdmin. Click on the Database section to create a new database for our work purpose and begin using it. Here’s the command to create a sample database named school
.
CREATE DATABASE school;
Step 9: Stopping the PostgreSQL Server
To stop the database, use the same command used for start database as used in Step 8 and replace start by stop.
pg_ctl -D D:\PostgreSQL\pgsql\data -l logfile stop
Setting Up Binary Paths for Advanced Utilities
To access advanced utilities in pgAdmin like backup, restore, and upgrade, set up the binary paths:
- In pgAdmin, go to File > Preferences.
- Navigate to Paths > Binary Paths and add your PostgreSQL
bin
path (e.g., D:\PostgreSQL\pgsql\bin
).

PostgreSQL Binary Path
Conclusion
With this guide, we can now install PostgreSQL on Windows without admin rights and have complete control over the database environment. By following these steps, we’ll be able to fully use PostgreSQL, create and manage databases, and work with pgAdmin4 without needing administrator permissions on our machine. This setup allows developers to explore PostgreSQL’s powerful capabilities in restricted environments, maximizing productivity and flexibility.
Similar Reads
Install PostgreSQL on Windows
Installing PostgreSQL on your Windows 10 machine is straightforward with the PostgreSQL installer. In this article, we'll walk you through installing PostgreSQL version 11.3, ensuring a smooth setup process. Steps to Install PostgreSQL on WindowsThere are three crucial steps for the installation of
2 min read
How to Download and Install Proteus Software on Windows?
Proteus is Software used to draw and design and integrate electronic circuits. After designing circuits by taking various parts like Switch, Microcontrollers, LED it also provides to simulate and test designed circuit. After testing in real-time we can go to make this circuit practically in our phys
3 min read
How to Install SQL Server Client on Windows?
The Client / Server Application is a computer program that allows users to access what is stored on the server. Of course, both computers can be workstations running the same type of operating system. In most network environments, the server contains a database that requires users to access this dat
2 min read
How to Install SQL Server Agent on Windows?
SQL Server Agent is a component of Microsoft SQL Server. It schedules jobs and handles other automated task on a database.This windows service can automatically start when we boot up the system or set it up manually. SQL Server Agent enables us to automate all the task which are repetitive in nature
3 min read
How to Install PostgreSQL on a Mac with Homebrew
Homebrew is a popular manager that is used for the installation of different types of software in the Mac as well as Linux operating systems. we can use Homebrew for installing other software instead of running specific commands. This improves the security as compared to not using homebrew for the i
6 min read
How to install Django with NGINX, Gunicorn, and PostgreSQL on Ubuntu?
This article describes how to install and configure Django with PostgreSQL, Gunicorn, and Nginx on your Ubuntu machine. First, let's look at an overview of all the tools we use. Django is a robust, free, open-source, Python-based web framework that follows the MVT (Model-Template-View) architectural
6 min read
PostgreSQL - Connect To PostgreSQL Database Server in Python
The psycopg database adapter is used to connect with PostgreSQL database server through python. Installing psycopg: First, use the following command line from the terminal: pip install psycopg If you have downloaded the source package into your computer, you can use the setup.py as follows: python s
4 min read
How to Export PostgreSQL Database Without Data Using SQL?
When we are working with the PostgreSQL database, there are multiple times we need to export the database structure. This approach is useful when we create a skeleton database or migrate the schema changes for different environments or systems. In this article, we will explore the process of exporti
3 min read
How to Install Python-PyGreSQL on Ubuntu?
Python-PyGreSQL is a python module that interfaces to the popular PostgreSQL database. Python-PyGreSQL implants the PostgreSQL database query library to permit simple use of the powerful PostgreSQL features from Python script. In this, article, we will look into the steps of installing the Python-Py
2 min read
How to Install SQLplus on Windows?
Sqlplus is an interface provided by Oracle database to interact only with Oracle Database. It is having the flexibility to write some Oracle specific code. Sqlplus is a tool created by Oracle for its Oracle DB. It is a very popular tool since it comes. It has its own syntax in addition to supporting
2 min read