# Linking containers for a multiple container setup

**URL:** https://meta.discourse.org/t/linking-containers-for-a-multiple-container-setup/20867
**Category:** Self-hosting
**Created:** [October 7, 2014, 6:04am UTC](https://meta.discourse.org/t/linking-containers-for-a-multiple-container-setup/20867 "2014-10-07T06:04:50Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![nx2zdk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nx2zdk/32/115006_2.png) [@nx2zdk](https://meta.discourse.org/u/nx2zdk)
#### Post date: [October 7, 2014, 6:04am UTC](https://meta.discourse.org/t/linking-containers-for-a-multiple-container-setup/20867/1 "2014-10-07T06:04:50Z")

</div>

**Multiple Container setup**

If you would like to connect web-only and data Discourse docker containers.  
There is optional setting for this, which is, you could specify a `links` key in container configuration (yaml file) to link those containers together ( i.e. linking web-only and data container ).  
This way is also known as Docker [`--link`](https://docs.docker.com/userguide/dockerlinks/) flag.

**Usage:**  
If you are trying to link database container to your `web` container

Add the following section in `containers/web.yml`

```
links:
  - link:
      name: data
      alias: db

```

That will be transformed into `--link data:db`

---

_[View the full topic](https://meta.discourse.org/t/linking-containers-for-a-multiple-container-setup/20867)._
