# Installation

## Server

### Docker

The server is shipped as a Docker image. To install the Flopsar server, you only need to execute the command or use `docker-compose.yml` file:

{% tabs %}
{% tab title="Command" %}

```bash
$ docker run -d      \
-p 9000:9000         \
-p 9443:9443         \
-e ACCEPT_EULA=y     \
flopsar/server:4.0.0 flopsar start
```

{% endtab %}

{% tab title="docker-compose.yml" %}

```yaml
version: '3'

services:
    flopsar-server:
      image: flopsar/server:4.0.0
      command: flopsar start
      ports:
        - "9000:9000"
        - "9443:9443"
      environment:
        - ACCEPT_EULA=y  
```

{% endtab %}
{% endtabs %}

This will create a new container and start the server. By default, the server listens on two ports: 9000 and 9443. The first port is used by agents and the second one by workstations.&#x20;

It is recommended to attach a volume for the server data. You can do this by executing the command:

{% tabs %}
{% tab title="Command" %}

```bash
$ docker run -d                              \
-p 9000:9000                                 \
-p 9443:9443                                 \
-v <REPLACE_WITH_YOUR_PATH>:/opt/flopsar     \
-e ACCEPT_EULA=y                             \
flopsar/server:4.0.0 flopsar start
```

{% endtab %}

{% tab title="docker-compose.yml" %}

```yaml
version: '3'

services:
    flopsar-server:
      image: flopsar/server:4.0.0
      command: flopsar start
      ports:
        - "9000:9000"
        - "9443:9443"
      environment:
        - ACCEPT_EULA=y
      volumes:
        - <REPLACE_WITH_YOUR_PATH>:/opt/flopsar  
```

{% endtab %}
{% endtabs %}

By default, the server uses `/opt/flopsar` for its data directory. This can be changed by setting the `FLOPSAR_HOME` environment variable, e.g.:

{% tabs %}
{% tab title="Command" %}

```
$ docker run -d                             \
-p 9000:9000                                \
-p 9443:9443                                \
-v <REPLACE_WITH_YOUR_PATH>:/flopsar        \
-e FLOPSAR_HOME=/flopsar                    \
-e ACCEPT_EULA=y                            \
flopsar/server:4.0.0 flopsar start
```

{% endtab %}

{% tab title="docker-compose.yml" %}

```yaml
version: '3'

services:
    flopsar-server:
      image: flopsar/server:4.0.0
      command: flopsar start
      ports:
        - "9000:9000"
        - "9443:9443"
      environment:
        - ACCEPT_EULA=y
        - FLOSPAR_HOME=/flopsar
      volumes:
        - <REPLACE_WITH_YOUR_PATH>:/flopsar 
```

{% endtab %}
{% endtabs %}

### Standalone

The server component can also be installed manually, if Docker is not an option. In this case, first you must install the [Swift runtime](https://swift.org/download/). Obviously, you can install the server only on those platforms, that are supported by the Swift runtime.

To install the server manually, follow the instructions below:

* download the Swift runtime
* install all the [dependencies required](https://swift.org/getting-started/) by the runtime
* unpack the Swift binaries into the system root directory:

  `$ sudo tar xzvf <SWIFT.TAR.GZ> -C / --strip=1`
* copy the `flopsar` binary to your machine

## Agent

To install the agent, follow carefully the instructions below:

1. copy the agent file `flopsar-agent-X.Y.Z.jar`to your server machine.
2. create a directory (we call this directory a Flopsar home directory) and `ext` subdirectory for the agent data.
3. [configure](https://docs.flopsar.com/4.0/agent#configuration) the agent.
4. optionally put all your agent plugins into the `ext` directory.
5. restart your application.

When the agent starts for the first time it does not have any profile assigned. It just registers itself to the server after a successful connection, sends its status data, and does not instrument anything nor send any data.&#x20;

{% hint style="info" %}
The agent must have a [license assigned](https://docs.flopsar.com/4.0/managing-licenses) to send its basic data and a [profile](https://docs.flopsar.com/4.0/profiles) to send the instrumented data.
{% endhint %}

## Workstation

If you are on a Windows platform, just download a Windows installation file and install the workstation. For other platforms, download the zip file with the workstation application. Since the application is distributed without Java runtime,  you will need to install both [JRE 11 and JFX](https://www.azul.com/downloads/zulu-community/?version=java-11-lts\&package=jre-fx) before you start the workstation.&#x20;

## Quick Start

To quickly set up and start your environment follow the instructions below:

1. Download, [install](#server) and start the server
2. Download, install the agent, and start your application
3. Download, install and start the workstation
4. Log in to the workstation in [Admin Mode](https://docs.flopsar.com/4.0/server#admin-mode) and [register a license](https://docs.flopsar.com/4.0/administrator-guide/workstation)
5. Log out and log in to the workstation again in normal mode
6. [Assign the license](https://docs.flopsar.com/4.0/managing-licenses) to your applications
7. [Create a profile](https://docs.flopsar.com/4.0/profiles#adding-profiles), add some rules, and [assign one of your applications](https://docs.flopsar.com/4.0/profiles#assigning-applications) to the profile
8. Finally, [activate the profile](https://docs.flopsar.com/4.0/profiles#profile-activation).
