TiloBox
Back to directory
LicenseMIT
GitHub stars9.5k
Last commit1 months ago
Tags6 topics
Web UiSelf HostedSqlPostgresqlDatabaseGolang
Overview

Why consider pgweb?

pgweb is a lightweight, cross-platform web interface for PostgreSQL databases. It runs as a single Go binary with no dependencies, providing schema browsing and SQL query execution.

Guided learning

Learn pgweb by building

Practical setup notes, real use cases, and copy-ready examples in one focused guide.

3 min read 11 sections
In this guide11 sections

What is pgweb?

pgweb is an open-source, ultra-lightweight web-based browser for PostgreSQL databases, developed with Go and JavaScript. It operates as a minimal, zero-dependency alternative to heavy database management tools like pgAdmin4 for quick PostgreSQL schema exploration and query execution.

pgweb ships as a single statically compiled Go binary that launches an integrated web server—no Node.js, no Python, no Docker required. Open your browser, and you immediately have a clean PostgreSQL interface for browsing tables, running SQL queries, exporting data, and inspecting schemas.

Who Is It For?

  • Developers: Quickly inspecting PostgreSQL schema and data on development servers without installing a full desktop GUI.
  • DevOps Engineers: Running a lightweight database browser on cloud servers accessible via SSH port-forwarding.
  • Database Administrators: Providing non-technical stakeholders with a simple web interface for read-only database queries.

Key Features

  • Single Go binary deployment: No dependencies, runtime, or package manager required.
  • Full PostgreSQL compatibility: Connect to any PostgreSQL 9.x+ server including remote production databases.
  • Multi-connection bookmarks: Save and switch between multiple database connections.
  • SQL query editor with result export: Execute arbitrary SQL and export results as CSV or JSON.
  • Schema browser: Inspect tables, columns, indexes, constraints, views, and stored functions.

Installing and Running pgweb

bash
1# macOS via Homebrew
2brew install pgweb
3
4# Linux - direct binary download
5wget https://github.com/sosedoff/pgweb/releases/download/v0.17.0/pgweb_linux_amd64.tar.gz
6tar -xzf pgweb_linux_amd64.tar.gz
7chmod +x pgweb_linux_amd64
8./pgweb_linux_amd64

Connect to a specific PostgreSQL database at startup:

bash
1./pgweb --host localhost --user postgres --db mydb --ssl disable

Or using a connection URL:

bash
1./pgweb --url "postgresql://user:password@host:5432/dbname?sslmode=disable"

pgweb opens at http://localhost:8081 automatically.

Running pgweb with Docker

bash
1docker run --rm -p 8081:8081 sosedoff/pgweb --host your-postgres-host --user postgres --db mydb --ssl disable

Practical Use Cases

1. Quick Development Database Inspection

A developer SSHes into a staging server and runs pgweb --url $DATABASE_URL, instantly opening a browser interface to inspect production-mirrored data.

2. SSH Port-Forwarded Remote Access

A developer tunnels pgweb through SSH (ssh -L 8081:localhost:8081 myserver), browsing a private production database safely without exposing PostgreSQL ports.

3. Stakeholder Self-Service Reporting

A data team deploys pgweb on an internal server, giving non-technical analysts a web UI to run pre-saved SELECT queries against the reporting database.

Troubleshooting and Limitations

  • Read-Only Mode: Use the --read-only flag to prevent users from executing INSERT, UPDATE, or DELETE statements—essential when exposing pgweb to non-administrative users.
  • Authentication: pgweb itself has no built-in authentication; protect access with an Nginx HTTP Basic Auth reverse proxy or restrict to localhost-only binding.

Official Resources

Related tools

More options with a similar category or technology profile.

pgweb FAQs

pgweb is listed as a Developer Tools tool on TiloBox. Review the overview, features, and official documentation on this page to decide whether it solves your specific workflow.

Start with the project's GitHub repository and official website for supported installation and deployment instructions. Test the setup with representative data or a small project before rolling it out more widely.

pgweb is listed under the MIT license. Read the complete license text and the project's notices before using, modifying, or distributing the software.

Production readiness depends on your requirements. Review maintenance activity, security practices, documentation, backup and upgrade procedures, and compatibility with your stack; then validate it in a non-production environment.

pgweb is listed as an alternative to DBeaver. Compare the core workflow, deployment model, integrations, and licensing against your must-have requirements before switching.