LogoLogo
  • Getting Started
  • CLI
    • Docker
    • Config.yaml
  • GUI (SOON)
  • Tunnels Types
    • HTTP/s
      • HTTP/s plugins
      • HTTP/s apps
    • TLS
    • TCP
    • UDP
  • Reservations
    • Domain
    • Endpoint
  • Troubleshoot
    • Common errors
  • Tutorials
    • Expose a local web server
    • Expose Apache/Nginx web server
    • Share files from localhost
    • Use LocalXpose with Traefik
    • Expose PocketBase backend
    • Create a custom domain name
    • Make Let's Encrypt certificate
    • Access your IP camera remotely
    • Access your Raspberry Pi remotely
    • Sync your Keepass password manager
    • Expose localhost RASA chatbot for Telegram Integration
    • Expose your local Netdata Instance
    • Testing Stripe webhook
    • Expose localhost Kubernetes
    • Expose database server (PostgreSQL)
    • Exposing local Minecraft server
    • More Tutorials
Powered by GitBook
On this page
  • Usage
  • - Run http tunnel
  • - Run mutliple tunnels from config.yaml

Was this helpful?

  1. CLI

Docker

PreviousCLINextConfig.yaml

Last updated 2 years ago

Was this helpful?

You can use LocalXpose docker version the same way as LocalXpose CLI. Check the availabe commands .

Usage

docker run -it -e ACCESS_TOKEN=YOUR_TOKEN_HERE \ 
    localxpose/localxpose:latest <COMMAND> <SUBCOMMAND> <FLAG>

- Run http tunnel

docker run -it -e ACCESS_TOKEN=YOUR_TOKEN_HERE \ 
    localxpose/localxpose:latest tunnel http 

since docker container has its own network, you cannot forward connections to localhost services like --to localhost:8080, localhost here is pointing to your LocalXpose docker container not to your host, to forward the traffic to your host network then get your host local IP address for exmaple 192.168.100.10, then do docker run -it localxpose/localxpose:latest tunnel http --to 192.168.100.10:8080.

Another approach is to run LocalXpose docker container in your host network by passing --net host to your docker run command, so the full command will be:

docker run --net host -it -e ACCESS_TOKEN=YOUR_TOKEN_HERE \ 
    localxpose/localxpose:latest tunnel http --to localhost:8080

- Run mutliple tunnels from config.yaml

First create your file, then you have to mount it inside LocalXpose docker container, for example if we have the following config.yaml file:

/home/username/config.yaml
dev:
 type: http
 to: 192.168.100.2:8080
 subdomain: dockerdo

Then mounting this config file to your LocalXpose conitaner and running the tunnels will be like:

docker run -it -e ACCESS_TOKEN=YOUR_TOKEN_HERE \ 
    -v /home/username/config.yaml:/config.yaml \ 
    localxpose/localxpose:latest tunnel config -f /config.yaml 
here
config.yaml