메뉴 건너뛰기

SayClub.org

도커(Docker)

참고사이트 : https://hub.docker.com/r/weejewel/wg-easy

                           https://github.com/WeeJeWel/wg-easy

 

GitHub - WeeJeWel/wg-easy: The easiest way to run WireGuard VPN + Web-based Admin UI.

The easiest way to run WireGuard VPN + Web-based Admin UI. - GitHub - WeeJeWel/wg-easy: The easiest way to run WireGuard VPN + Web-based Admin UI.

github.com

 

Docker Hub

 

hub.docker.com

 

아래 코드로 docker-compose.yml 파일 생성 후 'docker-compose up -d'로 실행하세요.

version: '3.9'
services:
    wg-easy:
        image: weejewel/wg-easy
        restart: always
        sysctls:
            - net.ipv4.ip_forward=1
            - net.ipv4.conf.all.src_valid_mark=1
        cap_add:
            - SYS_MODULE
            - NET_ADMIN
        ports:
            - '51821:51821/tcp'
            - '51820:51820/udp'
        volumes:
            - '~/wg-easy:/etc/wireguard'
        environment:
            - WG_HOST=🚨YOUR_SERVER_IP or DNS hostname
            - PASSWORD=🚨YOUR_ADMIN_PASSWORD
        container_name: wg-easy

Installation

1. Install Docker

If you haven't installed Docker yet, install it by running:

$ curl -sSL https://get.docker.com | sh
$ sudo usermod -aG docker $(whoami)
$ exit

And log in again.

2. Run WireGuard Easy

To automatically install & run wg-easy, simply run:

$ docker run -d \
  --name=wg-easy \
  -e WG_HOST=🚨YOUR_SERVER_IP or DNS hostname \
  -e PASSWORD=🚨YOUR_ADMIN_PASSWORD \
  -v ~/wg-easy:/etc/wireguard \
  -p 51820:51820/udp \
  -p 51821:51821/tcp \
  --cap-add=NET_ADMIN \
  --cap-add=SYS_MODULE \
  --sysctl="net.ipv4.conf.all.src_valid_mark=1" \
  --sysctl="net.ipv4.ip_forward=1" \
  --restart always \
  weejewel/wg-easy

💡 Replace YOUR_SERVER_IP with your WAN IP, or a Dynamic DNS hostname.

💡 Replace YOUR_ADMIN_PASSWORD with a password to log in on the Web UI.

The Web UI will now be available on http://0.0.0.0:51821.

💡 Your configuration files will be saved in ~/.wg-easy

Options

These options can be configured by setting environment variables using -e KEY="VALUE" in the docker run command.

EnvDefaultExampleDescription

PASSWORD - foobar123 When set, requires a password when logging in to the Web UI.
WG_HOST - vpn.myserver.com The public hostname of your VPN server.
WG_PORT 51820 12345 The public UDP port of your VPN server. WireGuard will always listen on 51820 inside the Docker container.
WG_MTU null 1420 The MTU the clients will use. Server uses default WG MTU.
WG_PERSISTENT_KEEPALIVE 0 25 Value in seconds to keep the "connection" open.
WG_DEFAULT_ADDRESS 10.8.0.x 10.6.0.x Clients IP address range.
WG_DEFAULT_DNS 1.1.1.1 8.8.8.8, 8.8.4.4 DNS server clients will use.
WG_ALLOWED_IPS 0.0.0.0/0, ::/0 192.168.15.0/24, 10.0.1.0/24 Allowed IPs clients will use.
WG_POST_UP ... iptables ... See config.js for the default value.
WG_POST_DOWN ... iptables ... See config.js for the default value.

If you change WG_PORT, make sure to also change the exposed port.

Updating

To update to the latest version, simply run:

docker stop wg-easy
docker rm wg-easy
docker pull weejewel/wg-easy

And then run the docker run -d \ ... command above again.

 

------------------------------------------------------------------------------------------------------------------------------------

아래코드로 실행하세요 - Update 2024.04.24

version: '3.9'
services:
    wg-easy:
        image: ghcr.io/wg-easy/wg-easy
        restart: always
        sysctls:
            - net.ipv4.ip_forward=1
            - net.ipv4.conf.all.src_valid_mark=1
        cap_add:
            - SYS_MODULE
            - NET_ADMIN
        ports:
            - '51821:51821/tcp'
            - '51820:51820/udp'
        volumes:
            - '~/wg-easy:/etc/wireguard'
        environment:
            - WG_PORT=51820
            - PORT=51821
            - PASSWORD=<🚨YOUR_ADMIN_PASSWORD>
            - WG_HOST=<🚨YOUR_SERVER_IP>
            - LANG=ko
        container_name: wg-easy
번호 제목 글쓴이 날짜 조회 수
48 도커(Docker)로 diun(Docker Image Update Notifier) 구축하기 미르다테 2025.04.18 19
47 도커(Docker)로 Minio 설치하기 미르다테 2025.04.17 3
46 도커(Docker)로 Rocky Linux 9.5에 Squid Proxy 설치하기 미르다테 2025.04.15 8
45 도커(Docker)로 Zabbix 서버 구축하기 미르다테 2025.04.15 4
44 vaultwarden 버전 확인하기 미르다테 2025.02.10 23
43 Docker-compose up -d 시 실행 오류 해결 방법 미르다테 2024.12.30 35
42 Squid를 Docker 컨테이너로 실행하는 방법 미르다테 2024.12.30 26
41 도커(Docker)로 컨테이너 Log 확인툴(Dozzle) 설치하기 미르다테 2024.12.30 24
40 도커(Docker)로 It-Tools 설치하기 미르다테 2024.12.30 17
39 도커(Docker) YAML 문법 검사 사이트 미르다테 2024.12.30 20
38 도커(Docker)로 Stirling-PDF 서버 설치하기 미르다테 2024.12.30 36
37 도커(Docker)로 이윰빌더(Eyoom)+그누보드 설치하기(한국형 게시판 커뮤니티) file 미르다테 2024.12.30 25
36 도커 컨테이너 내의 파일 가져오기, 로컬 파일 도커 컨테이너로 파일 넣기 미르다테 2024.12.30 22
35 Docker 네트워크 사용법 미르다테 2024.12.30 16
34 도커(Docker)로 FileRun 서버 설치하기 미르다테 2024.12.30 28
33 도커(Docker)로 AdguardHome 서버 설치하기 미르다테 2024.12.30 43
32 도커(Docker)로 SnapDrop 서버 설치하기 미르다테 2024.12.30 20
31 Docker - 방화벽 이슈(서비스를 올리면 외부망 허용 현상) 미르다테 2024.12.30 24
30 도커(Docker)로 Code Server 설치하기 미르다테 2024.12.30 19
29 도커(Docker)로 음악 스트리밍 서버 mStream 설치하기 미르다테 2024.12.30 18
위로