This repository contains the necessary configurations for running a WireGuard container using Docker Compose.
- Docker and Docker Compose installed on your system.
- Knowledge about WireGuard and its configuration.
The docker-compose.yml
file defines the WireGuard service along with its necessary settings, such as ports, volumes, and environment variables. Before you run the service, make sure you have set the appropriate environment variables.
- CONTAINERNAME: Container name.
- PUID & PGID: User and group IDs.
- TZ: Timezone.
- SERVERURL: The server's URL.
- SERVERPORT: Server port.
- PEERS: Define the peers.
- PEERDNS: DNS for peers.
- ALLOWEDIPS: Allowed IP addresses.
- LOG_CONFS: Logging configurations.
Make sure you set these variables before you run the service. You can either export them in your shell or use an .env
file.
A Makefile
has been provided for easier management of the Docker Compose commands:
make up
make down
make restart
make recreate
The WireGuard service runs on its own Docker network named wireguard
.
- The WireGuard container uses the image from
linuxserver/wireguard
and listens on port51820
by default. - Ensure that the
NET_ADMIN
andSYS_MODULE
capabilities are provided to the container, as they are necessary for WireGuard to function correctly.
This setup allows you to easily manage and run a WireGuard container using Docker Compose. Make sure to refer to the official WireGuard documentation for more in-depth information and configurations.
Happy tunneling!