Adding PostgreSQL to Laragon
Dendi Handian

Dendi Handian @dendihandian

About: Data Engineer - Building Data Lake & Modern Data Architecture

Location:
Jakarta
Joined:
Oct 13, 2019

Adding PostgreSQL to Laragon

Publish Date: Mar 7 '22
81 9

Downloading The PostgreSQL Binary

You can find any version you want to install at enterprisedb.com/download-postgresql-binaries and make sure it support your windows machine.

Extract and Move The Binary to Laragon Directory

Let's say I have downloaded the postgresql-12.10-1-windows-x64-binaries.zip. Extract it and it contains a single folder named pgsql. Move this pgsql folder into C:\laragon\bin\postgresql (You may have to create the postgresql folder first) and then rename it into the corresponding version you have downloaded or simply just name it after the downloaded zip name.

postgresql laragon directory

Starting The PostgreSQL Server

Restart the Laragon and now the PostgreSQL menu should be available and you could start it right away.

postgresql laragon menu

PHP and Laravel Setup

If you are using PHP or Laravel, then make sure to enable the pdo_pgsql extension.

Image description

and the laravel environment for postgres database as default:



DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=postgres
DB_USERNAME=postgres
DB_PASSWORD=root

Enter fullscreen mode Exit fullscreen mode




Managing using PgAdmin

PgAdmin is also available for you to manage a PostgreSQL database, just like you use PhpMyAdmin for MySQL. Make sure postgresql run first and click on "PgAdmin" menu to start.

Enter "root" for the admin password when prompted to login.

You need to create a connection to the postgresql in the laragon, so here is the setup as example:

Image description

Image description

After you save it, it should connect the pgadmin to the postgresql server and you can start to create a database.

Image description

Managing using Adminer

If you're using Laragon full installation, adminer could also works for you. Adminer could manage different types of rdbms like MySQL, SQLite, and PostgreSQL, and some other type of databases as well like Oracle, MS SQL, Mongodb, Elasticsearch but they still in development phase.

Make sure your laragon apache is started and just go to http://localhost/adminer/.

Comments 9 total

  • Ahmed Hani
    Ahmed HaniAug 21, 2022

    There's a problem with the binaries, the 2 most recent versions of postgresql on the site don't extract well and I can't continue with the guide

    • Dendi Handian
      Dendi HandianAug 22, 2022

      Try version 12.x then

      • Ahmed Hani
        Ahmed HaniAug 31, 2022

        The problem was in windows extracting the .zip file, it worked fine using 7-zip

  • Fabian Lopez
    Fabian LopezFeb 27, 2023

    Hello, how to add pgadmin in Laragon?

    • Dendi Handian
      Dendi HandianFeb 27, 2023

      pgadmin should be available in the postgresql binary for windows (see the first picture above. there is pgadmin 4 folder) or maybe recent version doesn't include the pgadmin?

      • GafrielAR
        GafrielARAug 7, 2023

        Image description
        in my case i don't see pgadmin in postgresql menu, what do i do?

        • Dendi Handian
          Dendi HandianAug 8, 2023

          I'm not following recent postgresql version, so you need to check if pgadmin is available in the downloaded binary folder. If it's available, then the laragon not recognize it.

          Alternatively, you can use Adminer. Check my laragon series.

  • Sadewo Brilian Rafael
    Sadewo Brilian RafaelDec 8, 2023

    Just sharing my experience... I use HeidiSQL to explore the PostgreeSQL databases instead using pgadmin. So, i just need to install this postgreesql to laragon. Its easy to connect and operate, and support mysql too. It's very suitable for me...

Add comment