WireGuard is a straightforward yet fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPsec while avoiding the massive headache. It intends to be considerably more performant than OpenVPN. WireGuard is designed as a general-purpose VPN for running on embedded interfaces and super computers alike, fit for many different circumstances. Initially released for the Linux kernel, it is now cross-platform (Windows, macOS, BSD, iOS, Android) and widely deployable. It is currently under a massive development, but it already might be regarded as the most secure, most comfortable to use, and the simplest VPN solution in the industry.
- robust and modern security by default
- minimal config and critical management
- fast, both low-latency and high-bandwidth
- simple internals and small protocol surface area
- simple CLI and seamless integration with system networking
- CentOS, Debian, Ubuntu, Arch, Fedora, Redhat, Raspbian
- Linux
Kernel 3.1
or newer - You will need superuser access or a user account with
sudo
privilege.
Lets first use curl
and save the file in /etc/wireguard/
curl https://raw.githubusercontent.com/complexorganizations/wireguard-manager/master/wireguard-server.sh --create-dirs -o /etc/wireguard/wireguard-server.sh
Then let's make the script user executable (Optional)
chmod +x /etc/wireguard/wireguard-server.sh
It's finally time to execute the script
bash /etc/wireguard/wireguard-server.sh
In your /etc/wireguard/clients
directory, you will have .conf
files. These are the client configuration files. Download them from your WireGuard Interface and connect using your favorite WireGuard Peer.
- Show WireGuard Interface
- Start WireGuard Interface
- Stop WireGuard Interface
- Restart WireGuard Interface
- Add WireGuard Peer
- Remove WireGuard Peer
- Uninstall WireGuard Interface
- Update this script
usage: ./wireguard-server.sh [options]
--install Install WireGuard Interface
--start Start WireGuard Interface
--stop Stop WireGuard Interface
--restart Restart WireGuard Interface
--list Show WireGuard Peers
--add Add WireGuard Peer
--remove Remove WireGuard Peer
--reinstall Reinstall WireGuard Interface
--uninstall Uninstall WireGuard Interface
--update Update WireGuard Script
--help Show Usage Guide
- Installs and configures a ready-to-use WireGuard Interface
- (IPv4|IPv6) Supported, (IPv4|IPv6) Leak Protection
- Iptables rules and forwarding managed in a seamless way
- If needed, the script can cleanly remove WireGuard, including configuration and iptables rules
- Variety of DNS resolvers to be pushed to the clients
- The choice to use a self-hosted resolver with Unbound.
- Preshared-key for an extra layer of security.
- Block DNS leaks
- Dynamic DNS supported
- Many other little things!
PRIVATE_SUBNET_V4
- private IPv4 subnet configuration10.8.0.0/24
by defaultPRIVATE_SUBNET_V6
- private IPv6 subnet configurationfd42:42:42::0/64
by defaultSERVER_HOST_V4
- public IPv4 address, detected by default usingcurl
SERVER_HOST_V6
- public IPv6 address, detected by default usingcurl
SERVER_PUB_NIC
- public nig address, detected by defaultSERVER_PORT
- public port for wireguard server, default is51820
DISABLE_HOST
- Disable or enable ipv4 and ipv6, default disabledCLIENT_ALLOWED_IP
- private or public IP range allowed in the tunnelNAT_CHOICE
- Keep sending packets to keep the tunnel alive25
INSTALL_UNBOUND
- Install unbound settingsy/n
DNS_CHOICE
- Without Unbound you have to use a public dns like8.8.8.8
CLIENT_NAME
- name of the clientMTU_CHOICE
- the MTU the client will use to connect to DNS1420
OS | Supported | i386 | amd64 | armhf | arm64 |
---|---|---|---|---|---|
Ubuntu 14.04 β€ | β | β | β | β | β |
Ubuntu 16.04 | β | β | β | β | β |
Ubuntu 18.04 | β | β | β | β | β |
Ubuntu 19.10 β₯ | β | β | β | β | β |
Debian 7.x β€ | β | β | β | β | β |
Debian 8.x | β | β | β | β | β |
Debian 9.x | β | β | β | β | β |
Debian 10.x β₯ | β | β | β | β | β |
CentOS 6.x β€ | β | β | β | β | β |
CentOS 7.x | β | β | β | β | β |
CentOS 8.x β₯ | β | β | β | β | β |
Fedora 29 β€ | β | β | β | β | β |
Fedora 30 | β | β | β | β | β |
Fedora 31 | β | β | β | β | β |
Fedora 32 β₯ | β | β | β | β | β |
RedHat 6.x β€ | β | β | β | β | β |
RedHat 7.x | β | β | β | β | β |
RedHat 8.x β₯ | β | β | β | β | β |
Arch | β | β | β | β | β |
Raspbian | β | β | β | β | β |
Cloud | Supported |
---|---|
AWS | β |
Google Cloud | β |
Linode | β |
Digital Ocean | β |
Vultr | β |
Microsoft Azure | β |
OpenStack | β |
Rackspace | β |
Scaleway | β |
EuroVPS | β |
Hetzner Cloud | β |
Strato | β |
Virtualization | Supported |
---|---|
KVM | β |
LXC | β |
OpenVZ | β |
Docker | β |
Which hosting provider do you recommend?
- Google Cloud: Worldwide locations, starting at $10/month
- Vultr: Worldwide locations, IPv6 support, starting at $3.50/month
- Digital Ocean: Worldwide locations, IPv6 support, starting at $5/month
- Linode: Worldwide locations, IPv6 support, starting at $5/month
Which WireGuard client do you recommend?
Is there WireGuard documentation?
- Yes, please head to the WireGuard Manual, which references all the options.
How do I install a wireguard without the questions? (Headless Install) Server Only
HEADLESS_INSTALL=y /etc/wireguard/wireguard-server.sh
Official Links
- Homepage: https://www.wireguard.com
- Install: https://www.wireguard.com/install/
- QuickStart: https://www.wireguard.com/quickstart/
- Compiling: https://www.wireguard.com/compilation/
- Whitepaper: https://www.wireguard.com/papers/wireguard.pdf
Using a browser based development environment:
git clone https://github.com/complexorganizations/wireguard-manager /etc/wireguard/
bash -x /etc/wireguard/wireguard-(server|client).sh >> /etc/wireguard/wireguard-(server|client).log
- Name: Prajwal Koirala
- Website: https://www.prajwalkoirala.com
- Github: @prajwal-koirala
- LinkedIn: @prajwal-koirala
- Twitter: @Prajwal_K23
- Reddit: @prajwalkoirala23
- Twitch: @prajwalkoirala23
Give, and βοΈ if this project helped you!