# Programmatically Assigning Hosts to Servers?

**URL:** <https://forum.pritunl.com/t/programmatically-assigning-hosts-to-servers/2247>\
**Category:** Pritunl VPN\
**Created:** [July 30, 2024, 9:35pm UTC](https://forum.pritunl.com/t/programmatically-assigning-hosts-to-servers/2247 "2024-07-30T21:35:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harrisonjohn](https://forum.pritunl.com/user_avatar/forum.pritunl.com/harrisonjohn/32/353_2.png) [@harrisonjohn](https://forum.pritunl.com/u/harrisonjohn)\
**Post date:** [July 30, 2024, 9:35pm UTC](https://forum.pritunl.com/t/programmatically-assigning-hosts-to-servers/2247/1 "2024-07-30T21:35:17Z")

</div>

We are managing the image through image builder and want to automatically deploy a new ami every few weeks.

Is there the possibility yet to attach the hosts to a server through the api or cli?

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [August 1, 2024, 12:51pm UTC](https://forum.pritunl.com/t/programmatically-assigning-hosts-to-servers/2247/2 "2024-08-01T12:51:02Z")

</div>

There’s no option to attach hosts with the CLI. The file `/var/lib/pritunl/pritunl.uuid` stores the host ID, this ID can be transferred to new hosts to maintain the host configuration.
