Sign up for a new account using the URL:
Create the cheapest droplet ($5/month)
- Ubuntu 20.04
- Basic
- Regular Intel CPU
- Open Powershell
- Generate a new SSH Key
- Command: ssh-keygen
- Save it to a new file
- Create a password for that file
- Read the contents of the file
- Command: cat path_to_file//filename.pub
- Copy the contents into the SSH key creator and create the droplet
(Note: I am following the instructions from: https://thematrix.dev/install-docker-and-docker-compose-on-ubuntu-20-04/)
- Install necessary tools:
- Command:
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
- Add Docker key:
- Command:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- Add Docker repo:
- Command:
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
- Switch to correct repo:
- Command:
apt-cache policy docker-ce
- Install Docker:
- Command:
sudo apt install docker-ce -y
- Installation:
- Command:
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- Set permission:
- Command:
sudo chmod +x /usr/local/bin/docker-compose
(Note: I am following the instructions from: https://thematrix.dev/setup-wireguard-vpn-server-with-docker/)
- Launch Droplet Console from the "Access" tab under the droplet that was just created
- Create wireguard directory in home directory
- Command: mkdir -p ~/wireguard/
- Create config subdirectory
- Command: mkdir -p ~/wireguard/config/
- Create and edit a file called docker-compose.yml
- Command: nano ~/wireguard/docker-compose.yml
- Paste the following into the docker-compose.yml file:
version: '3.8'
services:
wireguard:
container_name: wireguard
image: linuxserver/wireguard
environment:
- PUID=1000
- PGID=1000
- TZ=__TIMEZONE__
- SERVERURL=__DROPLET_IP-ADDRESS__
- SERVERPORT=51820
- PEERS=pc1,pc2,phone1
- PEERDNS=auto
- INTERNAL_SUBNET=10.0.0.0
ports:
- 51820:51820/udp
volumes:
- type: bind
source: ./config/
target: /config/
- type: bind
source: /lib/modules
target: /lib/modules
restart: always
cap_add:
- NET_ADMIN
- SYS_MODULE
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
- Replace TIMEZONE with the desired timezone
- Replace DROPLET_IP-ADDRESS with the IP Adress assigned to your droplet
- Start Wireguard
- Command:
cd ~/wireguard/
docker-compose up -d
- View the execution log and generate QR code: -Command: docker-compose logs -f wireguard
- Download the "WireGuard" app from the Google Play Store
- Open Wireguard app on your phone
- Click + >> Create from QR code
- Scan one of the QR codes generated on the screen to connect to the VPN
- Note: I scanned the QR code generated for the "phone1" peer
- Install WireGuard program:
- Download link: https://www.wireguard.com/install/
- Find the config file for the user you want to connect to (in my case I cose to connect to peer_pc1)
- Command: cd ~/wireguard/config/User_you_want
- Open the User_you_want.conf file with nano (for me it was peer_pc1.conf)
- Command: nano User_you_want.conf (for me: nano peer_pc1.conf)
- Copy all the contents of the file into a new file on the computer you want to connect to the VPN with
- Launch the WireGuard program you just installed
- Select the "Add Tunnel" button and open the new .conf file you just created
- Activate the connection and you are finished!