Some Basic Pre-requisites

Some Basic Pre-requisites

Open all ports (dev purpose only)

$ sudo iptables -P INPUT ACCEPT
$ sudo iptables -P FORWARD ACCEPT
$ sudo iptables -P OUTPUT ACCEPT
$ sudo iptables -F
$ apt-get purge netfilter-persistent
$ reboot

Install docker

$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh

Install docker-compose (check latest version)

$ sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose

Export snap path

$ export PATH=$PATH:/snap/bin

Clean up all unused docker images

$ docker system prune -a

Install V2Ray

$ curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh
$ curl -O https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh
$ bash install-release.sh
$ bash install-dat-release.sh

# LOCATION: /usr/local/etc/v2ray/

$ bash install-release.sh --remove

Install BBR (check script before run)

$ wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && ./bbr.sh

Caddy v2

$ echo "deb [trusted=yes] https://apt.fury.io/caddy/ /" \
| sudo tee -a /etc/apt/sources.list.d/caddy-fury.list
$ sudo apt update
$ sudo apt install caddy
$ sudo systemctl daemon-reload
$ sudo systemctl enable caddy
$ sudo systemctl start caddy
$ sudo systemctl status caddy

Swapfile

## This is 128M*32=4G swapfile, for 2G RAM. Adjust yourself
$ sudo dd if=/dev/zero of=/swapfile bs=128M count=32
$ sudo chmod 600 /swapfile
$ sudo mkswap /swapfile
$ sudo swapon /swapfile
$ sudo nano /etc/fstab
## Add the following new line at the end of the file, save the file, and then exit:
/swapfile swap swap defaults 0 0

Copyright statement: Unless otherwise stated, all articles on this blog adopt the CC BY-NC-SA 4.0 license agreement. For non-commercial reprints and citations, please indicate the author: Henry, and original article URL. For commercial reprints, please contact the author for authorization.