> For the complete documentation index, see [llms.txt](https://docs.defguard.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.defguard.net/using-defguard-for-end-users/desktop-client/instance-configuration.md).

# Instance configuration

In this guide, you will learn how to add, remove and update Instance in Defguard desktop client.

{% hint style="warning" %}
Defguard Desktop Client is required if you want to use Multi-Factor Authentication, as any other WireGuard client doesn't support this functionality.
{% endhint %}

### Obtaining URL and Token

{% hint style="info" %}
If you are looking for how to generate tokens for your users as an Administrator, look here:

[Adding client device](https://docs.defguard.net/features/wireguard/remote-desktop-activation.md)
{% endhint %}

1. Log in to your Defguard account.
2. Go to **My Profile** tab and select **Devices** tab.

<figure><img src="https://content.gitbook.com/content/pE5yODhpiy5pT1XxY0BS/blobs/eKEOkHnnwGDmxOi8QhXk/defguard-myprofile-tab-devices-tab-marked.png" alt="" width="50%"><figcaption></figcaption></figure>

3. Click **Add new device** button.

<figure><img src="https://content.gitbook.com/content/pE5yODhpiy5pT1XxY0BS/blobs/eNlqa73Nl9pXR5I2Yh2A/defguard-devices-add-new.png" alt="" width="50%"><figcaption></figcaption></figure>

4. Click **Client Activation**.

<figure><img src="https://content.gitbook.com/content/pE5yODhpiy5pT1XxY0BS/blobs/R6q72ztgyFLtQeiMK527/client-activation.png" alt="" width="50%"><figcaption></figcaption></figure>

5. Afterwards, use **One-Click Configuration** or click **Show advanced configuration** and copy **URL** and **Token** manually.

<figure><img src="https://content.gitbook.com/content/pE5yODhpiy5pT1XxY0BS/blobs/tRSaGw4VArqtFxixM7l9/client-activation-instance-configuration.png" alt="" width="375"><figcaption></figcaption></figure>

### Manually Adding Instance

1. If you don't have **Defguard** in full view mode, open **Defguard** from tray view, and click **Open Defguard**

<figure><img src="https://content.gitbook.com/content/pE5yODhpiy5pT1XxY0BS/blobs/gSvbFh6HU6TjHK3rC307/tray-view-open-defguard-marked.png" alt="" width="50%"><figcaption></figcaption></figure>

2. Click **Add Instance**.

<figure><img src="https://content.gitbook.com/content/pE5yODhpiy5pT1XxY0BS/blobs/zZpQYQtN1nGj0lUbsTEA/add-instance-full-view.png" alt=""><figcaption></figcaption></figure>

3. Enter URL, Token and Device name of your choice, then click **Add Instance**. (If you don't have URL/Token, check out [this section](#obtaining-url-and-token))

<figure><img src="https://1370451937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpE5yODhpiy5pT1XxY0BS%2Fuploads%2Fgit-blob-a1839754df588497e69376693ab2c730b58f9ae9%2Fadd-instance-credentials.png?alt=media" alt=""><figcaption></figcaption></figure>

### One-click Desktop Configuration

You can skip the whole process of entering the token/URL by clicking "One-Click Desktop Configuration". Here is a video describing the whole process:

{% embed url="<https://www.youtube.com/embed/q5-AXOPLgHc>" %}

### Connecting to Instance

#### Desktop client in full view mode

1. Go to **Instances**

<figure><img src="https://content.gitbook.com/content/pE5yODhpiy5pT1XxY0BS/blobs/khSibmmn0Dtj2vULKJjO/instance-view-marked.png" alt=""><figcaption></figcaption></figure>

2. Select the instance you want to use

<figure><img src="https://content.gitbook.com/content/pE5yODhpiy5pT1XxY0BS/blobs/WQcU8zsPozLEzyVFzU0j/selected-instance-marked.png" alt=""><figcaption></figcaption></figure>

3. Choose allowed traffic

{% hint style="info" %}

* **Predefined traffic only** will only route traffic specified by your administrator.
* **All traffic is allowed** will route everything through VPN tunnel.
  {% endhint %}

<figure><img src="https://1370451937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpE5yODhpiy5pT1XxY0BS%2Fuploads%2Fgit-blob-d2c7cea8545f53836c08c3acefd289edc5e080d3%2Fallowed-traffic-marked.png?alt=media" alt=""><figcaption></figcaption></figure>

4. Click **Connect VPN**

<figure><img src="https://1370451937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpE5yODhpiy5pT1XxY0BS%2Fuploads%2Fgit-blob-27953cb0492977de698b59dc1209e28fa1989ff5%2Fconnect-vpn-full-view.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Desktop client in tray view mode

1. Click on instance list

<figure><img src="https://1370451937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpE5yODhpiy5pT1XxY0BS%2Fuploads%2Fgit-blob-c16f8a47849c3742f63be30d7115844115f15e92%2Finstance-list-marked.png?alt=media" alt=""><figcaption></figcaption></figure>

2. Select the instance you want to connect to

<figure><img src="https://content.gitbook.com/content/pE5yODhpiy5pT1XxY0BS/blobs/eylf9CP5rwW4Sg2HiEJe/selected-instance-on-list-marked.png" alt=""><figcaption></figcaption></figure>

3. Choose allowed traffic

{% hint style="info" %}

* **Predefined traffic only** will only route traffic specified by your administrator.
* **All traffic is allowed** will route everything through VPN tunnel.
  {% endhint %}

<figure><img src="https://1370451937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpE5yODhpiy5pT1XxY0BS%2Fuploads%2Fgit-blob-2699f55be312963d8c38425d46eaaeae321fce0e%2Fallowed-traffic-tray-view.png?alt=media" alt=""><figcaption></figcaption></figure>

4. Click **Connect VPN**

<figure><img src="https://1370451937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpE5yODhpiy5pT1XxY0BS%2Fuploads%2Fgit-blob-65dbf04bd542450e66519a31297eaa3475fdba59%2Fconnect-tray-view-marked.png?alt=media" alt=""><figcaption></figcaption></figure>

### Disconnecting from Instance

Click **Disconnect** next to the location you are currently connected to.

<figure><img src="https://1370451937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpE5yODhpiy5pT1XxY0BS%2Fuploads%2Fgit-blob-d2f692f3a9003e55a8356bba27722375e65a3487%2Fdisconnect-marked.png?alt=media" alt=""><figcaption></figcaption></figure>

### Updating Instance

If you want to update your instance manually:

1. If you don't have **Defguard** in full view mode, open **Defguard** from tray view, and click **Open Defguard**

<figure><img src="https://content.gitbook.com/content/pE5yODhpiy5pT1XxY0BS/blobs/gSvbFh6HU6TjHK3rC307/tray-view-open-defguard-marked.png" alt="" width="50%"><figcaption></figcaption></figure>

2. Go to your Instance and click **Instance settings**

<figure><img src="https://content.gitbook.com/content/pE5yODhpiy5pT1XxY0BS/blobs/vTVYbnBnIkEhX7mrgjBp/client-instance-settings-marked.png" alt=""><figcaption></figcaption></figure>

3. Click **Update**

<figure><img src="https://content.gitbook.com/content/pE5yODhpiy5pT1XxY0BS/blobs/iRxGDCSqzyYpDj0lWunm/update-marked-instance-settings.png" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Only tokens issued from that specific instance will work.
{% endhint %}

4. Enter Token provided by your administrator, or generate it [on your own](#obtaining-url-and-token). Then click **Update**

<figure><img src="https://1370451937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpE5yODhpiy5pT1XxY0BS%2Fuploads%2Fgit-blob-3eaabb976667db34370f55b7a636590d9e291656%2Ftoken-update-instance.png?alt=media" alt=""><figcaption></figcaption></figure>

Your Instance will update immediately.

### Why do instances need updates?

Defguard Desktop stores all information locally and doesn't communicate with Defguard outside the registration process. This means that the information about an instance is a snapshot of the moment you registered it in the desktop client, and you might want to update it, for example when locations are added or removed.

{% hint style="success" %}
If you have a Business or Enterprise plan, all desktop clients and all instances are [synchronized automatically and in real-time.](https://docs.defguard.net/features/remote-user-enrollment/automatic-real-time-desktop-client-configuration.md)
{% endhint %}

### Removing Instance

1. If you don't have **Defguard** in full view mode, open **Defguard** from tray view, and click **Open Defguard**

<figure><img src="https://content.gitbook.com/content/pE5yODhpiy5pT1XxY0BS/blobs/gSvbFh6HU6TjHK3rC307/tray-view-open-defguard-marked.png" alt="" width="50%"><figcaption></figcaption></figure>

2. Go to your Instance, click **Instance settings**

<figure><img src="https://content.gitbook.com/content/pE5yODhpiy5pT1XxY0BS/blobs/vTVYbnBnIkEhX7mrgjBp/client-instance-settings-marked.png" alt=""><figcaption></figcaption></figure>

3. Click **Delete**

<figure><img src="https://1370451937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpE5yODhpiy5pT1XxY0BS%2Fuploads%2Fgit-blob-3e5aad2b6cf7ba3803181e563da4db248d976e15%2Fdelete-instance-marked.png?alt=media" alt=""><figcaption></figcaption></figure>

4. Confirm with **Delete instance** button

<figure><img src="https://1370451937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpE5yODhpiy5pT1XxY0BS%2Fuploads%2Fgit-blob-548708bbb57f137f0bcda3c4076f63b0f31a882e%2Fdelete-instance-confirmation.png?alt=media" alt=""><figcaption></figcaption></figure>

Your Instance will be removed immediately.
