Skip to content

Instantly share code, notes, and snippets.

@divadsn
Last active March 21, 2023 01:15
Show Gist options
  • Save divadsn/e9d3294c759e0ad2866721c256eefdf5 to your computer and use it in GitHub Desktop.
Save divadsn/e9d3294c759e0ad2866721c256eefdf5 to your computer and use it in GitHub Desktop.
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
PASSWORD=$(LC_ALL=C </dev/urandom tr -dc A-Za-z0-9 | head -c 24)
IP_ADDRESS=$(dig @resolver4.opendns.com myip.opendns.com +short -4)
# Update system
apt update
apt dist-upgrade -y
# Install git
apt install --no-install-recommends -y git
# Install Docker
curl -sSL https://get.docker.com/ | CHANNEL=stable sh
systemctl enable --now docker
# Clone repo to stream
git clone https://github.com/divadsn/docker-private-stream stream && cd stream
# Setup environment
cat << EOF > wireguard.env
PASSWORD=${PASSWORD}
WG_HOST=${IP_ADDRESS}
EOF
# Start everything
docker compose up -d
echo "=================================================="
echo ""
echo "Your docker-private-stream instance is ready!"
echo ""
echo "Admin panel: http://${IP_ADDRESS}:51821"
echo "Password: ${PASSWORD}"
echo ""
echo "=================================================="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment