Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk11 min

How to Use Shared Environment Variables Across Projects in Coolify

A practical guide to Coolify shared variables: choose the right scope, reference values in each resource, apply changes correctly, troubleshoot stale references, and protect secrets.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Coolify shared variables let multiple applications, databases, and services reuse one value without duplicating it, but they are not injected automatically. Define the value at the narrowest suitable scope—team, project, environment, or server—then add an explicit reference such as {{team.NODE_ENV}} to every consuming resource. Save the resource variable and redeploy or restart so the workload receives the resolved value.

What Coolify shared variables do—and what they do not do

A shared variable is a named value stored in Coolify for reuse by resources. The definition acts as a central source, while each application, database, or service still declares which workload-facing key it needs. For example, you can store one database host as DB_HOST at environment scope and map it into an application with DATABASE_URL={{environment.DB_HOST}}.

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.

Creating a shared variable alone does not add it to every resource. This explicit-reference model prevents unrelated workloads from receiving values accidentally and lets two resources expose the same shared value under different local names. An API might use DATABASE_URL, while a migration job uses DB_CONNECTION, even though both point to one shared definition.

References are resolved when Coolify prepares the resource configuration. A locked reference remains a reference rather than becoming a copy of the secret in the resource editor. That helps keep sensitive values centralized, but it also means you must maintain the shared definition and its consumers together.

#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.

Choose the correct scope before creating the variable

Coolify provides four fixed scope keywords. Select the narrowest scope that reaches every consumer. A narrower scope reduces accidental exposure and makes it clearer who owns and changes the value.

Scope Reference keyword Reach Typical use Ownership and isolation
Team wide team Resources in the active team, including resources in different projects A value intentionally shared across projects managed by the same team Broadest team-level reach; every project in that team can reference it
Project wide project Resources belonging to one project Defaults used by several applications or services in a single project Isolated from other projects while remaining available to all resources in this project
Environment wide environment Resources in one project environment, such as staging or production Values that must differ between environments Useful for separating production and staging without duplicating project structure
Server wide server Resources deployed on the server running the workload Host-specific endpoints or settings when similar configurations run on different servers Tied to infrastructure placement rather than team or project membership

Do not substitute a team, project, environment, or server name into the syntax. The scope word is literal. A team-scoped value uses {{team.NAME}}, not {{my-team.NAME}}. Likewise, project, environment, and server references use {{project.NAME}}, {{environment.NAME}}, and {{server.NAME}}.

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.

Step-by-step: create and consume a shared variable

1. Open Shared Variables

In the Coolify dashboard, open Shared Variables from the sidebar. Start here rather than adding a duplicated value separately to each application.

2. Select the narrowest scope

Choose Team wide, Project wide, Environment wide, or Server wide. Confirm that every intended consumer is inside that scope. If one application is in a different project, a project-scoped variable will not reach it; use team scope only when that broader access is intentional.

3. Add the name and value

Enter a stable variable name, its value, and an optional comment explaining its purpose, owner, or rotation expectations. Keep names descriptive and consistent with the consuming software. If the value contains line breaks—such as a certificate, private key, or other multiline material—select the Multiline value type instead of trying to encode line breaks into a single-line field.

For secrets, use Coolify’s locked handling where available. Treat the dashboard value, exports, API credentials, and deployment output as sensitive. Do not paste a resolved secret into a public issue, screenshot, or deployment log.

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

4. Add a workload-facing variable to each consumer

Open the application, database, or service that needs the value and go to Environment Variables. Create the key expected by that workload and set its value to a shared reference.

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.
  • NODE_ENV={{team.NODE_ENV}} uses a team-wide definition.
  • DATABASE_URL={{environment.DB_HOST}} maps an environment-wide host into the application’s DATABASE_URL key.
  • API_ORIGIN={{project.PUBLIC_API_ORIGIN}} consumes a project-wide endpoint.
  • TLS_CERT={{server.TLS_CERT}} reads a server-scoped certificate where the service is deployed.

Repeat this mapping for every consumer. The shared definition is not a broadcast mechanism, so a resource that lacks a reference will not receive the value.

5. Save and apply the configuration

