DEV Community

Cover image for Install pgAdmin on Ubuntu And connect RDS with pgAdmin
Techpointby
Techpointby

Posted on

Install pgAdmin on Ubuntu And connect RDS with pgAdmin

want to use pgAdmin to connect with AWS RDS (PostgreSQL). Let’s do this step by step.

1. Install pgAdmin on Ubuntu

Run these commands in terminal:

# Update system
sudo apt update && sudo apt upgrade -y

# Install curl, wget, gnupg (if missing)
sudo apt install curl wget ca-certificates gnupg -y

# Add pgAdmin repo key
curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/pgadmin.gpg

# Add repo to sources list
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list'

# Update repos
sudo apt update

# Install desktop + web version (recommended)
sudo apt install pgadmin4 -y

Enter fullscreen mode Exit fullscreen mode

2. Run pgAdmin

  • For desktop mode:
pgadmin4
Enter fullscreen mode Exit fullscreen mode

(It opens pgAdmin GUI)

  • For web mode (browser):
sudo /usr/pgadmin4/bin/setup-web.sh
Enter fullscreen mode Exit fullscreen mode
  • It will ask you for pgAdmin email + password (used only for login).
  • After setup, pgAdmin web will run at: 👉 http://127.0.0.1/pgadmin4

3. Connect AWS RDS to pgAdmin

  1. Open pgAdmin (desktop or web).
  2. Right-click Servers → Create → Server.
  3. Enter details:
    • Name: AWS RDS
    • Host name/address: your RDS endpoint
    • (e.g. mydb.c9akciq3lqxy.us-east-1.rds.amazonaws.com)
    • Port: 5432
    • Username: (the master username you set, e.g. admin)
    • Password: (your master password)
    • Save.

4. Fix Security Group in AWS

If connection fails:

  1. - Go to AWS Console → RDS → Databases → your DB → Connectivity & security.
  2. - Check VPC security groups.
  3. - Edit inbound rules:
  • Add rule: PostgreSQL (5432) → My IP (your Ubuntu machine’s public IP).(Find IP with curl ifconfig.me).

5. Test Connection from Ubuntu (Optional)

Before pgAdmin, you can check with psql:

sudo apt install postgresql-client -y

psql -h your-rds-endpoint -U admin -d postgres
Enter fullscreen mode Exit fullscreen mode

It will ask for password → then connect.

✅ Now your Ubuntu + pgAdmin is ready, and you can see AWS RDS database, run queries, manage tables, etc.

Top comments (0)