Skip to content

Konstantin023/antizapret-vpn-docker

 
 

Repository files navigation

Antizapret VPN server

Easy-to-start docker container with antizapret vpn server for selfhosting.

About

Easy-to-use docker image based upon original Atnizapret LXD image.

Improvements

Installation

  1. Install docker

    curl -fsSL https://get.docker.com -o get-docker.sh
    sudo sh get-docker.sh
  2. Copy this repository, build container, and run it.

    git clone https://github.com/xtrime-ru/antizapret-vpn-docker.git antizapret
    cd antizapret
    docker compose pull
    docker compose up -d
  3. Download .ovpn configuration file for your openvpn client from keys/client folder. There will be udp and tcp versions of the config. For better performance use upd. Tcp version will be better for unstable conditions.

Update:

git pull
docker compose pull
docker compose up -d

Enable OpenVPN Data Channel Offload (DCO)

OpenVPN Data Channel Offload (DCO) provides performance improvements by moving the data channel handling to the kernel space, where it can be handled more efficiently and with multi-threading. TLDR: increase speed and reduce CPU usage for server.

Unfortunately kernel extensions cant be installed in docker.
Install it on host machine

Ubuntu 24.04+:

apt update && apt upgrade

# Please reboot your system after upgrade!

apt install -y efivar
apt install -y openvpn-dco-dkms

Ubuntu 20.04+:

apt update && apt upgrade

# Please reboot your system after upgrade!

apt install -y efivar dkms linux-headers-$(uname -r)
wget http://de.archive.ubuntu.com/ubuntu/pool/universe/o/openvpn-dco-dkms/openvpn-dco-dkms_0.0+git20231103-1_all.deb
dpkg -i openvpn-dco-dkms_0.0+git20231103-1_all.deb

Keys persistence

Server keys are stored in keys/server/ and client keys - in keys/client/. Keys are persistent between container and host restarts.

To generate new keys - remove files and container again:

docker compose down
rm -rf keys/{client,server}/keys/*.{crt,key}
docker compose up -d

Additional domains

Any domain and/or IP can be added or excluded from list with config files This lists are added/excluded to/from automatically generated lists of domains and IP's. To apply changes: reboot container and wait few minutes for new rules generation.

Environment Variables

You can define this variables in docker-compose file for your needs

  • DNS=1.1.1.1 - DNS server to resolve domains. By default - system/docker dns
  • DNS_RU=77.88.8.8 - Russian DNS server. Used to fix issues with geo zones mismatch for domains like apple.com

Links

About

Docker container with antizapret-vpn for selfhosting.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 48.7%
  • Shell 31.4%
  • Lua 11.3%
  • Dockerfile 8.6%