How to Install PostgreSQL and PGAdmin on Ubuntu 24.04 LTS

How to Install PostgreSQL and PGAdmin on Ubuntu 24.04 LTS

Learn how to *install PostgreSQL and PGAdmin on Ubuntu 24.04 LTS* step by step. PostgreSQL is a powerful open-source relational database system, and PGAdmin is a feature-rich GUI tool for managing PostgreSQL databases. In this guide, we’ll cover how to set up both tools, configure them, and start using them efficiently. br br ---br br What You’ll Learn: br 1. Installing PostgreSQL on Ubuntu 24.04 LTS. br 2. Installing and setting up PGAdmin. br 3. Configuring PostgreSQL to work with PGAdmin. br br ---br br Steps to Install PostgreSQL br br #### 1. *Update System Packages* br Keep your system up to date: br ```bashbr sudo apt update && sudo apt upgrade -ybr ``` br br #### 2. *Install PostgreSQL* br Install the PostgreSQL database server: br ```bashbr sudo apt install postgresql postgresql-contrib -ybr ``` br br #### 3. *Start and Enable PostgreSQL* br Ensure the PostgreSQL service is running and enabled at boot: br ```bashbr sudo systemctl start postgresqlbr sudo systemctl enable postgresqlbr ``` br br #### 4. *Switch to PostgreSQL User* br Switch to the default PostgreSQL user to configure the database: br ```bashbr sudo -i -u postgresbr ``` br br #### 5. *Access PostgreSQL Prompt* br Enter the PostgreSQL shell: br ```bashbr psqlbr ``` br Create a new database user or modify configurations as needed. br Exit the shell using: br ```sqlbr \qbr ``` br br ---br br Steps to Install PGAdmin br br #### 1. *Install Dependencies* br Install required dependencies: br ```bashbr sudo apt install curl ca-certificates -ybr ``` br br #### 2. *Add the PGAdmin Repository* br Import the repository key and add the PGAdmin repository: br ```bashbr #### 3. *Install PGAdmin* br Update the package list and install PGAdmin: br ```bashbr sudo apt updatebr sudo apt install pgadmin4-web -ybr ``` br br #### 4. *Configure PGAdmin* br Run the setup script to configure PGAdmin: br ```bashbr sudo usrpgadmin4binsetup-web.shbr ``` br Set up an admin email and password for accessing the PGAdmin web interface. br br #### 5. *Access PGAdmin* br Open a browser and go to `` or ``. br Log in using the admin credentials you set earlier. br br ---br br Connect PostgreSQL to PGAdmin br 1. Open PGAdmin and add a new server. br 2. Provide the *name* for the server. br 3. Under the *Connection* tab, add: br Host: `localhost` br Port: `5432` br Username: `postgres` br Password: The password set for the `postgres` user. br 4. Save the configuration and start managing your PostgreSQL databases. br br ---br br Why Use PostgreSQL and PGAdmin? br **PostgreSQL**: Reliable, feature-rich, and highly extensible database. br **PGAdmin**: Simplifies database management with a user-friendly GUI. br br By following these steps, you’ll have PostgreSQL and PGAdmin installed and ready for use on Ubuntu 24.04 LTS.


User: online

Views: 15

Uploaded: 2024-11-27

Duration: 23:33

Your Page Title