# Installation

## Requirements

We want it to be as easy as possible to get started with Cryptitan so we have built an easy to use installer that automatically helps you setup your server and other dependencies such as database, redis, BitGo server, ethereum node, cron jobs, supervisor, nginx, php, websocket service... just to name a few.

To get started you need a VPS Server with nothing installed (i.e. no pre-installed web service) to avoid conflicts with Cryptitan's installer. You can purchase one of these VPS servers using services like [AWS EC2](https://aws.amazon.com/) or [Digital Ocean Droplets](https://www.digitalocean.com/products/droplets/)

You will also need to install SSH client like [Putty](https://www.putty.org/) and [WinSCP](https://winscp.net/eng/download.php) to connect and upload files to your server. If you are new to connecting and uploading to VPS servers using SSH client, refer to [SSH Access](https://docs.cryptitan.live/resources/ssh-access) section.

#### SERVER SPECIFICATION

* **OS**: Linux (Ubuntu 18.04 or later)
* **Architecture**: 64bit (x86)
* AVX support on CPU
* **Memory**: 8gb+
* **Storage**: 60gb+

## Prepare Server

Create a new user account on the server, it is under this account, Cryptitan needs to be installed. **Do NOT install Cryptitan as root user!** You can create a user account using the following command (where 'neoscrypts' is the username):

```shell
sudo useradd -m neoscrypts
```

{% hint style="info" %}
For the rest of the installation guide, we will use **neoscrypts** as reference for the newly created user account.
{% endhint %}

Our installer leverages the power of [Docker](https://www.docker.com/) container services, so you need to install Docker on the server. (see: [docker installation section](https://docs.cryptitan.live/resources/docker))

{% hint style="info" %}
For a complete tutorial on how to connect securely to the newly created user account on your VPS Server via SSH, see: [SSH Access](https://docs.cryptitan.live/resources/ssh-access) section.
{% endhint %}

Remember to add the username to the Docker group. (refer to [docker installation](https://docs.cryptitan.live/resources/docker#install-docker-engine)).&#x20;

## Upload Files

{% hint style="danger" %}
Don't install Cryptitan as **root** user!
{% endhint %}

* Using your preferred remote file manager (e.g. [WinSCP](https://winscp.net/eng/download.php)), login as the **created user account.**
* Navigate to the home directory: i.e. `/home/neoscrypts`
* Upload the zip file obtained from the marketplace to the home directory.&#x20;

{% hint style="info" %}
If you don't know how to upload files to your VPS server, refer to the [SSH Access](https://docs.cryptitan.live/resources/ssh-access) section.
{% endhint %}

* Next, using SSH Terminal, login as the **created user account**, and navigate to the home directory. i.e. `/home/neoscrypts/`

```shell
cd ~
```

* Unzip the uploaded source file

```shell
unzip cryptitan-source-file.zip
```

{% hint style="info" %}
**cryptitan-source-file.zip** here is the name of the zip file as downloaded from the marketplace. Example of the zip file, downloaded from CodeCanyon looks like: **codecanyon-71g9eMsC-cryptitan-multi...**
{% endhint %}

* Now you should have a folder named: `cryptitan-1.0.0`.&#x20;
* For convenience sake, rename this folder to just `cryptitan`

```shell
rsync -a cryptitan-1.0.0/ cryptitan/
```

{% hint style="warning" %}
The ending slash "/" of the source and destination directory is required.

The **`1.0.0`** in the folder name represents the version you are installing.
{% endhint %}

* Verify the folder `/home/neoscrypts/cryptitan` which should contain all Cryptitan source files.

{% hint style="danger" %}
**Don't rename your project folder,** after the first build. If you do so, Cryptitan will rebuild on a new instance, similar to a fresh install.
{% endhint %}

## Setup Environment

* While logged in as the **created user account (SSH Terminal),** Navigate to the project's folder: i.e. `/home/neoscrypts/cryptitan`

```shell
cd ~/cryptitan
```

* Create your `.env` file using the command:

```shell
./cryptitan initialize
```

* Within your project's folder you will find your `.env` file.  Edit the file and set your information as required. Please refer to [Environment](https://docs.cryptitan.live/getting-started/environment) section for guide.

{% content-ref url="environment" %}
[environment](https://docs.cryptitan.live/getting-started/environment)
{% endcontent-ref %}

* After environment setup, build and start Cryptitan

```
./cryptitan up -d
```

{% hint style="info" %}
If you have properly configured your environment file as described, the server should successfully build and start. It takes about **20 minutes** to complete.&#x20;
{% endhint %}

{% hint style="warning" %}
If the compilation stops with an "unhealthy" message, it means that the environment variables were not properly configured. You will need to stop cryptitan using the command:

`./cryptitan stop`
{% endhint %}

{% hint style="warning" %}
You have to check the logs to see the compilation error: &#x20;

`./cryptitan logs -f application`

Copy the output of the logs and save in a text file. You should send the text file to us through our support channel. `We`will be able to tell you which one of your environment value was misconfigured.
{% endhint %}

## Bind to Network

This will make cryptitan available to the outside world through your domain.

* While logged in as the **created user account** (SSH Terminal)**.**  Navigate to the user's home directory: i.e. `/home/neoscrypts/`

```shell
cd ~
```

* Download the Network tool using the command:

```shell
git clone https://github.com/neoscrypts/docker-nginx
```

* Navigate into the created `docker-nginx` directory:

```shell
cd docker-nginx
```

* Then start up the service:

```shell
./nginx up -d
```

{% hint style="info" %}
Your domain, as specified in the environment file, as well as the **[www](http://www).** version, must be pointed to your server's IP address. i.e both **example.com** and **[www.example.com](http://www.example.com)** must be pointed to your server's IP address.
{% endhint %}

## You are set!

Cryptitan should now be accessible through your configured domain. (Make sure your domain is already pointed to your server's IP address).
