# Mathesar — Open-Source Database Interface for PostgreSQL > Mathesar is a self-hosted web application that provides a spreadsheet-like interface for PostgreSQL databases, letting non-technical users browse, query, and manage data without writing SQL. ## Install Save in your project root: # Mathesar — Open-Source Database Interface for PostgreSQL ## Quick Use ```bash docker run -d --name mathesar -p 8000:8000 -e DJANGO_DATABASE_URL=postgresql://user:pass@host:5432/mathesar_django -e MATHESAR_DATABASES="(your_db|postgresql://user:pass@host:5432/your_db)" mathesar/mathesar-prod:latest # Open http://localhost:8000 — create admin account on first visit ``` ## Introduction Mathesar is an open-source web application that provides an intuitive spreadsheet-like interface on top of PostgreSQL databases. It bridges the gap between raw database access and business user needs, letting anyone explore tables, filter records, create views, and edit data without writing SQL queries. ## What Mathesar Does - Displays PostgreSQL tables and views in a spreadsheet-style grid with inline editing - Supports filtering, sorting, grouping, and searching across any column or combination - Lets users create and manage database schemas, tables, columns, and constraints through the UI - Handles foreign key relationships visually, linking related records across tables - Provides role-based access control to limit who can view or edit specific schemas and tables ## Architecture Overview Mathesar is a Django web application with a Svelte frontend that communicates with PostgreSQL through SQLAlchemy and raw SQL. It connects directly to your existing PostgreSQL database rather than duplicating data into its own store. The application maintains a separate internal Django database for user accounts, permissions, and UI state. All data operations translate to standard SQL executed against your PostgreSQL instance. ## Self-Hosting & Configuration - Deploy via Docker with a single container; point it at any existing PostgreSQL 13+ database - Configure database connections through environment variables or the web UI on first setup - Separate Django database stores Mathesar user accounts and metadata (can be SQLite or PostgreSQL) - Supports connecting to multiple PostgreSQL databases from a single Mathesar instance - Reverse proxy setup with Nginx or Caddy recommended for production with HTTPS ## Key Features - Spreadsheet-like data editing that works directly on PostgreSQL with no data sync layer - Schema management UI for creating tables, columns, constraints, and relationships visually - Exploration views with saved filters, grouping, and column visibility for repeatable queries - Foreign key navigation that lets users jump between related records across tables - No data duplication: all reads and writes go directly to your PostgreSQL database ## Comparison with Similar Tools - **NocoDB** — Spreadsheet UI for multiple databases; adds an abstraction layer over the DB - **Baserow** — No-code database platform; manages its own data store rather than connecting to yours - **Retool** — Internal tool builder; broader scope but SaaS-focused and not a direct DB interface - **pgAdmin** — PostgreSQL admin tool; powerful but designed for DBAs, not business users - **Metabase** — BI and analytics tool; read-only exploration, not for data editing ## FAQ **Q: Does Mathesar modify my database schema?** A: Only if you explicitly use the schema management features to add tables or columns. Browsing and editing data does not alter your schema. **Q: Can non-technical users safely edit production data?** A: Mathesar supports role-based access control. You can grant read-only access to some users and edit access to others, scoped to specific schemas or tables. **Q: Does Mathesar work with databases other than PostgreSQL?** A: Currently Mathesar only supports PostgreSQL. Support for other databases is on the roadmap but not yet available. **Q: How is Mathesar different from a spreadsheet?** A: Mathesar operates directly on a real relational database with proper data types, constraints, foreign keys, and concurrent multi-user access. Changes are immediately reflected in the underlying PostgreSQL database. ## Sources - https://github.com/mathesar-foundation/mathesar - https://docs.mathesar.org/ --- Source: https://tokrepo.com/en/workflows/7db49b4f-3f10-11f1-9bc6-00163e2b0d79 Author: AI Open Source