# Add Hostname to Title

**URL:** <https://discourse.nodered.org/t/add-hostname-to-title/71242>\
**Category:** Dashboard\
**Created:** [25 November 2022 11:29 UTC](https://discourse.nodered.org/t/add-hostname-to-title/71242 "2022-11-25T11:29:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ServiceISRI](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@ServiceISRI](https://discourse.nodered.org/u/ServiceISRI)\
**Post date:** [25 November 2022 11:29 UTC](https://discourse.nodered.org/t/add-hostname-to-title/71242/1 "2022-11-25T11:29:43Z")

</div>

Hello,

Please add the hostname to the title.

In default configuration add the hostname to the default title, like on the Node-RED Editor.

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/c/ccd5bbcde0cff52b09a3080530dc35f693ffdf02.png)

Regards

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [25 November 2022 13:21 UTC](https://discourse.nodered.org/t/add-hostname-to-title/71242/2 "2022-11-25T13:21:18Z")

</div>

You can set the Title to anything you like.... including an environment variable that is read at deploy time. So you can for example set (outside of Node-RED) in Linux.  
`export myName=$(hostname)`  
then run Node-RED and set the title to `${myName}`  
and it will show the hostname as the title.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [25 November 2022 13:31 UTC](https://discourse.nodered.org/t/add-hostname-to-title/71242/3 "2022-11-25T13:31:02Z")

</div>

Or you can set it in the ui-template

```auto
<script> document.title = "Dashboard " + window.location.hostname;</script>

```

```auto
[{"id":"faee0a1bb1157647","type":"ui_template","z":"452103ea51141731","group":"2d4fe667.28f8ba","name":"","order":17,"width":0,"height":0,"format":"<script> document.title = \"Dashboard \" + window.location.hostname;</script>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"global","className":"","x":180,"y":3800,"wires":[[]]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":2,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![ServiceISRI](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@ServiceISRI](https://discourse.nodered.org/u/ServiceISRI)\
**Post date:** [29 November 2022 09:43 UTC](https://discourse.nodered.org/t/add-hostname-to-title/71242/4 "2022-11-29T09:43:43Z")

</div>

Thanks very much.

I can set the Variable in settings.js too:

```auto
hostname = require('os').hostname();
process.env.HOST_TITLE = hostname;

```

And load the variable ${HOST\_TITLE}

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [29 November 2022 10:41 UTC](https://discourse.nodered.org/t/add-hostname-to-title/71242/5 "2022-11-29T10:41:37Z")

</div>

ah yes - you can do that also.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 December 2022 10:41 UTC](https://discourse.nodered.org/t/add-hostname-to-title/71242/6 "2022-12-13T10:41:52Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
