npm
- npx
- Global Installation
Copy
# PostgreSQL example
npx @bytebase/dbhub \
--transport http \
--port 8080 \
--dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
# Or use demo mode for testing
npx @bytebase/dbhub --transport http --port 8080 --demo
Copy
# Install globally
npm install -g @bytebase/dbhub
# Run the server
dbhub --transport http --port 8080 --dsn "postgres://..."
# Or use demo mode for testing
dbhub --transport http --port 8080 --demo
Docker
- Docker Run
- Docker Compose
Copy
docker run --rm --init \
--name dbhub \
--publish 8080:8080 \
bytebase/dbhub \
--transport http \
--port 8080 \
--dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
# Or use demo mode for testing
docker run --rm --init \
--name dbhub \
--publish 8080:8080 \
bytebase/dbhub \
--transport http \
--port 8080 \
--demo
When connecting to databases on your host machine from Docker, use
host.docker.internal instead of localhost:Copy
--dsn "postgres://user:[email protected]:5432/dbname"
For development environments using Docker Compose, add DBHub to your
docker-compose.yml:docker-compose.yml
Copy
services:
dbhub:
image: bytebase/dbhub:latest
container_name: dbhub
ports:
- "8080:8080"
environment:
- DBHUB_LOG_LEVEL=info
command:
- --transport
- http
- --port
- "8080"
- --dsn
- "postgres://user:password@database:5432/dbname"
depends_on:
- database
database:
image: postgres:15-alpine
environment:
POSTGRES_PASSWORD: password
POSTGRES_DB: dbname
Verification
After starting DBHub, verify it’s running correctly:Copy
curl http://localhost:8080/healthz