TunnelHouse starts a docker container with cloudflared and a dedicated network. So that you can easily manage multiple tunnels on a single host. Just connect your services with the container network and enjoy the uninteruped expose of service to the outside network
- Easy setup of Cloudflare Tunnel in Docker
- Automatic Docker network creation
- Flexible container naming
- Colorized output for better visibility
- Comprehensive error checking
- No container name required (Docker auto-assigns if not specified)
- Docker installed and running
- Cloudflare Tunnel token (set as environment variable)
- Recommended installation approach
curl -fsSL https://kanishkk.xyz/tunnelhouse | bash
- Manual installation: Download the script from this repository and make it executable: Make it executable:
chmod +x tunnelhouse.sh# Set your Cloudflare tunnel token
export TOKEN="your-tunnel-token-here"
# Run with network name (Docker assigns container name automatically)
./tunnelhouse.sh your-network-name
# Run with network and container name
./tunnelhouse.sh your-network-name your-container-name# Using flags
./tunnelhouse.sh --net your-network-name --name your-container-name
# Short flags
./tunnelhouse.sh -n your-network-name -c your-container-name./tunnelhouse.sh --helpTOKEN: Required. Your Cloudflare tunnel token.
-
Basic setup with auto-assigned container name:
export TOKEN="your-token-here" ./tunnelhouse.sh my-network
-
With specified container name:
export TOKEN="your-token-here" ./tunnelhouse.sh my-network my-tunnel
-
Using flags:
export TOKEN="your-token-here" ./tunnelhouse.sh --net my-network --name my-tunnel
-
Docker not found:
- Ensure Docker is installed and running
- Verify your user is in the docker group
-
TOKEN not set:
- Set the environment variable before running:
export TOKEN="your-token-here"
- Set the environment variable before running:
-
Network already exists:
- The script will use existing networks without issue
- If you need a fresh network, remove it first:
docker network rm your-network-name
-
Container already exists:
- Use a different container name
- Or remove the existing container:
docker rm -f your-container-name
- Checks Docker installation and daemon status
- Verifies the
TOKENenvironment variable is set - Ensures the specified Docker network exists (creates if needed)
- Checks for existing container name conflicts (if specified)
- Pulls the latest cloudflared image
- Runs the container with the tunnel configuration
This project is open source and available under the MIT License.