Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
VGSources
Blog

How to Set Environment Variables in Coolify Applications

A practical guide to adding environment variables in Coolify, choosing build-time versus runtime scope, handling secrets, using shared values and Compose syntax, and verifying changes through the dashboard or CLI.
WorldCoolify Applications Length11 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Open the application in Coolify, select Environment Variables, add the key and value, choose whether it is available at build time, runtime, or both, then save and redeploy or restart. A build-time value requires a new deployment; a runtime-only change can normally take effect after a restart. The distinction explains most “variable is missing” and “my change did nothing” problems.

The correct Coolify workflow at a glance

Coolify stores environment variables per application. You can enter them one at a time in Normal view, paste dotenv-formatted text in Developer view, or manage them through the official CLI. In every case, configuration and activation are separate operations: saving changes the application configuration, while a restart or deployment recreates the container with the new environment.

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.
  1. Open the target application in Coolify.
  2. Select Environment Variables.
  3. Add a variable in Normal view, or paste dotenv entries in Developer view.
  4. Choose the variable’s build-time and runtime availability.
  5. Save the variables.
  6. Redeploy if a build-time value changed; restart if only runtime values changed and the existing image is still suitable.
  7. Verify the resulting deployment and application behavior without exposing the value in logs.

Build-time and runtime are different environments

Coolify provides two independent availability controls. They determine when a process can read a value, not merely whether the variable exists in the application settings.

Selection Available during image build? Available in the running container? Typical use
Build and runtime Yes Yes A value needed by a build command and by the application after startup.
Build only Yes No A package-registry token or other input used only while creating the image.
Runtime only No Yes Database credentials, API endpoints, feature flags, and other values read when the process runs.

A front-end framework that substitutes an API URL while compiling needs that URL at build time. A server that reads a database password when it starts needs the password at runtime. If you select Runtime only for a value consumed by a build script, the build cannot see it. If you select Build only for a value the process reads after startup, the container will not receive it.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

When uncertain, identify the exact command that consumes the value. Commands in a Dockerfile, build hook, dependency installation step, or asset compilation phase need build availability. Code executed by the started service needs runtime availability. Selecting both is appropriate only when both phases genuinely require the value.

Add a variable in the dashboard

Normal view: one variable at a time

  1. In Coolify, open the application that should receive the setting.
  2. Choose Environment Variables from the application navigation.
  3. Stay in Normal view and select Add.
  4. Enter the variable name exactly as the application expects it, such as API_URL or NODE_ENV.
  5. Enter the value. Check for leading or trailing spaces; they become part of the value in many applications.
  6. Choose the build-time and runtime scope deliberately.
  7. Select Add variable, then save the environment-variable changes.

Use the application’s documented spelling and capitalization. Environment-variable names are conventionally uppercase with underscores, but Coolify does not translate a misspelled key into the name your code expects.

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

Developer view: paste dotenv-formatted entries

Developer view is useful when you already have a block of dotenv-style configuration. For example:

NODE_ENV=production
API_URL=https://api.example.com
LOG_LEVEL=info

Each non-comment line contains a key, an equals sign, and its value. Lines beginning with # are ignored, so you can annotate a block:

# Public service endpoint
API_URL=https://api.example.com
# Application mode
NODE_ENV=production

Use Normal view for locked secrets and multiline values. Developer view is intended for dotenv-formatted entries, not for safely formatting a private key or certificate that spans several lines.

Names and values that commonly cause mistakes

  • Do not add spaces around the equals sign unless the consuming application explicitly expects them.
  • Preserve URL schemes, port numbers, and required path components.
  • Check whether the application expects a Boolean such as true or a quoted string; environment variables arrive as text.
  • Do not paste a shell command such as export API_URL=... when the field expects dotenv syntax.
  • Keep comments on their own lines in Developer view.

Save, restart, or redeploy?

Saving a variable does not by itself alter a running container. Coolify’s documented instruction is: “Save the variables, then redeploy or restart the application so Coolify recreates the runtime environment.” Choose the lifecycle action based on the scope of the change.

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.
What changed? Action Why
Build-time value Start a new deployment The image or build output may depend on the value, so the build must run again.
Runtime-only value Restart the application The existing image can be reused while the container is recreated with a new environment.
Both build and runtime Start a new deployment Both the image and the running container may need the changed value.

A restart cannot retroactively change files that were generated during an earlier image build. Conversely, rebuilding is unnecessary for a purely runtime setting when the image itself remains valid. If the application caches configuration internally, its own reload behavior may require a full process restart even after Coolify has recreated the container.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Handle passwords, tokens, and private keys safely

