# DigitalOcean

{% hint style="warning" %}

### **Note: This guide is deprecated.**

### **Use the UXWizz 1-Click DigitalOcean App instead!**

UXWizz is now available as a 1-Click App on DigitalOcean and can be installed even easier.\
[**Click here to deploy UXWizz 1-Click App on DigitalOcean**](https://marketplace.digitalocean.com/apps/uxwizz?refcode=1ae65cd1b449\&action=deploy)**.**
{% endhint %}

Server setup summary:

1. [Create a new UXWizz **server**.](#1.-create-a-new-server-running-uxwizz)
2. [Point your own **domain** name at that server's IP.](#2.-point-your-own-domain-name-to-the-uxwizz-dashboard-server)
3. [Add free **HTTPS certificate** for that domain.](#3.-add-free-https-certificate-for-that-domain.)

### 1. Create a new server running UXWizz&#x20;

If you don't already have a DigitalOcean account, you can [create one here](https://m.do.co/c/32db05609806) (referral link, you get **$200 free credits** on sign-up).

**1) Create a new droplet.**\
&#x20;<img src="https://2006615411-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ltuu0c63_YY4iXfi5vJ%2F-M62KJCDor3uy-wPhC1Z%2F-M62M8bFoPpfe72LLcRr%2Fimage.png?alt=media&#x26;token=9257b05f-8ada-48ab-8b9c-615e03761574" alt="" data-size="original"> <br>

**2) Choose your preferred server location**\
Normally this should be close to you, or close to where the majority of the tracked users are. A central location such as Amsterdam could also be good.

<figure><img src="https://2006615411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ltuu0c63_YY4iXfi5vJ%2Fuploads%2Fi1wyLKwO0VtfNPx9qXtU%2Fimage.png?alt=media&#x26;token=dbf51269-c4c5-425e-ba84-5c518bddc5b4" alt=""><figcaption></figcaption></figure>

**3) Choose the LAMP image from the Marketplace**&#x20;

<figure><img src="https://2006615411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ltuu0c63_YY4iXfi5vJ%2Fuploads%2FZpgoGWSvzA95XRHqECHO%2Fimage.png?alt=media&#x26;token=b503fbc1-f955-4f8d-8885-9208900d8c2c" alt=""><figcaption><p>DigitalOcean Marketplace - LAMP image</p></figcaption></figure>

{% hint style="info" %}
If you are interested you can read more about the **DigitalOcean LAMP image** here: <https://marketplace.digitalocean.com/apps/lamp#getting-started>
{% endhint %}

**4) Choose the $6/mo plan** \
If you want you can choose a more powerful server, but the $6/mo should be enough for at least 20-30k monthly visitors. If you want even faster performance, you can go for the $7/mo premium CPUs with NVMe SSD.\
You can also change the plan any time after creating the server.

<figure><img src="https://2006615411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ltuu0c63_YY4iXfi5vJ%2Fuploads%2F6rcaeI1gaZZ6lGoU0wgo%2Fimage.png?alt=media&#x26;token=79f25757-faff-40a5-9a70-ea1e19b39674" alt=""><figcaption></figcaption></figure>

**5) Select the preferred authentication method to access the server and the server name. SSH is recommended, but if you are not familiar with SSH you can select one-time password.**&#x20;

<figure><img src="https://2006615411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ltuu0c63_YY4iXfi5vJ%2Fuploads%2FEOcYQOyJmML33ReCJUxY%2Fimage.png?alt=media&#x26;token=3020be28-d0bc-4d82-9113-d83b1581176a" alt=""><figcaption></figcaption></figure>

**6) Select the free "Monitoring and alerting" add-on**\
This will enable performance graphs in your DigitalOcean dashboard, so you can see the CPU/Memory/Disk/Network usage of the server.

<figure><img src="https://2006615411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ltuu0c63_YY4iXfi5vJ%2Fuploads%2Fy7VehaBTFF5S5q31aWDK%2Fimage.png?alt=media&#x26;token=7c651fed-3808-4668-9ad2-38267559e96a" alt=""><figcaption><p>DigitalOcean Enable Monitoring and Alerting</p></figcaption></figure>