Save the resource’s environment-variable settings. Then choose the appropriate lifecycle action:

  • Redeploy when the value affects the image build, build arguments, generated artifacts, or any other build-time input. A new deployment recreates the build and runtime configuration.
  • Restart for a runtime-only change when the existing image and generated files do not need rebuilding. Restarting recreates the running process with the current configuration.

If you are unsure whether an application reads a value during its build, redeploy. A restart cannot change files or assets that were produced with an older value during image creation.

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

6. Verify without exposing the secret

Check the workload’s behavior rather than printing the complete value. For a database variable, verify that the application can connect; for a feature flag, check the resulting behavior; for a certificate, inspect the service’s successful TLS status. If you must inspect a value, reveal only a non-sensitive property such as whether it is set, its length, or a redacted prefix. Never echo a production secret into a public deployment log.

Using one shared value in Docker Compose resources

For a Compose resource, put the shared reference at the location where the value is consumed and follow Coolify’s Compose interpolation rules. A single shared definition can be referenced by several services in the same stack.

For example, an API and a worker can both receive the same database connection value through their own service environment entries. Each service still needs its explicit mapping; defining DATABASE_URL once in Shared Variables does not automatically add it to both containers.

Keep the reference in the value position expected by Compose and by the application. If a service expects a URL, map the shared value to that URL variable; if it expects a file path or certificate content, use the corresponding key and the multiline value type when the shared definition contains line breaks.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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

Changing, renaming, or deleting a shared variable

Changing the value

Update the shared definition, then apply the change to each affected resource with a redeploy or restart appropriate to its usage. Existing containers do not magically reload an updated environment; they continue running with the configuration they received at creation time.

Renaming the variable

A rename changes the name that references must resolve. Search every consuming resource and replace the old expression, such as {{project.OLD_NAME}}, with the new one before deploying. A definition can be valid while consumers still point at the old name, producing an unresolved reference.

Deleting the variable

Deleting a shared definition does not remove stored reference text from resource configurations. Clean up or replace those references before the next deployment. Otherwise the resource can retain a stale expression that no longer resolves.

Changing scope

Scope is part of the reference. Moving a value from project scope to team scope, for example, requires changing consumers from {{project.NAME}} to {{team.NAME}}. Plan the edit as a coordinated change: create the replacement definition, update consumers, deploy, verify, and only then remove the old definition.

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

Developer view versus Normal view

Coolify’s Developer view presents ordinary shared variables as KEY=value lines. Lines beginning with # are comments. This view is convenient for editing several ordinary variables at once, but saving applies the complete editor contents.

  • Removing an ordinary variable’s line and saving deletes that shared variable.
  • Keep comment lines intentional; they are not variable definitions.
  • Locked and multiline variables must be edited in Normal view, where their special handling is available.

Before saving a bulk edit, compare the full list with the intended state. A missing line is treated as a deletion, not as an instruction to leave the previous value untouched.

Troubleshooting unresolved or stale values

The variable is blank or unresolved

  • Check that the reference uses one of the literal scope words: team, project, environment, or server.
  • Confirm the shared variable name matches exactly, including capitalization and underscores.
  • Verify that the consumer belongs to the selected scope. A project reference cannot reach a different project.
  • Make sure the shared definition still exists; deleting it leaves old reference text behind.
  • Save the resource variable after correcting the expression, then redeploy or restart.

The dashboard shows the new value but the container uses the old one

Running containers keep the environment they received at startup. Apply a restart for runtime-only changes. If the value is used during image construction or changes generated files, perform a new deployment instead.

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.

Only one service in a Compose stack changed

Inspect each service’s environment section. Shared variables are not automatically injected into every service, so the API, worker, scheduler, and other components need their own references where they consume the value. Redeploy the stack after all mappings are saved.

A multiline value is corrupted

Edit the definition in Normal view and set its type to Multiline. Do not flatten a private key or certificate into an ordinary single-line value. Confirm that the consuming application expects the content directly or expects a mounted path; a variable containing certificate text is not the same as a file mount.

A value appears in logs

Stop commands or health checks that print the environment, rotate the exposed credential, and replace the logged value. Use locked references and redact diagnostics. Logging a variable once is still a disclosure; restarting the service does not erase copies from log storage.

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

Security and secret-management boundaries

Shared variables reduce duplication, but they do not replace access control. A team-scoped secret is reachable by every resource in that team that is configured to reference it. Use project or environment scope when fewer workloads need access, and separate staging credentials from production credentials.

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

