Skip to main content

Environment Variables

Environment variables let you pass configuration values, secrets, and connection strings to your application without hardcoding them in your source code. In Appliku, there are several ways to manage them.

Setting Variables Manually

In the Appliku dashboard, go to Application Settings > Environment Variables tab.

Add variables as key-value pairs:

DATABASE_URL=postgres://user:pass@host:5432/dbname
SECRET_KEY=my-secret-key
DEBUG=false

Click Save to store the variables. They will take effect on the next deployment.

Auto-Injected Variables

From Databases

When you provision a database and attach it to your application, Appliku automatically sets connection environment variables:

  • connection_url -- the full connection URL accessible from the public network
  • private_connection_url -- the connection URL using the server's internal network (lower latency, no external traffic)

The variable names are prefixed with the database type (e.g., DATABASE_URL, REDIS_URL).

From Domains

Appliku automatically sets a variable containing a comma-separated list of all custom domains attached to your application. This is useful for frameworks that need to know their allowed hosts.

Import and Export

You can import environment variables from a .env file format, or export your current variables in the same format. This is convenient for:

  • Migrating configuration from another platform
  • Sharing configuration between environments
  • Backing up your variables locally

Configuration via appliku.yml

Environment variables can also be defined in your appliku.yml file. Variables set in the YAML file are applied on each deployment.

Masking

Variable values are masked in the dashboard UI by default. Click the reveal button to view a value. This prevents accidental exposure of secrets when sharing your screen or taking screenshots.

Precedence

When the same variable is defined in multiple places, the following precedence applies during deployment:

  1. Volume environment variables (highest priority) -- variables injected from volumes override other sources during deployment
  2. Dashboard variables -- manually set variables and auto-injected variables

Volume environment variables override manual variables during the deployment process but do not remove or modify the values stored in the Environment Variables tab. The tab always reflects what you have set manually and what has been auto-injected.

Best Practices

  • Use environment variables for all secrets (API keys, database passwords, tokens)
  • Keep a .env.example file in your repository documenting required variables without real values
  • Use private_connection_url for database connections when the database is on the same server to avoid unnecessary network hops