Documentation

Everything you need to run, configure and contribute to adminer-node.

Quick Start

No installation required. Run directly with npx:

# Runs on http://127.0.0.1:8080 and opens your browser

npx adminer-node

CLI Options

npx adminer-node [options]

--port <port> Port to listen on (default: 8080)

--host <host> Host to bind to (default: 127.0.0.1)

--no-open Do not open browser automatically

--driver <driver> Pre-select driver: mysql | pgsql | sqlite

--help Show help and exit

Installation

npx (recommended)

npx adminer-node

Global install

npm install -g adminer-node

adminer-node

Local project

npm install adminer-node

npx adminer-node

Docker โ€” Quick Run

docker run -p 8080:8080 javimosch/adminer-node:latest

Open http://localhost:8080 in your browser.

Docker Compose

Save as compose.yml and run docker compose up:

services:

adminer-node:

image: javimosch/adminer-node:latest

ports:

- "8080:8080"

environment:

- PORT=8080

- HOST=0.0.0.0

restart: unless-stopped

To also spin up a local MariaDB:

services:

adminer-node:

image: javimosch/adminer-node:latest

ports: ["8080:8080"]

environment: { HOST: 0.0.0.0, PORT: 8080 }

mariadb:

image: mariadb:11

environment:

MARIADB_ROOT_PASSWORD: secret

MARIADB_DATABASE: mydb

ports: ["3306:3306"]

Build & Push (maintainers)

# Build + push to Docker Hub in one step

npm run deploy

# Individual steps

npm run docker:build

npm run docker:push

npm run docker:run # quick local test

Environment Variables

VariableDefaultDescription
PORT8080HTTP port the server listens on
HOST127.0.0.1Host/interface to bind (0.0.0.0 for Docker)

MySQL / MariaDB

Select MySQL / MariaDB on the login screen. Connection fields:

Supported features: browse, edit, create table, alter table, indexes, foreign keys, SQL editor, export dump, variables, process list.

PostgreSQL

Select PostgreSQL on the login screen. Connection fields:

Supported features: schemas, sequences, materialized views, custom types, extensions.

SQLite

Select SQLite on the login screen. The Server field is the file path:

Username and password are not required for SQLite โ€” leave them blank.

SQL Editor

Navigate to any database and click SQL Command. The editor supports:

Table Browser

Click a table name in the sidebar to browse its data. Features:

Row Editor

Click Edit on any row to open the row editor. Inputs are type-aware:

Export / Dump

Navigate to a database or table and click Export. Options:

Security

Config File

adminer-node automatically loads ~/.config/adminer-node/config.json on startup. You can also specify a custom path:

npx adminer-node --config /path/to/config.json

# or via environment variable

ADMINER_CONFIG=/path/to/config.json npx adminer-node

Priority order (highest wins): CLI flags โ†’ environment variables โ†’ config file โ†’ defaults.

Saved Connections

Define connection presets in your config file. They appear as one-click cards on the home screen. The password is stored only on the server โ€” it is never sent to the browser.

{

"connections": [

{

"id": "prod-mysql",

"label": "Production MySQL",

"driver": "mysql",

"server": "db.example.com",

"username": "app",

"password": "s3cr3t",

"db": "myapp"

},

{

"id": "local-sqlite",

"label": "Dev SQLite",

"driver": "sqlite",

"server": "/home/user/dev.db",

"username": "",

"password": ""

}

]

}

Connection fields:

FieldRequiredDescription
idNoUnique ID for auto-connect API. Defaults to array index.
labelYesDisplay name shown on the home screen card
driverYesmysql | pgsql | sqlite
serverYesHost/IP (MySQL/PgSQL) or file path (SQLite)
usernameNoEmpty string for SQLite
passwordNoEmpty string for SQLite
dbNoDefault database to select after login

Environment Variables

VariableDefaultDescription
PORT / ADMINER_PORT8080HTTP port
HOST / ADMINER_HOST127.0.0.1Bind host (0.0.0.0 for Docker)
ADMINER_DRIVERโ€”Pre-select driver on login form
ADMINER_NO_OPEN=1โ€”Disable auto browser open
ADMINER_CONFIGโ€”Path to config JSON file
ADMINER_CONNECTIONSโ€”JSON array of connection presets
ADMINER_BASIC_USERโ€”HTTP Basic Auth username
ADMINER_BASIC_PASSโ€”HTTP Basic Auth password

Example โ€” inject connections via environment (useful in CI/CD or Docker Compose):

ADMINER_CONNECTIONS='[{"label":"App DB","driver":"mysql","server":"127.0.0.1","username":"root","password":"secret","db":"app"}]' \

npx adminer-node

HTTP Basic Auth

Add an extra layer of protection when exposing adminer-node on a public URL (e.g. behind a reverse proxy). Basic Auth is checked before the DB login form.

โš ๏ธ Always use HTTPS when enabling Basic Auth on a public URL.

Via config file

{

"basicAuth": {

"username": "admin",

"password": "changeme",

"realm": "My Adminer"

}

}

Via environment variables

ADMINER_BASIC_USER=admin ADMINER_BASIC_PASS=changeme npx adminer-node

The /health endpoint is always exempt from Basic Auth so Docker health checks keep working.

Docker + Pre-configured Connections

Via environment variable

services:

adminer-node:

image: javimosch/adminer-node:latest

ports: ["8080:8080"]

environment:

HOST: 0.0.0.0

ADMINER_BASIC_USER: admin

ADMINER_BASIC_PASS: changeme

ADMINER_CONNECTIONS: '[{"label":"App DB","driver":"mysql","server":"mariadb","username":"root","password":"secret","db":"app"}]'

depends_on: [mariadb]

mariadb:

image: mariadb:11

environment:

MARIADB_ROOT_PASSWORD: secret

MARIADB_DATABASE: app

Via mounted config file

services:

adminer-node:

image: javimosch/adminer-node:latest

ports: ["8080:8080"]

environment:

HOST: 0.0.0.0

ADMINER_CONFIG: /config/adminer-node.json

volumes:

- ./adminer-node.json:/config/adminer-node.json:ro

REST API Reference

All API routes are under /api/. Authenticated routes require a valid session cookie.

MethodPathDescription
GET/api/driversList available drivers
GET/api/statusServer status & auth state
POST/api/auth/loginLogin (sets session cookie)
POST/api/auth/logoutLogout (clears session)
GET/api/databasesList databases
POST/api/databasesCreate database
DELETE/api/databases/:dbDrop database
GET/api/tables/:dbList tables in a database
GET/api/tables/:db/:table/structureTable fields, indexes, FKs
POST/api/tables/:dbCreate table
DELETE/api/tables/:db/:tableDrop table
GET/api/select/:db/:tableBrowse rows (paginated)
POST/api/edit/:db/:tableInsert row
PUT/api/edit/:db/:tableUpdate row
DELETE/api/edit/:db/:tableDelete row
POST/api/sql/:dbExecute SQL statement(s)
GET/api/dump/:dbExport SQL dump
GET/api/variablesServer variables
GET/api/usersList database users (MySQL)
GET/api/connectionsList saved connection presets (passwords omitted)
POST/api/connections/:id/connectAuto-login using a saved preset (password stays server-side)
GET/healthHealth check โ€” always public, used by Docker healthcheck

Dev Setup

git clone https://github.com/javimosch/adminer-node.git

cd adminer-node

npm install

npm run dev # starts with --watch for hot reload

Architecture

adminer-node is a full-stack Node.js application with zero framework dependencies:

Every file is kept under 500 lines of code for maintainability.

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub.