# Installing License

## Install or Update your License <a href="#install-your-license" id="install-your-license"></a>

You can update or install the license on your Polarity server by adding the license file to the correct location on the Polarity Server. The license file will be named `polarity.lic` and should be located in the directory `/app/license` on your Polarity server.

Start by copying your license file to license directory.

```
cp polarity.lic /app/license/polarity.lic
```

Finally restart the Polarity Server containers so the license is loaded

```
cd /app && ./down.sh && ./up.sh
```

{% hint style="info" %}
Please contact Polarity customer success at <customersuccess@polarity.io> for questions about your license file.
{% endhint %}

## Troubleshooting <a href="#solve-crlf-line-endings-on-the-polarity.lic-file" id="solve-crlf-line-endings-on-the-polarity.lic-file"></a>

### Solve CRLF Line endings on the polarity.lic file  <a href="#solve-crlf-line-endings-on-the-polarity.lic-file" id="solve-crlf-line-endings-on-the-polarity.lic-file"></a>

If the Polarity Server license file has Window line endings in it, the server will throw errors but will not crash. If you check the server status by running `docker ps`  you can tell if the poalrity\_web or polarity\_platform containers are running.&#x20;

To diagnose the issue, you can run the following grep on the server log file.

```
docker logs polarity_platform grep "scheduler.schedule"
```

If you get back the error message:

```
TypeError: scheduler.schedule is not a function
```

Then you likely have a license with window line endings. You can also confirm that there are window line endings by running the `file` command on the license file. The output will show CRLF line terminators.

```
file /app/license/polarity.lic
polarity.lic: ASCII text, with very long lines, with CRLF line terminators
```

To remove the line endings you can use the following command which will rewrite the existing license file.

```
vi polarity.lic -c "set ff=unix" -c ":wq"
```

If the user has access to `yum` you can also install `dos2unix`

```
yum install dos2unix
dos2unix /app/polarity-server/license/polarity.lic
```

Restart the server process after running the above commands.

```
cd /app && ./down.sh && ./up.sh
```
