Skip to content

Configuration

Govard uses layered project configuration plus framework blueprints.


Config Layer Order

Govard loads config in this order (later layers override earlier ones):

PriorityFileDescription
1.govard.ymlBase team config — main writable file
2.govard.<profile>.ymlTeam-shared profile override
3.govard.local.ymlLegacy developer-local override
4.govard/.govard.local.ymlPreferred developer-local override
5.govard.<env>.ymlLegacy environment override
6.govard/.govard.<env>.ymlPreferred environment override

Ownership Model

  • .govard.yml — team-owned base config; target for all govard config set writes
  • Profile/local/env overrides — read-only from CLI perspective; never auto-written by Govard

Profiles

Use profiles when a team needs multiple runtime shapes for the same project.

bash
govard env up --profile upgrade
govard db dump --profile perf

Govard loads .govard.<profile>.yml and creates an isolated compose file + separate data volumes, so profile switching does not contaminate existing data.


Environment Override

bash
export GOVARD_ENV=staging
govard env up

With GOVARD_ENV=staging, Govard additionally loads:

  • .govard.staging.yml
  • .govard/.govard.staging.yml

Global Environment Variables

VariableEffect
GOVARD_HOME_DIROverride ~/.govard
GOVARD_BLUEPRINTS_DIROverride blueprint lookup location
GOVARD_IMAGE_REPOSITORYOverride managed image repository prefix
GOVARD_DOCKER_DIROverride local Docker build contexts for fallback builds

Example .govard.yml

yaml
project_name: "my_project"
framework: "magento2"
framework_version: "2.4.7"
domain: "myproject.test"
table_prefix: "demo_"
lock:
  strict: false
blueprint_registry:
  provider: "http"
  url: "https://example.com/govard-blueprints.tar.gz"
  checksum: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  trusted: false
stack:
  php_version: "8.4"
  node_version: "24"
  db_type: "mariadb"
  db_version: "11.4"
  web_root: "/public"
  cache_version: "7.4"
  search_version: "3.4.0"
  queue_version: "3.13.7"
  xdebug_session: "PHPSTORM"
  services:
    web_server: "nginx"
    search: "opensearch"
    cache: "redis"
    queue: "none"
  features:
    xdebug: true
    varnish: false
    isolated: false
    mftf: false
    livereload: false
linked_projects:
    - "other-project"
    - "external-host.com:127.0.0.1"

Key Fields

Project Identity

FieldDescription
project_nameUnique project name (must be unique across all tracked projects)
frameworkDetected or forced framework
framework_versionFramework version (used for version-aware profiles)
domainPrimary project domain (e.g. myproject.test)
extra_domainsAdditional hostnames routed through the local proxy
store_domainsMagento multi-store hostname → scope code map
table_prefixMagento 2, Magento 1, or OpenMage database table prefix; omit or leave empty for unprefixed schemas
linked_projectsList of dependencies (project names or IP:domain) for cross-project connectivity

::: important IMPORTANT project_name and domain must be unique across all tracked Govard projects. Govard blocks init and env up when another project uses the same identity. :::

store_domains — Scalar Form (Legacy)

yaml
store_domains:
  brand-b.test: brand_b
  brand-c.test: brand_c

store_domains — Object Form (Explicit Routing)

yaml
store_domains:
  brand-b.test:
    code: base
    type: website
  brand-c.test:
    code: brand_c
    type: store

Object form instructs Govard to emit MAGE_RUN_CODE / MAGE_RUN_TYPE host mappings automatically.

table_prefix — Magento Schemas

Use table_prefix when the Magento database tables are prefixed, for example demo_core_config_data:

yaml
table_prefix: "demo_"

Govard uses this value for Magento 2 env.php, Magento 1/OpenMage local.xml, config auto SQL, DB sync privacy filters, and Warden migration. The value must contain only letters, numbers, and underscores.


Runtime Stack

FieldOptionsDescription
stack.services.web_servernginx, apache, hybridWeb server
stack.services.searchopensearch, elasticsearch, noneSearch engine
stack.services.cacheredis, valkey, noneCache service
stack.services.queuerabbitmq, noneQueue service
stack.php_versione.g. 8.4PHP version
stack.node_versione.g. 24Node.js version
stack.db_typemariadb, mysqlDatabase engine
stack.db_versione.g. 11.4Database version
stack.web_roote.g. /pub, /publicWeb root directory
stack.composer_version1, 2, 2.2, or any point versionComposer version
stack.xdebug_sessione.g. PHPSTORMXdebug session name
stack.features.livereloadtrue, falseEnable LiveReload port mapping (35729)
stack.features.varnishtrue, falseEnable Varnish cache service
stack.features.xdebugtrue, falseEnable Xdebug and php-debug service
stack.features.isolatedtrue, falseIsolate network from external access
stack.features.mftftrue, falseEnable Magento Functional Testing Framework

