Skip to content

Commit 03ea4f2

Browse files
defguard-communitygitbook-bot
authored andcommitted
GITBOOK-141: Simplified Docker Compose for the Gateway service
1 parent a10d8a3 commit 03ea4f2

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

deployment-strategies/docker-compose.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -225,28 +225,30 @@ server {
225225

226226
## Deploying Gateway service
227227

228-
You'll need a token to deploy the Gateway service. You'll have to set it as DEFGUARD\_TOKEN environment variable. Details on how to obtain the token [here](gateway.md).
228+
Before deploying a new Gateway service, make sure you have a running Defguard Core instance.
229229

230-
For gateway to control the WireGuard kernel as well as network, it's recommended to run in the _host_ network mode as well as there are needed some docker CAPs:
230+
On the network level, your Gateway must be able to reach the Core service’s gRPC endpoint. This address is passed as the `DEFGUARD_GRPC_URL` parameter when deploying the Gateway. The Gateway uses it to communicate with Core, fetch its configuration, and publish operational statistics.
231+
232+
You’ll also need a Location created in the Defguard Core Admin Panel.
233+
234+
Each Location is identified by a unique token, which must be provided to the Gateway as the `DEFGUARD_TOKEN` parameter. The Gateway uses this token to authenticate with Core over the gRPC channel and retrieve the correct configuration for that specific Location. For detailed steps on how to create a Location and obtain its token, see [this section](gateway.md).
235+
236+
For the most basic configuration use the following Docker Compose file:
231237

232238
```
233239
services:
234240
gateway:
235-
image: ghcr.io/defguard/gateway:latest
236-
restart: unless-stopped
237-
network_mode: "host"
238-
environment:
241+
image: ghcr.io/defguard/gateway:latest
242+
restart: unless-stopped
243+
network_mode: "host"
244+
environment:
239245
- DEFGUARD_GRPC_URL=https://core-ip:50055
240-
- DEFGUARD_GRPC_CA=/ca.pem
241-
- DEFGUARD_STATS_PERIOD=30
242-
# to get the token add a VPN location and get the token
243246
- DEFGUARD_TOKEN=tokenFromCoreLocation
244-
- DEFGUARD_GATEWAY_NAME=willBeVisibleInDefguardAsGWName
245-
volumes:
246-
# more info about custom CA here:
247-
# https://docs.defguard.net/deployment-strategies/grpc-ssl-communication#custom-ssl-ca-and-certificates
248-
- ./ca.pem:/ca.pem
249-
cap_add:
250-
- NET_ADMIN
247+
cap_add:
248+
- NET_ADMIN
251249
```
252250

251+
{% hint style="info" %}
252+
The Docker Compose configuration runs the Gateway in host network mode and includes the required Docker capabilities. This setup is necessary because the Gateway needs direct access to the host network stack and WireGuard kernel module to create and manage VPN interfaces properly.
253+
{% endhint %}
254+

0 commit comments

Comments
 (0)