# LICENSE.SET

> Install a license and save it to the license file.

URL: https://docs.hotkv.com/commands/license-set/

```
LICENSE.SET license-data
```

- Group: License
- Complexity: O(N) where N is the size of the license
- HotKV Cloud: all plans
- On-Premise: no license needed

`LICENSE.SET` installs a license sent as an argument, so you do not need
file access to the server. Pass the whole content of the license file your
HotKV account team sent you as one argument. If the license is usable on
this server, it takes effect at once and is saved
to the license file (`license-path`). That path is then used
by [LICENSE.RELOAD](https://docs.hotkv.com/commands/license-reload/index.md).

A license that is not usable here is refused, and the license already in
force stays in force. The command cannot be called from a script.

## Return value

Simple string `OK` in RESP2 and RESP3, or one of these errors:

| Case | Error |
| --- | --- |
| Empty argument | `ERR empty license data` |
| Larger than 1 MB | `ERR license data larger than 1048576 bytes` |
| Not usable on this server | `ERR license not installed: <reason>` |
| Usable, but the file could not be written | `ERR license valid but failed to save to <path>` |

## Examples

```
$ redis-cli LICENSE.SET "$(cat /etc/hotkv/hotkv.license)"
OK
$ redis-cli LICENSE.SET "not a license"
(error) ERR license not installed: ...
```

The second reply ends with the reason the license was refused.

## Compatibility

HotKV-only command.

## See also

[LICENSE.INFO](https://docs.hotkv.com/commands/license-info/index.md), [LICENSE.RELOAD](https://docs.hotkv.com/commands/license-reload/index.md),
[On-Premise quick start](https://docs.hotkv.com/quickstart-onpremise/index.md)