--- title: "Multi container apps" keywords: get started, setup, orientation, quickstart, intro, concepts, containers, docker desktop description: Using more than one container in your application --- Up to this point, you've been working with single container apps. But, now you will add MySQL to the application stack. The following question often arises - "Where will MySQL run? Install it in the same container or run it separately?" In general, each container should do one thing and do it well. The following are a few reasons to run the container separately: - There's a good chance you'd have to scale APIs and front-ends differently than databases. - Separate containers let you version and update versions in isolation. - While you may use a container for the database locally, you may want to use a managed service for the database in production. You don't want to ship your database engine with your app then. - Running multiple processes will require a process manager (the container only starts one process), which adds complexity to container startup/shutdown. And there are more reasons. So, like the following diagram, it's best to run your app in multiple containers.  {: .text-center } ## Container networking Remember that containers, by default, run in isolation and don't know anything about other processes or containers on the same machine. So, how do you allow one container to talk to another? The answer is networking. If you place the two containers on the same network, they can talk to each other. ## Start MySQL There are two ways to put a container on a network: - Assign the network when starting the container. - Connect an already running container to a network. In the following steps, you'll create the network first and then attach the MySQL container at startup. 1. Create the network. ```console $ docker network create todo-app ``` 2. Start a MySQL container and attach it to the network. You're also going to define a few environment variables that the database will use to initialize the database. To learn more about the MySQL environment variables, see the "Environment Variables" section in the [MySQL Docker Hub listing](https://hub.docker.com/_/mysql/).