# Server Setup

{% hint style="warning" %}
Before you start with the exchange setup, make sure you have registered on [HollaEx Dashboard](https://docs.hollaex.com/get-started/creating-an-account-on-the-hollaex-dashboard) and have created an exchange project. If you don't have access to the Dash, please [submit this form](https://www.hollaex.com/start) and the HollaEx team will get in touch.

In addition, the HollaEx Kit folder and CLI must be installed on your machine. Please check the [Installation](https://docs.hollaex.com/get-started/on-premise-exchange-setup/installation) section if you haven't already done so.
{% endhint %}

## Exchange Server Initialization

{% hint style="info" %}
If you are looking for a way to deploy HollaEx on Kubernetes, Please check out the Kubernetes docs available [here](https://docs.hollaex.com/get-started/run-exchange-on-kubernetes).
{% endhint %}

Initialize the exchange setup by running the command below:

```
hollaex server --setup
```

The CLI will print some information and then ask for the HollaEx Network selection.&#x20;

<figure><img src="https://3965312054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP899VqAdyGFgLTy9SY%2Fuploads%2FwMlLNFOCO2TkTsCLceMK%2Fimage.png?alt=media&#x26;token=2acba92f-4a41-4a57-b198-8d52d2d0821c" alt=""><figcaption><p>If you are unsure which one to choose, it's very likely you want the Mainnet</p></figcaption></figure>

* The **Mainnet HollaEx Network** is very likely the choice you will want to make for an operating exchange and to benefit from the [shared liquidity of the HollaEx Network](https://www.youtube.com/watch?v=8JSbPsj5vH4\&ab_channel=HollaEx).&#x20;
* The **Testnet HollaEx Network** allows, unsurprisingly, a testing environment, ideal for developers who are developing plugins.&#x20;
* Lastly, if you have a private HollaEx Network, you need to select the **Custom HollaEx Network** option.

Select the choice relevant to you, and press the enter key to continue.

Once the network is selected, in the case you are connecting to the Mainnet HollaEx Network, the next step is to link your Dashboard account.&#x20;

<figure><img src="https://3965312054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP899VqAdyGFgLTy9SY%2Fuploads%2FIJV3zdZR7FhaMUgJtnNG%2Fimage.png?alt=media&#x26;token=c3e51d7b-85ec-4eae-8cee-220cd5cf2347" alt=""><figcaption><p>Time to bring out that Dashboard deets</p></figcaption></figure>

Input *Y* and enter the email and password used in your setup, as well as the OTP code if you have set this up already.&#x20;

If you don't have an account, input *N*, and the Dashboard should open up for you, follow the instructions [here](https://docs.hollaex.com/get-started/creating-an-account-on-the-hollaex-dashboard), come back to the terminal once complete, and then enter your details.

On successful login, a verification code will be sent to the email, copy and paste this over and hit enter.&#x20;

<figure><img src="https://3965312054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP899VqAdyGFgLTy9SY%2Fuploads%2FNRcURs0oNgUvjRtdWCv7%2Fimage.png?alt=media&#x26;token=cd95aeea-81a9-45ee-850a-f00da2e2af76" alt=""><figcaption><p>At this point the CLI will issue an API and secret for your exchange. and begin setup</p></figcaption></figure>

The HollaEx CLI will then begin to finalize the exchange initialization if all the values are valid.

{% hint style="warning" %}
If you get an *'Error: Exchange owner is not verified yet! '*&#x61;t this step, head back to the dashboard and be sure to complete the [verification steps ](https://docs.hollaex.com/creating-an-account-on-the-hollaex-dashboard#verification)to continue
{% endhint %}

The CLI then immediately proceeds to build a custom Docker image based on your HollaEx Kit configuration and code. A few questions will be asked during setup so keep an eye on the setup to answer these:

1. First, if you want to change the image name. Type in the new name or just hit enter to continue.
2. Confirmation on the name, again hit enter if you are happy.
3. Finally, if you want to push an image to the Docker Registry. This is optional.

<figure><img src="https://3965312054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP899VqAdyGFgLTy9SY%2Fuploads%2Fpswx1B9mMtFRqLJDwzA6%2Fimage.png?alt=media&#x26;token=7856a9b1-8211-4342-98bf-6dc7432b4f83" alt=""><figcaption><p>The three questions during setup</p></figcaption></figure>

Let it run from this point, and once this initial setup is complete, you will be greeted with a large power symbol, and you can continue.

<figure><img src="https://3965312054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP899VqAdyGFgLTy9SY%2Fuploads%2F9XNZ8Y9TB1tCUxIGU5iT%2Fimage.png?alt=media&#x26;token=901e9e4b-2caa-43a7-9658-84d0f4eacbf3" alt=""><figcaption><p>Another step completed!</p></figcaption></figure>

Now manually start the server. Run the command below to start the exchange - this will be far quicker than the previous step.

```
hollaex server --start
```

<figure><img src="https://3965312054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP899VqAdyGFgLTy9SY%2Fuploads%2FCPbA3hlzGIIqp1Q5f8f9%2Fimage.png?alt=media&#x26;token=97ea2b6e-3813-42a0-b026-95778ee25cc5" alt=""><figcaption><p>Starting the command...</p></figcaption></figure>

<figure><img src="https://3965312054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP899VqAdyGFgLTy9SY%2Fuploads%2FsWNLJ45S0zTQOdhhJRK1%2Fimage.png?alt=media&#x26;token=004ad18c-50fc-4d08-906f-4048183fc6f3" alt=""><figcaption><p>...and it finishing about a minute later!</p></figcaption></figure>

## Checking Your Progress

At this point, it may give some peace of mind to check the progress of the setup, the steps below are not required to finish setup but are a good way to check how the process has gone.&#x20;

Wait a minute or two after the previous command completes, and then run the command:&#x20;

```bash
hollaex status
```

Which should return the green text as in the image below. If it doesn't wait a few minutes, try again, as occasionally the setup takes a little time to finalize.

<figure><img src="https://3965312054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP899VqAdyGFgLTy9SY%2Fuploads%2FsJ3WV9ZX65e2oZEfS58p%2Fimage.png?alt=media&#x26;token=e35231ca-69c5-4313-ab0d-160751ed81e0" alt=""><figcaption><p>Green = Good</p></figcaption></figure>

At this point, you should also be able to reach the exchange through your web browser via the endpoints `/v2/health` and `/v2/constant:`

### <http://localhost/v2/health>

This API displays your exchange's name, HollaEx version number, host URL, and base URL.

<figure><img src="https://3965312054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP899VqAdyGFgLTy9SY%2Fuploads%2FsS6QktLx5SrKH9xvI8U2%2Fimage.png?alt=media&#x26;token=7e45938b-e4fe-460a-81ad-79dfadd17003" alt=""><figcaption><p>Chrome will look a little differnt to Firefox, but it's the same data</p></figcaption></figure>

### <http://localhost/v2/constants>

This API shows the list of currencies and trading pairs that you have on your exchange. You will be able to see all currencies and trading pairs you selected. If you don't see a list of your currencies or trading pairs, restart the exchange by running the command `hollaex server --restart`. If that doesn't solve the issue, you can always bring it up to the [forum](https://forum.bitholla.com).

<figure><img src="https://3965312054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP899VqAdyGFgLTy9SY%2Fuploads%2Fn7SlgqIaUN1r6s7QHhFc%2Fimage.png?alt=media&#x26;token=87795141-dc28-44da-a79b-9c8e7bca0aeb" alt=""><figcaption><p>This page will have a lot more info than the previous. about the assets and pairs</p></figcaption></figure>

{% hint style="info" %}
You can view the API documentation for HollaEx[ here](https://apidocs.hollaex.com/) and fork the [API Docs](https://github.com/bitholla/hollaex-apidoc) and make your own.
{% endhint %}

## Moving on up!

With everything in order let's move on to the [web setup](https://docs.hollaex.com/get-started/on-premise-exchange-setup/web-setup)!
