Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk10 min

How to Set Environment Variables in Coolify Applications

A practical guide to configuring Coolify application environment variables, including dotenv imports, lifecycle scope, secret handling, shared and predefined values, Compose syntax, CLI commands, and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Open the application in Coolify, choose Environment Variables, add the key and value, select whether it is available during the image build, at runtime, or both, and save. The value is not active until you apply the change: use a new deployment when a build-time value changed, or restart when only runtime values changed and the existing image can be reused.

This guide covers dashboard entry, dotenv imports, scope selection, secrets, shared and predefined variables, Docker Compose syntax, CLI automation, and the checks that explain why a changed value is not visible.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand Coolify’s two variable lifecycles

Coolify configures environment variables per application. A variable can be consumed in two different phases:

  • Build time: the value is available while Coolify creates the container image. Frameworks may use it to compile assets, select a package mirror, or generate a configuration file.
  • Runtime: the value is injected when the already-built image starts. Application code, workers, and entrypoint scripts read it from the running container.

These controls are independent. Build and runtime exposes a value in both phases, Build only exposes it only while creating the image, and Runtime only exposes it only after the container starts. Choosing the wrong phase is the most common reason an apparently correct value is missing.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

A build-time value is part of the deployment that produced the image. Changing it requires another build. A runtime-only change can use the existing image, so a restart is normally sufficient.

What you need before adding a variable

  • Access to the correct Coolify team, project, environment, and application.
  • The exact variable name expected by the application, including capitalization and underscores.
  • The value and a decision about build-time, runtime, or both.
  • Knowledge of whether the value is a secret, a multiline value, or a literal string containing dollar signs.
  • A plan to redeploy or restart after saving.

Check the application’s own documentation for naming conventions. DATABASE_URL, DatabaseUrl, and database_url are different keys on systems that treat names as case-sensitive.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Add one variable in the dashboard’s Normal view

  1. Open the target application in Coolify.
  2. Select Environment Variables.
  3. Stay in Normal view and choose Add.
  4. Enter the variable name and value. Select the appropriate build-time and runtime availability options.
  5. Select Add variable, then save the application’s configuration.

Use one row per key in Normal view. This is the clearest method when you need to review a small number of values, set a value type, or work with a locked secret or multiline content.

Choose the value type and interpolation behavior

Passwords, API tokens, private keys, certificates, and connection strings should be treated as secrets. For a private key or certificate, set the value type to Multiline so line breaks are preserved. If dollar signs must remain exactly as entered, set interpolation to Literal; otherwise interpolation rules may interpret dollar-based sequences.

Review the completed row before saving. A typo in the key, an accidental trailing space, or a line break removed from a certificate can produce an application error that looks unrelated to Coolify.

Import dotenv entries in Developer view

Developer view is useful when you already have a dotenv-formatted block or many related variables.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
  1. Open the application’s Environment Variables page.
  2. Switch to Developer view.
  3. Paste entries in dotenv form, for example:
NODE_ENV=production
API_URL=https://api.example.com

Each assignment belongs on its own line. Lines beginning with # are ignored, so comments can document a group of settings. After pasting, save the variables and apply them with a deployment or restart as appropriate.

When Developer view is not the right tool

Locked secrets and multiline values are edited in Normal view. Return to Normal view when a certificate, private key, or protected field needs special handling. Developer view is also less convenient when you need to inspect the build/runtime toggles for individual rows.

Select the correct build and runtime scope

Scope Available while building? Available in running container? Use it for Lifecycle after a change
Build and runtime Yes Yes Values needed to compile the image and by the application after startup New deployment
Build only Yes No Compilation-only settings, build-time package access, or values consumed to generate static output New deployment
Runtime only No Yes Database endpoints, feature flags, credentials, and other settings read when the process runs Restart can reuse the existing image

Do not select Build and runtime merely because it is the broadest option. Giving a secret to the build phase increases exposure and may bake information into generated files or image layers. Conversely, a value needed by a frontend compilation step will not exist if it is marked Runtime only.

Examples of scope decisions

  • A server-side application that reads DATABASE_URL only when it starts normally needs Runtime only.
  • A static frontend that substitutes API_URL while compiling needs Build only or Build and runtime, depending on whether the running server also reads it.
  • A value used by both a build script and the process launched in the container needs Build and runtime.