Treat passwords, access tokens, private keys, certificates, and connection strings as secrets. Limit who can view or edit them, avoid copying them into tickets or chat, and do not print them from diagnostic commands or application logs.

Multiline values

Private keys and certificates often contain line breaks. In Normal view, set the value type to Multiline and preserve the complete content, including required header and footer lines. Do not flatten a PEM key into one line unless the application specifically documents an escaped format.

Literal interpolation for dollar signs

If a secret contains dollar signs that must remain unchanged, set interpolation to Literal. Otherwise, a value containing interpolation syntax can be interpreted rather than passed byte-for-byte as entered. This matters for generated passwords, signing material, and connection strings that include dollar signs.

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.

Build-time secret exposure

Build-time secrets need special care. Coolify warns that traditional Docker build arguments can appear in image metadata. A token passed as a conventional build argument may therefore remain discoverable in the resulting image or its history even if the final application never uses it at runtime.

When the build server supports it, use BuildKit build secrets for sensitive build-time data instead of ordinary Docker build arguments. Design the build so the secret is mounted only for the command that needs it and is not copied into the image filesystem or emitted by a log statement. A secret that is safe at runtime is not automatically safe during an image build.

Use an external secret manager when central control is needed

Coolify documents integrations with Doppler, Infisical, and HashiCorp Vault. These systems can supply resolved secrets to an application without requiring each secret to be manually maintained in every application form.

Resolved secrets are redacted from deployment logs. A change to a secret used by the build still requires a deployment; redaction does not make a new image appear automatically. A runtime-only secret can normally be applied with a restart when no image rebuild is needed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

External management is most useful when several services share credentials, when rotation is governed outside the deployment platform, or when audit and access controls need to be centralized. It adds integration configuration and another dependency, so a small single-application deployment may be simpler with Coolify’s own protected variable fields.

Share variables across projects, environments, or servers

Shared variables reduce repeated entry. Coolify can define a shared variable at team, project, environment, or server scope. Reference it from an application with the corresponding expression:

Scope Reference format
Team {{team.VARIABLE_NAME}}
Project {{project.VARIABLE_NAME}}
Environment {{environment.VARIABLE_NAME}}
Server {{server.VARIABLE_NAME}}

Creating a shared variable does not attach it automatically to every application. Add the reference to the application’s own variable configuration first. If an application has no reference, changing the shared value has no effect on that application.

Use the narrowest scope that matches the ownership of the value. A project-level database setting should not be promoted to team scope merely because several applications currently use it. Shared references also deserve the same build/runtime decision as direct values: mark the application reference for the phase that consumes it.

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

Coolify’s predefined environment values

Coolify supplies predefined values that can be useful in application configuration and deployment scripts, including:

  • 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 the build needs the commit identifier—for example, to embed a version string—enable its build availability. A value available to the running container is not automatically available while the image is being created.

Before depending on a predefined value, confirm the phase in which your command reads it and whether the deployment type supplies it. The names above are exact; use them without changing capitalization.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Environment variables in Docker Compose applications

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
services:
  web:
    environment:
      DATABASE_URL: ${DATABASE_URL}
      LOG_LEVEL: ${LOG_LEVEL:-info}
      API_KEY: ${API_KEY:?}

Direct substitution

${DATABASE_URL} requires Coolify to provide DATABASE_URL. The Compose service receives the substituted value when the application is deployed.

Defaults

${LOG_LEVEL:-info} uses info when LOG_LEVEL is empty or unset, according to Compose substitution behavior. Use a default only when silently accepting that fallback is safe.

Required values

${API_KEY:?} marks the value as required. Deployment is blocked while the required value is empty. This is preferable to allowing a service to start with an unusable credential and fail later in a less obvious way.

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

Compose syntax and application-variable scope solve different problems. The Compose expression describes how the service consumes the value; Coolify still needs the variable configured with the correct build or runtime availability.

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

Manage variables with the Coolify CLI

The official CLI is useful for repeatable setup and CI workflows. Create one variable with:

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

Synchronize a dotenv file with:

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

Synchronization updates matching keys and creates missing ones. It does not delete variables that are absent from the file, so removing a line from .env.production is not a deletion operation in Coolify. Remove obsolete values explicitly through the appropriate application settings when that is the intended result.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Deploy by UUID:

coolify deploy uuid <application-uuid>

You can also deploy by name when your CLI workflow uses application names. Afterward, inspect the deployment and application state with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
coolify deploy list
coolify deploy get <deployment-uuid>
coolify app get <application-uuid>
coolify app logs <application-uuid>

