# Setting Environment Variables

**URL:** <https://forums.balena.io/t/setting-environment-variables/371111>\
**Category:** Product support\
**Created:** [August 13, 2024, 2:45am UTC](https://forums.balena.io/t/setting-environment-variables/371111 "2024-08-13T02:45:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tissy](https://avatars.discourse-cdn.com/v4/letter/t/db5fbb/32.png) [@Tissy](https://forums.balena.io/u/Tissy)\
**Post date:** [August 13, 2024, 2:45am UTC](https://forums.balena.io/t/setting-environment-variables/371111/1 "2024-08-13T02:45:23Z")

</div>

Is it possible to set environment variables at build as opposed to setting them via the Balena Dashboard UI.

I have tried using the following in my Dockerfile.template and the variables are not being shown in the cloud UI.

```auto
ENV server_ip="12.34.56.789"
ENV server_port=4321
ENV heartbeat_endpoint="heartbeat"
ENV geoposition_endpoint="geoposition"

```

---

<div class="post-metadata">

**Author:** ![chrisys](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chrisys/32/1731_2.png) [@chrisys](https://forums.balena.io/u/chrisys)\
**Post date:** [August 14, 2024, 1:26pm UTC](https://forums.balena.io/t/setting-environment-variables/371111/2 "2024-08-14T13:26:30Z")

</div>

Hey @Tissy if you specify variables in this way they will work and be present for the build and the resultant image, but they’re isolated from the cloud backend, and so won’t propagate back ‘upwards’ and display in the cloud UI.

So to answer your question, you can specify them at build (and it will work), but this method is not integrated with the cloud UI.

Hope this helps!