Apply a saved change correctly

Saving the row changes Coolify’s configuration, but it does not by itself recreate the running environment. Coolify’s documented instruction is: Save the variables, then redeploy or restart the application so Coolify recreates the runtime environment.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When to deploy

Start a new deployment whenever a Build only or Build and runtime variable changes. The image must be rebuilt for the new value to be available during compilation. This also applies when a secret manager supplies a changed build variable.

When a restart is enough

If only Runtime only values changed and the existing image can be reused, restart the application. The container is recreated with the updated runtime environment without repeating the image build.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Confirm the result

Wait for the deployment or restart to finish, then inspect the application logs and health status. Test the behavior controlled by the variable rather than assuming that a successful deployment proves the application consumed it.

Protect secrets, especially during builds

Keep passwords, tokens, private keys, and connection strings out of source control and out of ordinary logs. Coolify warns that traditional Docker build arguments can appear in image metadata. A secret passed as a conventional build argument may therefore remain discoverable even after the build completes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When a sensitive value is genuinely required during image creation, use BuildKit build secrets if the build server supports them. Build secrets are designed to make the value available to a build step without treating it as an ordinary image argument. If the value is needed only after startup, prefer Runtime only so it never enters the build context.

Use an external secret manager for centralized control

Coolify documents integrations with Doppler, Infisical, and HashiCorp Vault. These systems can provide resolved secrets to applications while keeping the source of truth outside individual application forms. Resolved secrets are redacted from deployment logs. A change to a secret used during a build still requires a deployment; redaction does not remove the build lifecycle requirement.

Limit exposure in automation

Do not place secret values directly in shell arguments when avoidable. Shell history, process listings, CI output, and retained job logs can preserve command-line text. Prefer a protected CI secret, an input file with controlled permissions, or an external secret-manager reference.

Reuse values with shared variables

Shared variables reduce duplication across applications, but defining one does not automatically attach it everywhere. Create a shared variable at the team, project, environment, or server scope, then assign its reference to each application that should receive it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
Scope Reference syntax Typical use
Team {{team.VARIABLE_NAME}} A value shared across projects in a team
Project {{project.VARIABLE_NAME}} A value common to applications in one project
Environment {{environment.VARIABLE_NAME}} Environment-specific configuration such as staging or production
Server {{server.VARIABLE_NAME}} A value tied to a particular server

After assigning a reference in the application’s variable list, apply the resulting change with the correct deployment or restart. If an application cannot resolve a shared reference, verify both that the variable exists at the intended scope and that the application actually has the reference attached.

Use Coolify’s predefined variables

Coolify supplies predefined values that can be used without manually creating them. The documented names include:

  • COOLIFY_FQDN
  • COOLIFY_URL
  • COOLIFY_BRANCH
  • COOLIFY_RESOURCE_UUID
  • COOLIFY_CONTAINER_NAME
  • SOURCE_COMMIT
  • PORT
  • HOST

SOURCE_COMMIT is excluded from Docker builds by default. If a build step needs the commit identifier, enable its build availability explicitly. Treat predefined values like any other dependency: check the phase in which your code reads them and apply the change before testing.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Reference variables in Docker Compose applications

Coolify detects variable references in Compose files and displays them as application variables. Common forms are:

services:
  web:
    environment:
      DATABASE_URL: ${DATABASE_URL}
      LOG_LEVEL: ${LOG_LEVEL:-info}
      API_KEY: ${API_KEY:?}
  • ${DATABASE_URL} requires a value supplied to the application.
  • ${LOG_LEVEL:-info} uses info when LOG_LEVEL is empty or unset.
  • ${API_KEY:?} marks the value as required. Coolify blocks deployment while that required value is empty.

Use the default form only when the fallback is safe and intentional. A default can conceal a missing production setting. Use the required form for credentials and other values for which starting with an empty configuration would be dangerous.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Automate variables with the Coolify CLI

The official CLI can create a single variable, synchronize a dotenv file, deploy an application, and inspect the result.

Create one variable

coolify app env create <application-uuid> --key API_URL --value https://api.example.com