Keep secret references locked where possible. A locked reference remains a pointer and cannot be copied from the resource as a plain secret value. Limit dashboard permissions, protect API tokens, and avoid placing secrets in Compose files, source control, screenshots, or shell commands that are recorded by CI systems.

For sensitive values used across many projects, an external secret manager may provide stronger separation, auditing, and rotation workflows. Coolify service documentation describes references such as {{vault.KEY}} and names Doppler, Infisical, and HashiCorp Vault as integrations. Check the selected provider’s access model, rotation behavior, backup policy, and Coolify compatibility before moving production credentials. Integration support and UI labels can change between Coolify releases.

Rotation still requires an application lifecycle action. After changing a secret in the authoritative store, redeploy or restart every workload that must receive the new value, then verify the old credential is no longer accepted where appropriate.

Automating shared variables with the API

Coolify’s API documents bearer-authenticated endpoints for listing project and environment shared variables and for creating project-scoped variables. API automation is useful for repeatable setup, environment promotion, and controlled provisioning, but the bearer token must be protected like any other secret.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Store the API token in a protected secret store, not in a repository or a public CI variable.
  • Grant only the permissions needed for the automation account.
  • Review the target scope before creating a variable; an automated team-wide value has a wider blast radius than a project value.
  • Make scripts idempotent so rerunning them does not create conflicting names or overwrite an unrelated definition.
  • Do not print API responses containing secret values to build logs.

Because API paths and payloads can vary by Coolify release, use the endpoint and schema shown by the documentation for the version you operate rather than copying an old example unchanged.

Managing definitions as infrastructure code

If shared-variable definitions should be reviewed, versioned, and reproduced, the Terraform Provider for Coolify documents a coolify_shared_environment_variable resource. It covers team, project, environment, and server scopes and is documented for Coolify version 4.3.0 and later.

Infrastructure-as-code is most useful when the definition—not the plaintext secret—is the item stored in version control. Keep sensitive values in Terraform’s protected variable mechanisms or an external secret system, restrict state-file access, and review plans for accidental secret exposure. Coordinate Terraform changes with application deployment so a renamed or removed definition does not leave stale resource references.

A practical organization pattern for multiple projects

Separate global conventions from environment-specific values

Use team scope for genuinely cross-project conventions, such as a value every project in the team is expected to share. Use project scope for defaults that belong to one product or platform. Use environment scope when staging and production must resolve differently. Reserve server scope for values that follow a host, not an application.

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.

Keep names stable and local mappings explicit

Choose durable shared names and map them to the variable names each workload already expects. This lets you change an implementation detail in one place without rewriting application code, while keeping the dependency visible in each resource’s Environment Variables screen.

Document ownership in comments

Use the optional comment to record what the value controls, who rotates it, and whether a redeploy is required after changes. Do not put the secret itself, recovery codes, or other sensitive material in the comment.

Use a change sequence that avoids downtime

  1. Create the replacement shared variable at the intended scope while the old definition remains available.
  2. Add or update references in every consumer.
  3. Deploy a consumer and verify its behavior without exposing the value.
  4. Roll the change through the remaining consumers.
  5. Remove the old references and definition only after all consumers have migrated.

Deployment checklist

  • The scope reaches every intended consumer and no broader audience than necessary.
  • The reference uses the literal scope keyword and the exact shared-variable name.
  • Every application, database, service, and Compose component has an explicit mapping.
  • Certificates, private keys, and other line-broken content use the Multiline type.
  • Locked handling is enabled for sensitive values, and no secret is written to logs or source control.
  • The resource has been redeployed for build-time changes or restarted for runtime-only changes.
  • Renames and deletions have been checked for stale references.
  • API tokens, Terraform state, and external secret-manager credentials are protected.
  • Verification checks behavior without printing the resolved secret.

Key takeaways

Coolify shared variables are centralized definitions with explicit per-resource references. Pick the smallest scope that covers the consumers, use syntax such as {{project.NAME}} or {{environment.NAME}}, and remember that a definition is never an automatic injection. Apply changes by restarting or redeploying according to when the value is read, keep locked secrets out of logs, and treat renames or deletions as migrations that require updating every reference.

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.

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

Leave a Reply

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

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.

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
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

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.