1. Prerequisites
    2. Installing Backstage
    3. Backstage app structure
    4. Running the app
    1. Configuring Backstage
    2. Setting up PostgreSQL
    3. Configuring PostgreSQL
    4. Setting the application name
    5. Setting up authentication
    1. Adding integrations
    2. Adding Components
    3. Configuring for production
    1. Knowledge check

Configuring Backstage

40 MINS

Configuring PostgreSQL

Now that PostgreSQL is installed on your machine, we can tell Backstage to use it.

Earlier you saw the main Backstage configuration file, app-config.yaml in the root directory of your Backstage app. Backstage also supports environment-specific configuration overrides, by way of an app-config.<environment>.yaml file. This is where you'll add the database configuration, since you’re setting up a database on your local machine right now.

Open the app-config.local.yaml file in the root directory of your Backstage app (create if it doesn't exist), and add:

backend:
  database:
    connection:
      host: localhost
      # Default postgresql port is 5432; this might be different for your installation
      port: 5432
      user: postgres
      # Replace the password below with your postgresql password:
      password: secret

The default .gitignore file created with the app excludes *.local.yaml from source control for you, so you can add passwords or tokens directly into the app-config.local.yaml.

Start Backstage from the terminal, by typing yarn dev and pressing enter. As soon as it states:

[0] webpack compiled successfully

You're good to go and explore Backstage again. Note that if you've made any changes before, they might be gone. The default database is not persistent.