Skip to content

Environment variables — overview

Index page for environment variable management on the Stack Harbor PaaS — defaults the platform sets, custom variables you add, and Java-specific options.

Environment variables are runtime configuration values your application reads from the container’s environment. On the Stack Harbor PaaS, two kinds matter:

  • Default variables — set by the platform on every container in a given stack. Some are read-only platform internals; others are editable knobs that change container behaviour (memory caps, port redirection, Java GC, package manager selection, and similar).
  • Custom variables — values you add yourself for the application to read. The dashboard exposes a per-container variables panel, and there are equivalent ways through shell config files or, for Java, through variables.conf.

Both work the same way at runtime — your code reads $VAR_NAME and gets the value. The difference is who put the value there: the platform, or you.

What this section covers

  • Default environment variables — the full list of platform-set variables, grouped by stack. Includes what each variable does, whether it is editable, and what value the platform defaults to.
  • Custom environment variables — three ways to add your own variables: the dashboard panel, shell configuration files, and (for Java) variables.conf with the configuration file manager.

When to edit what

  • Use the dashboard variables panel for application configuration the platform should preserve across container restarts and rebuilds. This is the canonical surface.
  • Use shell config files (~/.bashrc) only when the variable needs to exist for interactive shell sessions and you do not want it visible in the dashboard. The platform sources ~/.bashrc from ~/.bash_profile automatically.
  • Use variables.conf for Java application servers when the value should reach the JVM as a -D flag — this is where Java options live.

See also