Run Multiple Kameleo Instances on One Machine

  • Created

Running multiple Kameleo instances on the same machine can be useful when you need to:

  • Combine multiple Start Plan licenses.
  • Separate automation workflows.
  • Use different configurations for different purposes.

Steps to Configure Multiple Instances

1. Copy Kameleo Application Folder

  • Make a copy of your existing Kameleo Application folder for each instance you want to run

2. Modify Port Settings

  • Open appsettings.json in the copied folder
  • Change the Local API port (default is 5050) to a different value (e.g., 5051)
  • Repeat for each additional instance with unique ports

3. Start Separate Instances

  • Launch Kameleo.CLI.exe from each folder
  • Log in with different email addresses (one license per instance)

Here's how to connect to different Kameleo instances:

  • // First instance using environment variable with default port 5050
    const kameleoPort1 = process.env.KAMELEO_PORT || '5050';
    const client1 = new KameleoLocalApiClient({
        baseUri: `http://localhost:${kameleoPort1}`,
        retryTotal: 0
    });
    
    // Second instance using environment variable with different port
    const kameleoPort2 = process.env.KAMELEO_PORT2 || '5051';
    const client2 = new KameleoLocalApiClient({
        baseUri: `http://localhost:${kameleoPort2}`,
        retryTotal: 0
    });
  • import os
    from kameleo.local_api_client import KameleoLocalApiClient
    
    # First instance using environment variable with default port 5050
    kameleo_port1 = os.getenv('KAMELEO_PORT', '5050')
    client1 = KameleoLocalApiClient(
        endpoint=f'http://localhost:{kameleo_port1}',
        retry_total=0
    )
    
    # Second instance using environment variable with different port
    kameleo_port2 = os.getenv('KAMELEO_PORT2', '5051')
    client2 = KameleoLocalApiClient(
        endpoint=f'http://localhost:{kameleo_port2}',
        retry_total=0
    )

Best Practices

  • Use environment variables to manage ports for different environments
  • Keep track of which instance is running on which port
  • Ensure each instance uses a separate license
  • Monitor resource usage when running multiple instances

Limitations

  • Each instance requires its own license
  • System resources are shared between instances
  • Make sure your machine has enough RAM and CPU capacity to handle multiple instances

This setup allows you to effectively combine multiple Start plan licenses while maintaining separate browser automation workflows on a single machine.

Was this article helpful?

0 out of 0 found this helpful