Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Last active May 31, 2024 14:11
Show Gist options
  • Save Shelob9/1675d7200be06e48782f3137cb4e5fd8 to your computer and use it in GitHub Desktop.
Save Shelob9/1675d7200be06e48782f3137cb4e5fd8 to your computer and use it in GitHub Desktop.
# Install nginx
apt install nginx
# Run at start
systemctl enable nginx
# Check status
systemctl status nginx
sudo ufw allow 80/tcp
sudo ufw reload
# Download
wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
# Install
sudo dpkg -i cloudflared-linux-amd64.deb
# Confirm
cloudflared version
# Login
cloudflared tunnel login
# Create tunnel
cloudflared tunnel create josh412
# Edit
cd ~/.cloudflared/
nano config.yml
# Add route
cloudflared tunnel route dns josh412 www
# Run
cloudflared tunel run josh412
## Press Ctrl + Z, and enter bg to send the Tunnel output to the background.
# Get info
cloudflared tunnel info mytunnel
# Run at startup
sudo cloudflared --config /root/.cloudflared/config.yml service install
sudo systemctl enable cloudflared
# View the Cloudflared service status.
sudo systemctl status cloudflared
# Each time you make changes to the config.yml file or create new tunnels, restart cloudflared using the following command.
sudo systemctl restart cloudflared
systemctl restart nginx && sudo systemctl restart cloudflared
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment