[id='creating-caches-cli_{context}']
= Creating remote caches with the {brandname} CLI
Use the {brandname} Command Line Interface (CLI) to add remote caches on {brandname} Server.

.Prerequisites

* Create a {brandname} user with `admin` permissions.
* Start at least one {brandname} Server instance.
* Have a {brandname} cache configuration.

.Procedure

. Start the CLI.
+
[source,options="nowrap",subs=attributes+]
----
include::cmd_examples/cli_nix.adoc[]
----
. Run the `connect` command and enter your username and password when prompted.
+
. Use the [command]`create cache` command to create remote caches.
+
For example, create a distributed cache named "distcache" as follows:
+
[source,options="nowrap",subs=attributes+]
----
create cache distcache "<distributed-cache />"
----

You can use any configuration format supported by {brandname}. Create a cache using a JSON configuration as follows:
+
[source,options="nowrap",subs=attributes+]
----
create cache json '{"distributed-cache":{"mode":"SYNC"}}'
----

It is possible to use a configuration stored in an external file. For example, create a cache named "mycache" from a file named `mycache.xml` as follows:
+
[source,options="nowrap",subs=attributes+]
----
create cache --file=mycache.xml mycache
----

.Verification

. List all remote caches with the [command]`ls` command.
+
[source,options="nowrap",subs=attributes+]
----
ls caches
mycache
----
+
. View cache configuration with the [command]`describe` command.
+
[source,options="nowrap",subs=attributes+]
----
describe caches/mycache
----
