๐๏ธ
Database Admin
pgAdmin 4
Web interface โ login required
๐
Documentation
GitHub Docs
Setup guides & user management
New Users โ Getting Started
- Request database credentials from your administrator (host, port, database name, username, password).
- Choose how to connect โ use pgAdmin below for a GUI, or Python for scripting and data analysis.
- Read the full New User Getting Started Guide for detailed instructions and troubleshooting.
Connecting to the Database
-
Open pgAdmin 4 in your browser and log in with your credentials.
Or install the pgAdmin desktop app on your own machine โ same steps apply. - Right-click Servers in the left panel โ Register โ Server.
-
Fill in the Connection tab:
Host: vcloud229.it.ox.ac.uk
Port: 5432
Database: <your_database>
Username: <your_username>
Password: <your_password> - Under the SSL tab set SSL mode to Require.
- Click Save. Your databases will appear in the left panel.
-
Install the required library:
# in your terminal or conda environment
pip install psycopg2-binary -
Store credentials in environment variables โ never hard-code passwords:
# add to ~/.bashrc, ~/.zshrc, or a .env file
export PG_HOST=vcloud229.it.ox.ac.uk
export PG_PORT=5432
export PG_DB=your_database
export PG_USER=your_username
export PG_PASS=your_password -
Connect and query:
import psycopg2, os
conn = psycopg2.connect(
host=os.environ["PG_HOST"],
port=os.environ["PG_PORT"],
dbname=os.environ["PG_DB"],
user=os.environ["PG_USER"],
password=os.environ["PG_PASS"],
sslmode="require" # always encrypt in transit
)
with conn.cursor() as cur:
cur.execute("SELECT * FROM my_table LIMIT 5;")
for row in cur.fetchall():
print(row)
conn.close() -
For pandas / data analysis:
import pandas as pd, os
from sqlalchemy import create_engine
# pip install sqlalchemy psycopg2-binary
url = (
f"postgresql+psycopg2://{os.environ['PG_USER']}:{os.environ['PG_PASS']}"
f"@{os.environ['PG_HOST']}:{os.environ['PG_PORT']}/{os.environ['PG_DB']}"
"?sslmode=require"
)
engine = create_engine(url)
df = pd.read_sql("SELECT * FROM my_table LIMIT 100", engine)
Security reminders: Always use
sslmode="require" to encrypt data in transit.
Never commit passwords to git โ use environment variables or a .env file and add it to .gitignore.
Administrators โ Documentation
-
PostgreSQL Setup Guide โ Installation, LVM storage, performance tuning
-
User Management Guide โ Create users, set permissions, configure authentication
-
pgAdmin Setup Guide โ Install and configure the web interface
-
SSL & DNS Setup Guide โ HTTPS, Let's Encrypt, auto-renewal, IP restrictions
-
LVM Expansion Guide โ Expand storage volumes when needed