# Docker compose

{% hint style="info" %}
If you plan to upgrade your Akamas instance, please verify the upgrade path with the Akamas support team. To ensure rollback in case of upgrade failure, it is suggested to backup your studies (see section [User data backup](https://docs.akamas.io/akamas-docs/3.6/backup-and-recover-of-the-akamas-server#user-data-backup)).
{% endhint %}

### Docker compose Configuration <a href="#patchesandupgrades-docker-composeconfiguration" id="patchesandupgrades-docker-composeconfiguration"></a>

To start with the upgrade, on the Akamas server navigate to the same folder where the `docker-compose.yml` and `.env` file are stored (see section [Get Akamas Docker artifacts](https://docs.akamas.io/akamas-docs/3.6/installing/docker/install-the-akamas-server/online-installation-mode#get-akamas-docker-artifacts)). Now you can download the latest version compose file:

```bash
mv docker-compose.yml docker-compose.yml.bak
curl -O https://s3.us-east-2.amazonaws.com/akamas/compose/3.6.3/docker-compose.yml
```

You can point to a specific version. As an example to download the artifact for version `3.5.0`:

```bash
curl -O https://s3.us-east-2.amazonaws.com/akamas/compose/3.5.0/docker-compose.yml
```

If the old `docker-compose` has been changed and it is still needed in the newer Akamas version, make sure to migrate such changes from `docker-compose.yml.bak` to the `docker-compose.yml` .

Ensure your `.env` file is up to date with the required variables, by comparing your version with the one at [Configure Akamas environment variables](https://docs.akamas.io/akamas-docs/3.6/installing/docker/install-the-akamas-server/online-installation-mode#configure-akamas-environment-variables).

Then log in to AWS with the following command:

```bash
aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin 485790562880.dkr.ecr.us-east-2.amazonaws.com
```

If the login succeeds, then you can start the upgrade by running:

```bash
docker compose up -d
```

Wait for a few minutes and check the Akamas services are running the command:

```bash
akamas status -d
```

The expected output should be like the following (repeat the command after a minute or two if the last line is not "OK" as expected):

```
Checking Akamas services on http://localhost:8000
service       status
=========================
analyzer      UP
campaign      UP
metrics       UP
optimizer     UP
orchestrator  UP
system        UP
telemetry     UP
license       UP
log           UP
users         UP
OK
```