Node-first frameworks auto-detect the package manager from package.json, pnpm-workspace.yaml, or lockfiles.

Composer Versioning Optimization

Govard provides first-class support for common Composer versions to ensure instant environment startup:

  • Pre-baked (Instant): 1, 2, 2.2 (LTS). These versions are bundled in the PHP image and do not require downloading at runtime.
  • Dynamic (Auto-Download): Any other valid point release (e.g., 2.7.2) can be specified. Govard will automatically download and verify the binary upon the first env up.

Safety and Reproducibility

FieldDescription
lock.strictFail env up when lock state is missing or mismatched
lock.ignore_fieldsFields to skip during compliance checks (e.g. host.docker_version)
blueprint_registry.*Opt-in remote blueprint source with checksum + trust requirements

Remotes

Remote definitions live under remotes.<name>. The name can be any valid identifier — Govard accepts standard names (dev, staging, prod) as well as any custom name using lowercase letters, digits, hyphens, or underscores (e.g. qa, preprod, demo, client-uat).

yaml
remotes:
  staging:
    host: staging.example.com
    user: deploy
    path: /var/www/app
    port: 22
    capabilities:
      files: true
      media: true
      db: true
    protected: false
    auth:
      method: ssh-agent

  qa:
    host: qa.example.com
    user: deploy
    path: /var/www/app
    auth:
      method: keychain

  preprod:
    host: preprod.example.com
    user: deploy
    path: /var/www/app
    protected: true   # opt-in write protection for custom environments
    auth:
      method: ssh-agent

NOTE

Only remotes whose name normalizes to prod (prod, production, live) are automatically write-protected. All other remotes — including custom names — default to unprotected. Use protected: true to opt in.

Key subfields:

FieldDescription
capabilitiesScope flags: files, media, db, deploy
protectedWrite-protect this remote
auth.methodkeychain, ssh-agent, or keyfile
auth.key_pathPath to SSH key (for keyfile method)
auth.strict_host_keyEnable strict host-key verification
auth.known_hosts_fileCustom known_hosts file path

Remote fields support op://... references resolved through the 1Password CLI.

→ Full guide: Remotes and Sync


Project Extensions

PathPurpose
.govard/docker-compose.override.ymlCompose overrides merged after framework includes
.govard/commands/*Custom commands exposed via govard custom
.govard/hooks/*Scripts referenced by hooks.*.run

Lifecycle hook events:

  • pre-up / post-up
  • pre-down / post-down
  • pre-deploy / post-deploy
  • pre-delete / post-delete

TIP

Govard fingerprints .govard/docker-compose.override.yml. If it changes, the next env up auto-re-renders the compose output.

When overriding services, prefer additive merges (extra environment variables, labels, ports). Replacing full lists like services.web.volumes can discard required Govard-managed mounts.


Config Commands

bash
govard config get stack.php_version
govard config set stack.php_version 8.4
govard config profile --json
govard config profile apply --framework laravel --framework-version 11

govard config set writes only to .govard.yml (the base config).


Blueprint Registry

If blueprint_registry is enabled:

  • provider must be git or http
  • url is required
  • checksum must be a 64-character SHA-256 hex string
  • trusted must be true
  • Remote payloads are cached under ~/.govard/blueprint-registry/

Govard fails fast if the checksum does not match.


Inter-Project Connectivity

By default, Govard projects are isolated. To allow a project to communicate with another Govard project via its .test domain, use the linked_projects field.

Key Behaviors

  • Opt-in Visibility: Hostnames for other projects are only injected into /etc/hosts if the project is explicitly listed in linked_projects.
  • Automatic Domain Resolution: Listing a project name (e.g., bebe9) will automatically map its primary domain and all extra domains to the shared proxy IP.
  • Targeted Container Refresh: When you start a project, Govard identifies which other running projects depend on it and restarts only those specific projects to update their host mappings.
  • Manual Mappings: You can also provide raw mappings in the format hostname:ip.
yaml
linked_projects:
  - "my-api-project"             # Project name
  - "custom.site:192.168.1.10"   # Manual mapping

← CLI Commands | Frameworks →

Released under the MIT License.