1. MooseStack
  2. Configuration
  3. Dev Environment

On this page

Lifecycle HooksCommon ExamplesDocker Infrastructure ExtensionsUsageNetworking ReferenceDefault PortsService URLs

Dev Environment Configuration

This reference covers configuration options specific to the local development workflow (moose dev), including lifecycle hooks, Docker infrastructure extensions, and network defaults.

Lifecycle Hooks

Configure shell commands to run automatically during the development server's lifecycle. These are defined within the [http_server_config] section of your configuration.

[http_server_config]# Script to run once on first starton_first_start_script = "echo 'Dev server started'" # Script to run after every reload completeson_reload_complete_script = "echo 'Reload complete'"
KeyEnv VariableTypeDefaultDescription
on_first_start_scriptMOOSE_HTTP_SERVER_CONFIG__ON_FIRST_START_SCRIPTString-Shell command executed once when moose dev starts.
on_reload_complete_scriptMOOSE_HTTP_SERVER_CONFIG__ON_RELOAD_COMPLETE_SCRIPTString-Shell command executed after every code/infra reload.
Execution Context

Scripts run from your project root using your system's default shell (usually /bin/sh or bash). You can chain commands using &&.

Common Examples

Sync External Tables on Start

on_first_start_script = "moose db pull --clickhouse-url $REMOTE_DB_URL"

Regenerate Clients on Reload

on_reload_complete_script = "openapi-generator-cli generate -i .moose/openapi.yaml ..."

Docker Infrastructure Extensions

Extend the default Moose development infrastructure by creating a specific override file in your project root.

File NamePurpose
docker-compose.dev.override.yamlAdds or overrides services in the generated Docker Compose setup.

Usage

Create docker-compose.dev.override.yaml to add services like PostgreSQL or monitoring tools. Moose automatically detects and merges this file when running moose dev.

# docker-compose.dev.override.yamlservices:  postgres:    image: postgres:16    environment:      POSTGRES_PASSWORD: mypassword    ports:      - "5432:5432"
Limitations

Do not use this file to configure Moose-managed services (ClickHouse, Redpanda, Redis, Temporal). Use moose.config.toml for those components to avoid configuration conflicts.

Networking Reference

Reference for default ports and URLs used by the Moose Runtime in development mode.

Default Ports

PortServiceDescriptionConfig Key
4000API ServerMain Ingestion/Consumption APIshttp_server_config.port
5001Management APIHealth checks & Metricshttp_server_config.management_port
18123ClickHouse HTTPOLAP Database (HTTP)clickhouse_config.host_port
9000ClickHouse NativeOLAP Database (TCP)clickhouse_config.native_port
19092RedpandaKafka Streamingredpanda_config.broker
8080Temporal UIWorkflow Dashboardtemporal_config.ui_port

Service URLs

Access points for local development services:

ServiceURL
Main APIhttp://localhost:4000
Management APIhttp://localhost:5001/metrics
OpenAPI Spechttp://localhost:5001/openapi.yaml
Temporal UIhttp://localhost:8080
  • Overview
  • Quick Start
  • Templates / Examples
Fundamentals
  • Moose Runtime
  • MooseDev MCP
  • Data Modeling
MooseStack in your App
  • App / API frameworks
Modules
  • Moose OLAP
  • Moose Streaming
  • Moose Workflows
  • Moose APIs
Deployment & Lifecycle
  • Moose Migrate
  • Moose Deploy
Reference
  • API Reference
  • Data Types
  • Table Engines
  • CLI
  • Configuration
    • Core Settings
    • Project Settings
    • TypeScript
    • Telemetry
    • Git
    • Features
    • Migrations
    • Infrastructure
    • ClickHouse
    • Redpanda
    • Redis
    • Temporal
    • HTTP Server
    • State Storage
    • Security
    • JWT
    • Admin API
    • Development
    • Dev Environment
  • Observability Metrics
  • Help
  • Changelog
Contribution
  • Documentation
  • Framework
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackTemplates
Changelog
Source506