This is convenient for non-sensitive configuration. Avoid putting a password or token in the command itself because the value can remain in shell history or CI logs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Synchronize a dotenv file

coolify app env sync <application-uuid> --file .env.production

Synchronization updates matching keys and creates keys that are missing in Coolify. It does not delete variables that are absent from the file. That behavior protects existing settings, but it means removing a line from .env.production is not a deletion operation; remove the obsolete variable explicitly in Coolify if it must no longer exist.

Deploy and inspect

coolify deploy uuid <application-uuid>
coolify deploy list
coolify deploy get <deployment-uuid>
coolify app get <application-uuid>
coolify app logs <application-uuid>

You can deploy by application name instead of UUID where supported. Use the deployment list and detail commands to identify the deployment that contains the change, then read application logs to confirm startup behavior. Keep the dotenv file protected and do not commit production secrets to the repository.

Diagnose a variable that is missing or unchanged

The application says the variable is undefined

  • Check spelling, capitalization, and punctuation in the key.
  • Confirm the variable is attached to the intended application, not merely defined as a shared variable.
  • Check scope. A Build only variable will not appear in the running container, while a Runtime only variable will not exist during image creation.
  • For Compose, verify that the variable reference in the YAML matches the key in Coolify.

The old value is still active

  • Determine whether the changed variable is build-time or runtime.
  • For Build only or Build and runtime, create a new deployment so the image is rebuilt.
  • For Runtime only, restart the application so a new container receives the value.
  • Inspect the resulting deployment and logs rather than relying on the dashboard’s saved state.

A multiline secret is corrupted

Edit it in Normal view and set the value type to Multiline. Re-enter the content carefully, preserving line breaks. This is particularly important for private keys and certificates, where one missing newline can invalidate the entire value.

A dollar sign changes unexpectedly

Set interpolation to Literal when dollar signs are data rather than variable syntax. Then save and apply the change using the lifecycle appropriate to the variable’s scope.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A required Compose variable blocks deployment

Locate the reference using the required form, such as ${API_KEY:?}, and add a non-empty value to the application. If the value should come from a shared variable, verify that the shared reference is assigned to this application and resolves at deployment time.

A CLI sync left an obsolete key behind

This is expected behavior: sync creates and updates but does not delete keys missing from the file. Remove the obsolete key deliberately, then redeploy or restart according to its scope.

Choose the right management method

Method Best for Lifecycle control Secret exposure considerations Repeatability and verification
Dashboard Normal view A few values, locked secrets, multiline content, and visual review Per-variable build/runtime controls are visible Safer for protected fields than shell arguments; still keep values out of screenshots and logs Easy to review manually; deployment history provides verification
Dashboard Developer view Bulk dotenv-formatted entry Fast entry, followed by dashboard scope review Paste carefully; use Normal view for locked or multiline secrets Repeatable from a prepared block, but manual unless stored securely
CLI create or sync CI/CD, scripted provisioning, and repeatable configuration Deployment or restart must still match the variable’s scope Keep secret values out of arguments, history, and CI logs Highly repeatable; inspect deployment and application logs after applying
Shared-variable reference Values reused across applications or environments Each consuming application still needs its own assignment and lifecycle action Centralizes control, but access should match the scope where the value is defined Reduces duplication; verify resolution on every consuming application
External secret-manager reference Centralized secret rotation and access control Build consumers still require a deployment when the resolved value changes Resolved secrets are redacted from deployment logs; build handling still matters Good for repeatable operations when integration and permissions are managed

Operational checklist

  1. Identify the exact application and environment.
  2. Write the key exactly as the application expects it.
  3. Choose Build only, Runtime only, or Build and runtime based on when the code reads the value.
  4. Use Normal view for locked secrets and multiline values; use Developer view for straightforward dotenv batches.
  5. Use Literal interpolation when dollar signs must remain unchanged.
  6. For shared values, define the variable at the required scope and attach its reference to the application.
  7. For Compose, inspect defaults and required-value syntax before deploying.
  8. Keep sensitive values out of Docker build arguments, shell history, source control, and CI logs.
  9. Save the configuration.
  10. Redeploy for build-time changes; restart for runtime-only changes when the image can be reused.
  11. Check deployment status and application logs, then test the feature that consumes the variable.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.