---
title: "Docker Compose | WebhookRelay"
meta:
  "og:description": "How to use Webhook Relay client with Docker Compose to start forwarding webhooks to your internal services and open tunnels to expose your services"
  "og:title": "Docker Compose"
  description: "How to use Webhook Relay client with Docker Compose to start forwarding webhooks to your internal services and open tunnels to expose your services"
---

![Stripes](https://webhookrelay.com/docs/installation/docker-compose/images/stripes.svg)

Documentation

**Fundamentals**

# **Docker Compose**

How to use Webhook Relay client with Docker Compose to start forwarding webhooks to your internal services and open tunnels to expose your services

Docker Compose is an excellent option to run multiple containers together. You can have a perfect development environment that receives webhooks directly from Stripe, Github and other services.

## [Prerequisites](#prerequisites)

- Docker, installation instructions: [https://docs.docker.com/engine/install/](https://docs.docker.com/engine/install/)
- Webhook Relay account, get your token here: [https://my.webhookrelay.com/tokens](https://my.webhookrelay.com/tokens)

## [Forward webhooks](#forward-webhooks)

1. Go to [https://my.webhookrelay.com/buckets](https://my.webhookrelay.com/buckets) and create a bucket (we will call it "**my-bucket**" in this example)
2. Configure output destination (another container or IP address where you want to forward)
3. Create a _docker-compose.yml_ file:

```
version: '3.2'
services:
  relay:
    container_name: webhookrelay
    image: webhookrelay/webhookrelayd:latest
    network_mode: host # required if you want to access other services running on localhost (otherwise localhost would be inside this container)
    restart: always
    environment:
      # Authentication
      - RELAY_KEY=${RELAY_KEY}
      - RELAY_SECRET=${RELAY_SECRET}
      # buckets list to subscribe
      - BUCKETS=${BUCKETS}
```

1. Create _.env_ file:

```
RELAY_KEY="your-access-token-key"
RELAY_SECRET="your-access-token-secret"
BUCKETS=my-bucket
```

1. Start Docker Compose:

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

## [Open a tunnel](#open-a-tunnel)

1. Go to [https://my.webhookrelay.com/tunnels](https://my.webhookrelay.com/tunnels) and create a tunnel with your desired destination
2. Create a _docker-compose.yml_ file:

```
version: '3.2'

services:
  relay:
    container_name: webhookrelay
    image: webhookrelay/webhookrelayd:latest
    network_mode: host      
    command:
      - --mode 
      - tunnel
    restart: always
    environment:
      # Authentication
      - RELAY_KEY=${RELAY_KEY}
      - RELAY_SECRET=${RELAY_SECRET}
      # One or more tunnels must be set in the .env file
      - TUNNELS=${TUNNELS}
```

1. Create _.env_ file:

```
RELAY_KEY="your-access-token-key"
RELAY_SECRET="your-access-token-secret"
TUNNELS=your-tunnel
```

1. Start Docker Compose:

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

Did this page help you?