Skip to main content

Docker deployment guide

Introduction

Powerhouse provides official Docker images for deploying your applications in containerized environments. This guide covers the available Docker images, how to use them with Docker Compose, and the environment variables you can configure.

Docker deployment is ideal for:

  • Production environments that require consistent, reproducible deployments
  • Development teams that want to share a common environment
  • CI/CD pipelines that need automated testing and deployment
  • Cloud platforms like AWS ECS, Google Cloud Run, or Kubernetes

Available Docker Images

Powerhouse publishes three official Docker images to the GitHub Container Registry (ghcr.io):

1. Connect

The Connect image provides the Powerhouse web application frontend with an embedded Nginx server.

ghcr.io/powerhouse-inc/powerhouse/connect

Available tags:

  • latest - Latest stable release
  • dev - Development builds
  • staging - Staging builds
  • vX.Y.Z - Specific version tags (e.g., v1.0.0)

2. Switchboard

The Switchboard image provides the backend API server that handles document synchronization and GraphQL endpoints.

ghcr.io/powerhouse-inc/powerhouse/switchboard

Available tags:

  • latest - Latest stable release
  • dev - Development builds
  • staging - Staging builds
  • vX.Y.Z - Specific version tags (e.g., v1.0.0)

3. Academy

The Academy image provides the documentation website.

ghcr.io/powerhouse-inc/powerhouse/academy

Available tags:

  • latest - Latest stable release
  • dev - Development builds
  • staging - Staging builds
  • vX.Y.Z - Specific version tags (e.g., v1.0.0)

Quick Start with Docker Compose

The easiest way to run Powerhouse locally is using Docker Compose. Create a docker-compose.yml file or use the one provided in the repository:

name: powerhouse

services:
connect:
image: ghcr.io/powerhouse-inc/powerhouse/connect:dev
environment:
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres
- BASE_PATH=/
ports:
- "127.0.0.1:3000:4000"
networks:
- powerhouse_network
depends_on:
postgres:
condition: service_healthy

switchboard:
image: ghcr.io/powerhouse-inc/powerhouse/switchboard:dev
environment:
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres
ports:
- "127.0.0.1:4000:4001"
networks:
- powerhouse_network
depends_on:
postgres:
condition: service_healthy

postgres:
image: postgres:16.1
ports:
- "127.0.0.1:5444:5432"
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
networks:
- powerhouse_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 3s
retries: 3

networks:
powerhouse_network:
name: powerhouse_network

Running the Stack

Start all services:

docker compose up -d

View logs:

docker compose logs -f

Stop all services:

docker compose down

After starting, you can access:

Environment Variables

Connect Environment Variables

VariableDescriptionDefault
PORTPort the server listens on4000
PH_CONNECT_BASE_PATHBase URL path for the application/
PH_PACKAGESComma-separated list of packages to install at startup""
PH_CONNECT_SENTRY_DSNSentry DSN for error tracking""
PH_CONNECT_SENTRY_ENVSentry environment name""
DATABASE_URLPostgreSQL connection stringRequired

Feature Flags

VariableDescriptionDefault
PH_CONNECT_DEFAULT_DRIVES_URLDefault drives URL to load""
PH_CONNECT_ENABLED_EDITORSEnabled editor types (* for all)"*"
PH_CONNECT_DISABLED_EDITORSDisabled editor types""
PH_CONNECT_PUBLIC_DRIVES_ENABLEDEnable public drives"true"
PH_CONNECT_CLOUD_DRIVES_ENABLEDEnable cloud drives"true"
PH_CONNECT_LOCAL_DRIVES_ENABLEDEnable local drives"true"
PH_CONNECT_SEARCH_BAR_ENABLEDEnable search bar"false"
PH_CONNECT_DISABLE_ADD_PUBLIC_DRIVESDisable adding public drives"false"
PH_CONNECT_DISABLE_ADD_CLOUD_DRIVESDisable adding cloud drives"false"
PH_CONNECT_DISABLE_ADD_LOCAL_DRIVESDisable adding local drives"false"
PH_CONNECT_DISABLE_DELETE_PUBLIC_DRIVESDisable deleting public drives"false"
PH_CONNECT_DISABLE_DELETE_CLOUD_DRIVESDisable deleting cloud drives"false"
PH_CONNECT_DISABLE_DELETE_LOCAL_DRIVESDisable deleting local drives"false"
PH_CONNECT_HIDE_DOCUMENT_MODEL_SELECTION_SETTINGSHide document model selection"true"

Renown Authentication

VariableDescriptionDefault
PH_CONNECT_RENOWN_URLRenown authentication service URL"https://auth.renown.id"
PH_CONNECT_RENOWN_NETWORK_IDRenown network identifier"eip155"
PH_CONNECT_RENOWN_CHAIN_IDRenown chain ID1

