Skip to main content

Environment Variables Reference

Appliku automatically injects certain environment variables into your application containers. These are set based on your application's configuration, provisioned databases, and domain settings.

Auto-Injected Variables

DATABASE_URL

Source: Provisioned database (configured via environment_variables in appliku.yml or the dashboard)

The connection URL for your primary database. Format depends on the database engine:

EngineFormat
PostgreSQLpostgresql://user:password@host:port/dbname
MySQLmysql://user:password@host:port/dbname
Redisredis://host:port/0
RabbitMQamqp://user:password@host:port/vhost
Elasticsearchhttp://host:port
note

DATABASE_URL is not automatically set. You configure which environment variable name to use and which database it connects to, either in appliku.yml or in the dashboard. The name DATABASE_URL is a common convention but you can use any name.

DATABASE_PRIVATE_URL

Same as DATABASE_URL but uses Docker's internal network hostname instead of the public IP. This is the recommended option for application containers running on the same server as the database.

Advantages of private URLs:

  • Traffic stays within Docker's internal network
  • Lower latency
  • No exposure to the public internet
  • Works even if the database port is not publicly exposed

REDIS_URL

Connection URL for a provisioned Redis instance. Follows the same public/private URL pattern as database URLs.

redis://host:port/0

ALLOWED_HOSTS

Source: from_domains: true in appliku.yml

A comma-separated list of all domains configured for your application, including the default .applikuapp.com subdomain (if enabled).

Example value:

myapp.applikuapp.com,www.example.com,example.com

This is commonly used with Django's ALLOWED_HOSTS setting:

ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "").split(",")

PORT

Source: Container port setting in Build Settings

The port number your application should listen on inside the container. This matches the container_port value from your build settings or appliku.yml.

tip

Always use the PORT environment variable in your application's startup command when possible, so it stays in sync with your build settings:

gunicorn project.wsgi --bind 0.0.0.0:$PORT

APP_NAME

The name of your application as configured in Appliku.

User-Defined Variables

In addition to auto-injected variables, you can define your own environment variables in three ways:

1. Dashboard

Go to Application > Environment Variables to add, edit, or remove variables through the web interface.

2. appliku.yml

Define variables in the build_settings.environment_variables section:

build_settings:
environment_variables:
- name: DEBUG
value: "false"
- name: SECRET_KEY
source: manual

3. From Database References

Link a variable to a provisioned database's connection URL:

build_settings:
environment_variables:
- name: DATABASE_URL
from_database:
name: db
property: private_connection_url

Available properties:

  • connection_url -- public connection URL
  • private_connection_url -- internal Docker network URL