# Deploying Custom Connectors

Since a custom connector is based on a pre-built Docker image, you must pass the image tag to the build command. In the code example, the recent BASEIMAGE\_VERSION tag is 1.1.1.

1. To start and deploy your custom connector, write a `docker-compose.yml` file. The following code example starts the agent with a server:

{% code lineNumbers="true" %}

```yaml
docker-compose build --build-arg BASEIMAGE_VERSION=1.1.1
```

{% endcode %}

{% code lineNumbers="true" %}

```yaml
version: '2.4'
services:
    # Run the example server
    server:
        build: .
        network_mode: host # Using host network
        entrypoint: ''
        command: sh -c 'cd /app/src/protocols/custom/utils && node runServer.js'

    agent:
        build: .
        network_mode: host # Using host network
        volumes:
            - agentData:/data
        environment:
            CYBUS_MQTT_HOST: localhost # Asuming Cybus Connectware to be reachable on local system
            CYBUS_AGENT_MODE: distributed
            CYBUS_AGENT_NAME: CustomConnectorAgent
            CYBUS_LOG_LEVEL: info

volumes:
    agentData:
```

{% endcode %}

2. To start your custom connector, use the following code:

{% code lineNumbers="true" %}

```yaml
docker-compose up -d
```

{% endcode %}

3. To register the custom connector as an agent in Connectware, log into Connectware and select **User** > **Client Registry**.
4. Click **Unlock** to allow the agent to register with Connectware.

<figure><img src="https://602582052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq3p17lWu5YRliiaKj1Yr%2Fuploads%2Fgit-blob-6f0282056717787aee17f2ffcdd854fa4a1f560b%2Fcustom_connectors_client_registry_1.png?alt=media" alt=""><figcaption></figcaption></figure>

5. Once the client is registered, click it.

<figure><img src="https://602582052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq3p17lWu5YRliiaKj1Yr%2Fuploads%2Fgit-blob-e70264e3979f2787d1f59a1044abe261da0b205c%2Fcustom_connectors_client_registry_2.png?alt=media" alt=""><figcaption></figcaption></figure>

6. In the **Grant Access dialog**, click **Allow**. By default, the default permissions are assigned to the client.

<figure><img src="https://602582052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq3p17lWu5YRliiaKj1Yr%2Fuploads%2Fgit-blob-834f48ec73abe6468877ea1b104631b665a91dc4%2Fcustom_connectors_client_registry_grant_access.png?alt=media" alt=""><figcaption></figcaption></figure>

**Result:** You can now use your custom connector.
