* [Resolving port conflicts preventing fixed users mode authentication and login](#port-conflict)
* [Configuring trains-server for sub-domains and load balancers](#sub-domains)
### Deploying trains-server on Kubernetes clusters <a name="kubernetes"></a>
**trains-server** supports Kubernetes. See [trains-server-k8s](https://github.com/allegroai/trains-server-k8s)
which contains the YAML files describing the required services and detailed instructions for deploying
**trains-server** to a Kubernetes clusters.
### Creating a Helm Chart for trains-server Kubernetes deployment <a name="helm"></a>
**trains-server** supports creating a Helm chart for Kubernetes deployment. See [trains-server-helm](https://github.com/allegroai/trains-server-helm)
which you can use to create a Helm chart for **trains-server** and contains detailed instructions for deploying
**trains-server** to a Kubernetes clusters using Helm.
### Running trains-server on Mac OS X <a name="mac-osx"></a>
To install and configure **trains-server** on Mac OS X, follow the steps below.
After installing, each time your computer reboots, you must run the `docker-compose` command (see Step 5), because the dockers will not automatically reload.
Your server is now running on [http://localhost:8080](http://localhost:8080)
### Installing trains-server on stand alone Linux Ubuntu systems <a name="ubuntu"></a>
To install **trains-server** on a stand alone Linux Ubuntu, follow the steps belows.
After installing, each time your computer reboots, you must run the `docker-compose` command (see Step 6), because the dockers will not automatically reload.
1. Install [docker for Linux Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/).
1. Install `docker-compose` using the following commands (for more detailed information, see the [Install Docker Compose](https://docs.docker.com/compose/install/) in the Docker documentation):
In a future version of **trains-server**, to start the API server, environment variables will be available to use instead of modifying the configuration file (instead of Step 1 above).
The environment variables will be available to set different ports for both MongoDB and Elastic instances:
### Configuring trains-server for sub-domains and load balancers <a name="sub-domains"></a>
You can configure **trains-server** for sub-domains and a load balancer.
For example, if your domain is `trains.mydomain.com` and your sub-domains are `app` and `api`, then do the following:
1. If you are not using the current **trains-server** version, [upgrade](https://github.com/allegroai/trains-server#upgrade) **trains-server**.
1. Add the following to `/opt/trains/config/apiserver.conf`:
auth {
cookies {
httponly: true
secure: true
domain: ".trains.mydomain.com"
max_age: 99999999999
}
}
1. Use the following load balancer configuration:
* Listeners:
* Optional: HTTP listener, that redirects all traffic to HTTPS.
* HTTPS listener for `app.` forwarded to `AppTargetGroup`
* HTTPS listener for `api.` forwarded to `ApiTargetGroup`
* HTTPS listener for `files.` forwarded to `FilesTargetGroup`
* Target groups:
*`AppTargetGroup`: HTTP based target group, port `8080`
*`ApiTargetGroup`: HTTP based target group, port `8008`
*`FilesTargetGroup`: HTTP based target group, port `8081`
* Security and routing:
* Load balancer: make sure the load balancers are able to receive traffic from the relevant IP addresses (Security groups and Subnets definitions).
* Instances: make sure the load balancers are able to access the instances, using the relevant ports (Security groups definitions).
1. Run the Docker containers with our updated `docker run` commands (see [Launching Docker Containers](#https://github.com/allegroai/trains-server#launching-docker-containers)).