Browse all topics

Build & deploy

Environment variables

Where to put secrets and settings, and which ones Dadisiweb sets for you.

Environment variables carry settings and secrets such as database passwords and API keys. Add them in Settings → Environment variables, one KEY=value per line.

  • They are available while building and while running.
  • Never commit secrets to your repository. Put them here instead.
  • After you save a change, the project is redeployed so the new values are used.
  • Values you set always win. Dadisiweb never overwrites a variable you defined.

Variables Dadisiweb provides#

VariableValue
PORT, APP_PORTThe port your app must listen on.
APP_DOMAINYour project address, for example myapp.on.dadisiweb.com.
APP_URLThe full address, for example https://myapp.on.dadisiweb.com.
APP_IDA unique id for your project.
DATA_DIR/data, your persistent storage folder. See Persistent storage.
CUSTOM_DOMAINSA comma-separated list of the custom domains connected to your project, if any. Handy for host checks and CSRF settings.

Node.js apps also receive HOST=0.0.0.0.

Using your address in values#

You do not need to know your address in advance. Write a placeholder and it is replaced at every deploy:

PlaceholderBecomes
${APP_DOMAIN}myapp.on.dadisiweb.com
${APP_URL}https://myapp.on.dadisiweb.com
${PROJECT_SLUG}myapp
${PRIMARY_DOMAIN}Your first connected custom domain, or your project address if none
${PRIMARY_URL}https:// plus the line above
APP_URL=${PRIMARY_URL}
CSRF_TRUSTED_ORIGINS=${APP_URL}

Anything else written as ${...} is left exactly as you typed it.

Choosing your address#

When you create a project you can pick the address yourself, for example my-site for my-site.on.dadisiweb.com. We check it is free as you type. Use 3 to 40 lowercase letters, numbers and hyphens. If you leave it empty we use your project name, and add a short suffix if that name is taken. The address cannot be changed later; connect a custom domain if you want something different.

Settings that change how your project is built#

These are read while your project is built, not just when it runs.

VariableWhat it does
SYSTEM_PACKAGESExtra system libraries to install before your build, separated by spaces or commas. For example postgresql-dev protobuf-dev.
PHP_EXTENSIONSExtra PHP extensions for PHP projects, for example imagick gmp.
PHP_VERSION, NODE_VERSION, PYTHON_VERSION, GO_VERSIONThe language version to build and run with, for example PHP_VERSION=8.3. Defaults are PHP 8.5, Node 20, Python 3.12 and the current Go 1 release.

Names are checked, and anything that is not a plain package or extension name is ignored with a note in the deploy log.

What we install for you#

You usually do not need these settings. We read your project's own dependency files and add the common system libraries they imply, and the deploy log lists what was found:

  • PHP: every ext-… entry in composer.json or composer.lock becomes an installed extension.
  • Python: libraries for packages that compile code, such as psycopg2, mysqlclient, Pillow and lxml.
  • Node.js: build tools for packages with native code, such as bcrypt and sqlite3.

Use SYSTEM_PACKAGES and PHP_EXTENSIONS only for something we did not detect.

Defaults that depend on your runtime#

If you do not set them yourself, these are filled in:

Python (Django and similar): ALLOWED_HOSTS, CSRF_TRUSTED_ORIGINS, SECRET_KEY, DEBUG=False, STATIC_URL, STATIC_ROOT, MEDIA_URL, MEDIA_ROOT. See the Python guide for exactly what they contain.

PHP: APP_URL (your address with https://) and FILESYSTEM_DISK=local.

Tips#

  • Lines starting with # are ignored.
  • Put a value containing spaces in quotes: APP_NAME="My App".
  • Do not include export. Just KEY=value.
  • Need a password for a Dadisiweb database? Copy it from the database's page; see Databases.