Switchboard Environment Variables

Core Configuration

VariableDescriptionDefault
PORTPort the server listens on4001
PH_SWITCHBOARD_PORTAlias for PORT$PORT
DATABASE_URLPostgreSQL or SQLite connection string"dev.db"
PH_SWITCHBOARD_DATABASE_URLAlias for DATABASE_URL"dev.db"
BASE_PATHBase URL path for the API"/"
PH_PACKAGESComma-separated list of packages to install at startup""

Authentication

VariableDescriptionDefault
AUTH_ENABLEDEnable authentication"false"
ADMINSComma-separated list of admin wallet addresses""
USERSComma-separated list of user wallet addresses""
GUESTSComma-separated list of guest wallet addresses""
FREE_ENTRYAllow unauthenticated access when auth is enabled"false"

Error Tracking & Monitoring

VariableDescriptionDefault
SENTRY_DSNSentry DSN for error tracking""
SENTRY_ENVSentry environment name (e.g., "production", "staging")""
PYROSCOPE_SERVER_ADDRESSPyroscope server address for performance profiling""

Installing Custom Packages

Both Connect and Switchboard support installing custom Powerhouse packages at container startup using the PH_PACKAGES environment variable.

services:
connect:
image: ghcr.io/powerhouse-inc/powerhouse/connect:dev
environment:
- PH_PACKAGES=@powerhousedao/todo-demo-package,@powerhousedao/another-package

Packages are installed using the ph install command before the service starts.

Image Architecture

Connect Image

The Connect image is based on Alpine Linux and includes:

  • Node.js and pnpm
  • Nginx with Brotli compression
  • The ph-cmd CLI tool
  • A pre-initialized Powerhouse project

At startup, the entrypoint script:

  1. Installs any packages specified in PH_PACKAGES
  2. Builds the Connect frontend with ph connect build
  3. Configures and starts Nginx to serve the built files

Switchboard Image

The Switchboard image is based on Node.js 22 and includes:

  • pnpm package manager
  • The ph-cmd CLI tool
  • Prisma CLI for database migrations
  • A pre-initialized Powerhouse project

At startup, the entrypoint script:

  1. Installs any packages specified in PH_PACKAGES
  2. Runs Prisma database migrations (if using PostgreSQL)
  3. Starts the Switchboard server with ph switchboard

Production Considerations

Using Specific Version Tags

For production deployments, always use specific version tags instead of latest or dev:

services:
connect:
image: ghcr.io/powerhouse-inc/powerhouse/connect:v1.0.0
switchboard:
image: ghcr.io/powerhouse-inc/powerhouse/switchboard:v1.0.0

Database Persistence

For production, ensure your PostgreSQL data is persisted using volumes:

services:
postgres:
image: postgres:16.1
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=your-secure-password
- POSTGRES_DB=powerhouse
- POSTGRES_USER=powerhouse

volumes:
postgres_data:

Health Checks

The provided docker-compose.yml includes health checks for PostgreSQL. Services wait for the database to be healthy before starting, preventing connection errors during startup.

Network Security

The example configuration binds ports to 127.0.0.1 only:

ports:
- "127.0.0.1:3000:4000"

This prevents direct external access. In production, use a reverse proxy (like Nginx or Traefik) to:

  • Terminate SSL/TLS
  • Handle load balancing
  • Provide additional security headers

Environment File

For better security, use a .env file instead of hardcoding credentials:

# .env
POSTGRES_PASSWORD=your-secure-password
DATABASE_URL=postgres://powerhouse:your-secure-password@postgres:5432/powerhouse
services:
switchboard:
image: ghcr.io/powerhouse-inc/powerhouse/switchboard:latest
env_file:
- .env

Troubleshooting

Container Won't Start

Check the logs for errors:

docker compose logs connect
docker compose logs switchboard

Database Connection Issues

Ensure the database is ready before services start:

docker compose logs postgres

Verify the DATABASE_URL format:

postgres://user:password@host:port/database

Package Installation Fails

If custom packages fail to install, check:

  1. Package name is correct
  2. Network connectivity from container
  3. Container has access to npm registry

Permission Issues

If you encounter permission issues with volumes:

# Fix ownership
sudo chown -R 1000:1000 ./data

Building Custom Images

You can extend the official images for custom deployments:

FROM ghcr.io/powerhouse-inc/powerhouse/connect:latest

# Install additional packages at build time
RUN ph install @powerhousedao/my-custom-package

# Add custom configuration
COPY my-nginx.conf /etc/nginx/nginx.conf.template

Build and push your custom image:

docker build -t my-registry/my-connect:latest .
docker push my-registry/my-connect:latest

Next Steps