> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Backstage Configuration

> Guide to Backstage configuration files and layered environment-specific overrides for local and production using app-config.yaml, app-config.local.yaml and app-config.production.yaml

In this lesson we cover how to configure a Backstage instance and which files to modify to change Backstage behavior across environments (local development, production, etc.). This guide explains the layered configuration model used by Backstage and shows where to place environment-specific overrides.

A typical Backstage app repository contains configuration files such as `app-config.local.yaml`, `app-config.production.yaml`, `app-config.yaml`, `backstage.json`, and `catalog-info.yaml`, along with folders like `node_modules`, `packages`, and `plugins`.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/Q5xOldnqnU5Q2-GZ/images/Prep-Course-Certified-Backstage-Associate-CBA-Certification/Backstage-Basics/Backstage-Configuration/backstage-config-directory-tree.jpg?fit=max&auto=format&n=Q5xOldnqnU5Q2-GZ&q=85&s=6efd6c23d7a1735f8c0b8a8521be8a8b" alt="A slide titled &#x22;Backstage Configuration&#x22; showing a directory tree of config files and folders. It lists files like app-config.local.yaml, app-config.production.yaml, app-config.yaml, backstage.json, catalog-info.yaml and folders such as node_modules, packages, plugins, etc." width="1920" height="1080" data-path="images/Prep-Course-Certified-Backstage-Associate-CBA-Certification/Backstage-Basics/Backstage-Configuration/backstage-config-directory-tree.jpg" />
</Frame>

Key configuration files to know:

* `app-config.yaml` — base configuration shared across environments
* `app-config.local.yaml` — overrides for local development
* `app-config.production.yaml` — overrides for production deployments

Backstage supports layered configuration: the base `app-config.yaml` contains settings common to all environments, and environment-specific files merge on top of it to override values when present.

## How the config files work (layered configuration)

* Backstage loads `app-config.yaml` first as the canonical base.
* If present, `app-config.local.yaml` and `app-config.production.yaml` are merged on top of the base and replace any overlapping keys.
* Only include keys in the override files for properties that change between environments; unspecified keys remain as defined in the base file.

## app-config.yaml (base configuration)

Put values that are identical across environments here. This file should be committed to source control and serve as the canonical configuration for your Backstage instance.

```yaml theme={null}
app:
  title: Scaffolded Backstage App
  baseUrl: http://147.182.170.10:3000

organization:
  name: My Company

backend:
  baseUrl: http://147.182.170.10:7007
  listen:
    port: 7007
  cors:
    origin: http://147.182.170.10:3000
    methods: [GET, HEAD, PATCH, POST, PUT, DELETE]
    credentials: true
```

## app-config.local.yaml (local development overrides)

Use `app-config.local.yaml` to override only the values that differ for local development. Backstage merges this file on top of the base config, so you don’t need to repeat the entire configuration—only the keys you want to change.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/Q5xOldnqnU5Q2-GZ/images/Prep-Course-Certified-Backstage-Associate-CBA-Certification/Backstage-Basics/Backstage-Configuration/app-config-local-overrides-main-config.jpg?fit=max&auto=format&n=Q5xOldnqnU5Q2-GZ&q=85&s=e677b7a810f119a290576fd9be8d5536" alt="A diagram showing that app-config.local.yaml (local development configuration) overrides the main app-config.yaml, with an arrow labeled &#x22;Override&#x22; from the local file to the main config." width="1920" height="1080" data-path="images/Prep-Course-Certified-Backstage-Associate-CBA-Certification/Backstage-Basics/Backstage-Configuration/app-config-local-overrides-main-config.jpg" />
</Frame>

Example local overrides:

```yaml theme={null}
app:
  baseUrl: http://localhost:3000

backend:
  baseUrl: http://localhost:7007
  cors:
    origin: http://localhost:3000
```

<Callout icon="warning" color="#FF6B6B">
  Do not commit `app-config.local.yaml` if it contains secrets (API keys, credentials) or machine-specific values. Keep it as a local-only configuration file and add it to `.gitignore` where appropriate.
</Callout>

## app-config.production.yaml (production overrides)

`app-config.production.yaml` works the same as the local override file but is intended for production deployments. Use environment-specific overrides here and avoid hard-coding secrets or machine-specific values in files stored in version control.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/Q5xOldnqnU5Q2-GZ/images/Prep-Course-Certified-Backstage-Associate-CBA-Certification/Backstage-Basics/Backstage-Configuration/app-config-production-override-diagram.jpg?fit=max&auto=format&n=Q5xOldnqnU5Q2-GZ&q=85&s=69aec7026dba0f0f5dac38b713e6206b" alt="A diagram titled &#x22;App-config.production.yaml&#x22; showing a PROD server icon above two config-file icons (app-config.yaml on the left and app-config.production.yaml on the right) with a horizontal arrow labeled &#x22;Override&#x22; pointing from the production-specific file to the base config." width="1920" height="1080" data-path="images/Prep-Course-Certified-Backstage-Associate-CBA-Certification/Backstage-Basics/Backstage-Configuration/app-config-production-override-diagram.jpg" />
</Frame>

Example: reference environment variables instead of committing secrets. The example below uses an environment variable for the host:

```yaml theme={null}
app:
  baseUrl: "https://${HOST}"
```

<Callout icon="lightbulb" color="#1CB2FE">
  Use environment variables in production configs to avoid storing secrets in version control. The `HOST` environment variable in the example above will be substituted at runtime.
</Callout>

## Restarting Backstage after config changes

Backstage reads configuration files at startup. After editing any config file, restart your Backstage process so the new settings are applied.

```bash theme={null}
# Stop the server (Ctrl+C in most terminals), then restart:
yarn dev
```

## Quick reference table

| Config file                  | Purpose                                 | Notes                                                                  |
| ---------------------------- | --------------------------------------- | ---------------------------------------------------------------------- |
| `app-config.yaml`            | Base configuration for all environments | Commit to repository; contains shared settings                         |
| `app-config.local.yaml`      | Local development overrides             | Only include keys that differ locally; do not commit secrets           |
| `app-config.production.yaml` | Production overrides                    | Reference environment variables for secrets and deploy-specific values |

## Summary

* `app-config.yaml` is the shared base config; commit this file.
* `app-config.local.yaml` provides local development overrides—keep sensitive values out of version control.
* `app-config.production.yaml` contains production-specific overrides and should rely on environment variables for secrets.
* Backstage merges the base and override files at startup; restart the process to load configuration changes.

Further reading and references:

* [Backstage Configuration documentation](https://backstage.io/docs/features/configuration)
* [YAML specification](https://yaml.org/spec/)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/certified-backstage-associate-cba/module/fcbbf923-69c3-4147-bd51-18db2bd18957/lesson/548b4bbc-0a5c-4d63-94ee-250dfd40cd25" />
</CardGroup>
