Skip to content

Repository files navigation

SQLite Admin

SQLite Admin is a lightweight, self-hosted PHP interface for browsing and maintaining SQLite databases from a web browser.

Version 1.1.4 fixes insert-row handling, clarifies database filename/path setup, and restores compatibility across PHP 7.0 through PHP 8.3 while retaining the 1.1 security and routing improvements.

SQLite Admin is a powerful database tool. Do not expose it publicly without HTTPS and additional server-level access controls.

Features

  • Browse tables and read-only SQLite views
  • Insert, edit, and delete rows
  • Preserve NULL, empty strings, numeric values, and BLOB fields correctly
  • Search all columns and apply per-column filters
  • Choose 25, 50, 100, 250, or 500 rows per page
  • Bulk delete selected rows
  • Undo the five most recent visual-editor actions
  • Create, rename, and drop tables
  • Add and rename columns
  • Run manual SQL queries
  • Import tables from CSV or JSON
  • Preserve NULL and BLOB data across SQLite Admin CSV/JSON round trips
  • Export tables as CSV, JSON, or SQL
  • Import, switch, export, and safely remove SQLite database files
  • Full-database exports using SQLite's backup API when available, with compatible fallbacks for older PHP versions
  • Light and dark themes
  • Resizable desktop sidebar
  • Responsive browser interface

Requirements

  • PHP 7.0 through 8.3

    PHP 8.x is recommended for production because older PHP 7 releases no longer receive security updates.

  • PHP SQLite3 extension

  • A web server such as Apache or Nginx

  • Write access to the selected database directory

  • HTTPS for any non-local installation

Font Awesome icons are loaded from the cdnjs CDN. Database contents and database operations remain on your server.

Installation

  1. Upload the repository files to your server.
  2. Open install.php in a browser.
  3. Enter the SQLite database filename or server filesystem path, an administrator username, and a password of at least 12 characters.
  4. Complete the installer, then open admin.php and sign in.

The database filename/path field intentionally has no default. Enter a filename such as catalog.sqlite when the database is stored with SQLite Admin, a relative path such as data/catalog.sqlite, or an absolute server filesystem path. Relative paths are resolved from the application directory. The installer creates the directory and database when necessary, verifies SQLite integrity, and writes config.php only after the database is usable.

Existing databases

The installer does not overwrite an existing database. Enter the filename or path to an existing .sqlite, .sqlite3, or .db file to manage it.

SQLite Admin lists other supported database files in the same directory and lets the signed-in administrator switch between them.

Security

SQLite Admin intentionally allows destructive database operations and arbitrary SQL. Treat it like a server administration panel.

  • Use HTTPS.
  • Place the application behind an IP allowlist, VPN, HTTP authentication, or another access-control layer when possible.
  • Keep config.php out of source control.
  • Prefer storing databases outside the public web root.
  • If databases remain under the web root, configure the server to deny direct downloads.
  • Remove or restrict install.php after installation if your hosting environment allows it.
  • Back up databases before major changes.

Apache protection files are included. Nginx users should add an equivalent rule, for example:

location ~* /(?:config\.php|data/.*\.(?:sqlite|sqlite3|db)(?:-(?:wal|shm))?)$ {
    deny all;
    return 404;
}

See SECURITY.md for reporting and deployment guidance.

Configuration

config.php is generated by the installer and ignored by Git. A documented example is available in config.example.php.

Important values:

$dbFile = ''; // Required: SQLite database filesystem path
$username = 'admin';
$passwordHash = '...';
$installed = true;
$debug = false;
$sessionName = 'sqlite_admin';

Generate a password hash manually with:

php -r "echo password_hash('replace-this-password', PASSWORD_DEFAULT), PHP_EOL;"

Local development

php -S 127.0.0.1:8000

Then open:

http://127.0.0.1:8000/install.php

The PHP process must have permission to create and modify the configured database directory.

Upgrading

  1. Back up config.php and your database files.
  2. Replace the application files with the new release.
  3. Keep your existing config.php and database directory.
  4. Review CHANGELOG.md for version-specific notes.

No database schema migration is required for SQLite Admin itself.

Portable CSV and JSON values

SQLite Admin uses two explicit conventions when exporting and re-importing table data:

  • SQL NULL is written as \N in CSV exports.
  • BLOB values are written as base64:<encoded data> in CSV and JSON exports.

These conventions are decoded automatically when importing into a column declared as BLOB. A literal text value of \N is escaped in SQLite Admin-generated CSV files.

Known limitations

  • The visual editor supports one declared primary-key column. Tables without one use SQLite rowid when available.
  • WITHOUT ROWID tables without a single primary key are browse-only in the visual editor.
  • Views are intentionally browse-only; update their underlying tables or use the SQL screen.
  • BLOB values are displayed by size and are preserved during visual edits, but binary file editing is not provided.
  • The undo history is session-based and limited to five supported visual actions. It is not a substitute for backups.

Repository files

admin.php              Main application
install.php            One-time installer
config.example.php     Manual configuration example
README.md               GitHub documentation
readme.html             Browser-friendly documentation
SECURITY.md             Security policy and deployment guidance
CHANGELOG.md            Release history
LICENSE                 MIT License
.htaccess               Apache protection for sensitive files
data/.htaccess          Apache protection for the default data directory

Contributing

Bug reports and pull requests are welcome. Please avoid including real databases, credentials, or private data in issues and test fixtures.

License

SQLite Admin is released under the MIT License.

Developed by Abilene Tech Guy.

Bug reports

Report reproducible bugs and request improvements at github.com/abilenetechguy/sqlite-admin. Do not post credentials, private database contents, or exploitable security details in a public issue.

Opening the application

After installation, open admin.php directly, for example:

https://example.com/admin/admin.php

SQLite Admin intentionally does not set a DirectoryIndex. This avoids conflicts with site-level clean-URL rewrite rules that can turn /admin/ into /admin/admin. You may add your own directory-index rule when your hosting configuration supports it.

About

A lightweight, self-hosted PHP interface for viewing, editing, querying, and managing SQLite databases from a web browser. Compatible with PHP 7.0–8.3.

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages