# Integration with MAX messenger
To connect the MAX messenger as a channel, you need to obtain tokens for the bot on the developer platform.

[Instructions for registering on the MAX platform](https://dev.max.ru/docs)

### Setting up Swarmica

You will need to have at least [v5.8.0](https://support.swarmica.com/article/en/1361.html)  to connect MAX bot to your Swarmica instance.

After creating a bot on the MAX platform, create a channel in **Settings** > **General Settings** > **Channels** > **MAX** and specify the received token:

![](https://support.swarmica.com/attachments/l/q/lqCqyGP8X9vA1qXP_a/swarmica-max-integration-en.png)

After enabling the bot, restart the MAX container (or contact Swarmica support if you have the SaaS version):

```bash
sudo su -
cd /root/swarmica
docker compose up -d --scale max=0
docker compose up -d --scale max=1
```

### Connecting MAX on existing installations

1.  Make sure that `max` is specified in the `FEATURES` variable in the `/root/swarmica/.env` file:
    ```bash
    FEATURES=max,telegram,vk,whatsapp_green,automations,...
    ```
2.  Make sure that the `max` service is in the `/root/swarmica/docker-compose.yml` file:
    ```bash
      max:
       <<: *django
       ports: []
       command: /start-max
       labels:
          - "traefik.enable=false"
    ```
3.  Restart the application with MAX images:
    ```bash
    sudo su -
    cd /root/swarmica
    docker compose pull
    docker compose down
    docker compose up -d
    ```