# Problem In Running Multiple Dreamfactory Instances

**URL:** <https://community.dreamfactory.com/t/problem-in-running-multiple-dreamfactory-instances/5219>\
**Category:** GitHub Installers\
**Created:** [September 11, 2020, 8:59pm UTC](https://community.dreamfactory.com/t/problem-in-running-multiple-dreamfactory-instances/5219 "2020-09-11T20:59:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arpiticx](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@arpiticx](https://community.dreamfactory.com/u/arpiticx)\
**Post date:** [September 11, 2020, 8:59pm UTC](https://community.dreamfactory.com/t/problem-in-running-multiple-dreamfactory-instances/5219/1 "2020-09-11T20:59:01Z")

</div>

Hi,

I managed to install a DF instance with MySQL as a backend. The instance is running fine, i am able to create new apps and services.

However, when I tried to install the second DF instance (for HA) with same MySQL as backend, after executing **php artisan df:setup** i got a message as **Your instance is already setup.**

I had gone through the whitepaper [scaling-the-dreamfactory-services-platform](https://blog.dreamfactory.com/scaling-the-dreamfactory-services-platform/) for Horizontal scaling. I understood that DF is just a application running on a web server, which can talk to a common backend database. That’s it

I didn’t found any other resources guiding on how to run multiple instances of DF behind a load balancer.

Any help is appreciated.

Thanks

Please

---

<div class="post-metadata">

**Author:** ![jason.gilmore](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@jason.gilmore](https://community.dreamfactory.com/u/jason.gilmore)\
**Post date:** [November 3, 2020, 4:24pm UTC](https://community.dreamfactory.com/t/problem-in-running-multiple-dreamfactory-instances/5219/2 "2020-11-03T16:24:57Z")

</div>

Hi @arpiticx,

You are correct, DreamFactory can be load balanced across many instances, all of which share the same system database or database cluster. Getting Started with DreamFactory [Chapter 9](https://guide.dreamfactory.com/docs/chapter09/load-balancing-your-dreamfactory-environment.html) presents a diagram depicting what this looks like.

The [DreamFactory installers](https://github.com/dreamfactorysoftware/dreamfactory/tree/master/installers) are useful for quickly installing and configuring a new DreamFactory instance. However they do not take into account a load balanced configuration. You could nonetheless use the installer for this purpose and just skip the `php artisan df:setup` step. Instead, you’ll copy your first DreamFactory instance’s `.env` file over to the newly installed instance. This is important because the `.env` file contains the `APP_KEY` value, database configuration settings, and any other settings which you might have configured.

After installing the DreamFactory instances, you’ll want to place them behind a load balancer. For instance, on AWS you might use an [ALB](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html) (Application load balancer).

These days many DreamFactory users are gravitating towards Dockerized instances using [DreamFactory’s Docker container](https://github.com/dreamfactorysoftware/df-docker) (also see Dockerhub), as well as scaling using Kubernetes. Regarding Kubernetes, we’ve recently released a [Helm Chart](https://github.com/dreamfactorysoftware/df-helm).

Hope this helps!  
Jason