Do not put sensitive values in command arguments when avoidable. Shell history, CI output, process inspection, and copied command transcripts can retain them. Prefer a protected file, an interactive mechanism, or a secret-manager integration, and ensure the file permissions and CI masking rules are appropriate.

Verify that the value reached the right phase

Verification should prove availability without printing the secret itself. Check a non-sensitive variable, a Boolean presence test, or the application’s documented health behavior rather than dumping the complete environment.

  1. Confirm the key spelling in Coolify matches the application’s expected name.
  2. Confirm the variable is attached to the correct application, especially when using a shared-variable reference.
  3. Check whether the consuming command runs during image build or after container startup.
  4. Confirm the selected scope includes that phase.
  5. Save the change and perform the required restart or deployment.
  6. Review the deployment status and logs for errors, while ensuring the application does not echo secret values.
  7. Test the feature that consumes the setting, such as a database connection or API request.

Troubleshoot the most common failures

The application says the variable is missing during build

The variable is probably Runtime only. Change its scope to include build time, save, and launch a new deployment. A restart cannot make a build-time value appear in an already-created image.

The running container still has the old value

Saving alone does not recreate the runtime environment. Restart the application for a runtime-only change, or deploy again when the value also affects the build. Confirm that you edited the intended application rather than a similarly named project or environment.

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

A shared variable change has no effect

Check that the application contains a reference such as {{project.VARIABLE_NAME}}. Defining the shared variable at team, project, environment, or server level does not attach it automatically.

A Compose deployment is blocked

Look for a required expression such as ${API_KEY:?}. Supply a non-empty value in the application’s Environment Variables settings, then retry the deployment. If the value should be optional, revise the Compose expression to use an explicitly safe default rather than leaving a required marker.

A private key is malformed

Re-enter it in Normal view as a Multiline value and preserve every line break and delimiter. Also check whether interpolation is changing dollar signs; select Literal when the characters must pass through unchanged.

A build secret appears in logs or image history

Stop using a conventional Docker build argument for that secret. Rotate the exposed credential, remove it from image layers where possible, and switch to BuildKit build secrets when supported. Avoid commands that print the secret while testing the replacement.

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

Choose the management method that fits the application

Method Best for Lifecycle requirement Secret exposure considerations Repeatability and verification
Dashboard Normal view Careful manual edits, locked secrets, and multiline values. Restart for runtime-only changes; deploy for build-time changes. Values stay in the application configuration; protect dashboard access and avoid copying them elsewhere. Easy to review visually, but manual repetition is error-prone across many applications.
Dashboard Developer view Bulk dotenv-formatted entry. The same restart/deployment distinction applies. Convenient for pasting, but a pasted block can expose several secrets at once; use Normal view for locked and multiline values. Fast for a known file format, with less per-key visual checking.
CLI Automation, provisioning, and repeatable deployments. Run the appropriate deploy or restart workflow after changes. Command arguments and CI logs can retain secrets; use protected inputs and masking. Highly repeatable; deployment, application, and log commands provide scriptable checks.
Shared-variable reference Values reused by applications within a defined team, project, environment, or server scope. Restart or deploy affected applications according to their selected phase. Centralizes access, but every application reference must be controlled. Reduces duplication; verify both the shared definition and the application attachment.
External secret manager Central rotation, audit controls, and multi-application secret delivery. Build consumers still require a new deployment; runtime consumers generally require a restart. Resolved secrets are redacted from deployment logs, but integration access must be secured. Strong central repeatability, with additional integration and availability dependencies.

A practical pre-deployment checklist

  • The variable name exactly matches the code, Dockerfile, build hook, or Compose file.
  • The value is attached to the intended Coolify application.
  • Build-time and runtime availability match the phase that consumes it.
  • Multiline secrets use the Multiline type.
  • Dollar signs that must remain literal use Literal interpolation.
  • Build-time credentials do not rely on exposed Docker build arguments.
  • Shared variables are referenced by the application rather than merely defined at a higher scope.
  • Compose required expressions have non-empty values before deployment.
  • SOURCE_COMMIT has build availability enabled if the image build needs it.
  • The change has been saved, followed by a restart or deployment as appropriate.
  • CLI commands and CI logs do not reveal secret values.
  • Deployment status and a non-secret functional check confirm the new configuration.

What to remember

Coolify environment variables are application configuration with an explicit lifecycle. Add them under the application’s Environment Variables screen or through the CLI, decide independently whether the build and the running container need each value, and then recreate the affected environment. Use protected multiline and literal settings for sensitive formats, BuildKit secrets for sensitive build inputs, shared references when duplication is the problem, and an external secret manager when centralized rotation and access control justify the added integration.

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 quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.