**7) Click Advanced Options -> Add Initialization scripts (free)**\
This is where the magic happens and what automatically installs **UXWizz** on the server.

{% hint style="warning" %}
You can get the "user data" code by accessing this URL:\
\&#xNAN;**(replace YOUR\_LICENSE\_KEY with your own UXWizz license code)**\
[https://www.uxwizz.com/get-cloud-config?license=YOUR\_LICENSE\_KEY](https://www.usertrack.net/get-cloud-config?license=YOUR_LICENSE_KEY)

**NOTE**: If you are using the **trial** version, use this link instead:\
[https://www.uxwizz.com/get-cloud-config?license=TRIAL](https://usertrack.net/get-cloud-config?license=TRIAL)
{% endhint %}

Add the copied code to the text input, it should look something like this:

<figure><img src="https://2006615411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ltuu0c63_YY4iXfi5vJ%2Fuploads%2F1tRkUmOoctt3XK943mVE%2Fimage.png?alt=media&#x26;token=dff7b260-127b-427c-b20b-dd2ed6a51e2b" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You can optionally enable **backups.** You can also do this later, after the server is created.
{% endhint %}

{% hint style="success" %}
To recap, those options should be selected:

1. **Marketplace -> LAMP** on 18.04 (or newer) image.
2. **User data textarea must be filled** with the #cloud-config code as explained above.
   {% endhint %}

Everything is done, click **Create Droplet**. \
The server will now be created, it usually takes **4-5 minutes** before it can be accessed.

![](https://2006615411-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ltuu0c63_YY4iXfi5vJ%2F-M62Wx7MYesxLKoRQaw_%2F-M62Y6Bv05NZQqSajRYb%2Fimage.png?alt=media\&token=bb6b1317-399e-46ab-b209-b490cf669570)

While it's being setup we can add our own domain to point to that IP.

### 2. Point your own domain name to the UXWizz dashboard server

To do this, you have to go add some DNS records to your domain from your domain name registrar.\
Add two **A** records from your domain (or subdomain name) to the **IP of your server**.

1. **A analytics.example.com 123.123.456.9**
2. **A [www.analytics.example.com](http://www.analytics.example.com) 123.456.78.9**

### **3. Add free HTTPS certificate for that domain.**

The easiest way to access the server is through the web console. Here you can use the password that was set when creating the droplet.&#x20;

![](https://2006615411-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ltuu0c63_YY4iXfi5vJ%2F-M62ay9BuWKen17VfNO3%2F-M62bcN-K2giTstua-5q%2Fimage.png?alt=media\&token=269414b2-b9c2-44b4-a367-fa82d5475b9f)

{% hint style="info" %}
Note that **when you type passwords in a console, nothing is displayed** but the password is actually typed. When you paste the password from your email you won't see anything, so just paste with it CTRL+V and submit with ENTER.
{% endhint %}

{% hint style="success" %}
You should now be able to **access UXWizz using the new domain name.** It can also be accessed from the server IP.
{% endhint %}

Now, back to the **HTTPS certificate**.\
While you are in the console, run this command to generate a free **HTTPS certificate** using **certbot:**\
**(replace example.com and [www.example.com](http://www.example.com) with the own domains, the same as in step 2)**

```
certbot --apache --agree-tos -d example.com -d www.example.com
```

There are 3-4 questions you have to respond to in the console after running that command in order for the certificate to be issued.

{% hint style="success" %}
**Done!**\
\
**You now have a UXWizz instance, running on your own server, on your own domain with a HTTPS certificate.**
{% endhint %}

You might be able to also use this as a guide to add UXWizz on a server from different hosting provider, but the **user data** (cloud-init) script might not work, as it has some DigitalOcean specific paths.

If you had any issues following this guide, or want to suggest making a similar guide for a different provider (assuming they support premade LAMP images and cloud-init), you can send me an e-mail at support \[at] uxwizz.com.
