> For the complete documentation index, see [llms.txt](https://localxpose.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://localxpose.gitbook.io/docs/cli/docker.md).

# Docker

You can use LocalXpose docker version the same way as LocalXpose CLI. Check the availabe commands [here](/docs/cli.md).

## 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 [config.yaml](/docs/cli/config.yaml.md) file, then you have to mount it inside LocalXpose docker container, for example if we have the following config.yaml file:

{% code title="/home/username/config.yaml" %}

```
dev:
 type: http
 to: 192.168.100.2:8080
 subdomain: dockerdo
```

{% endcode %}

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 
```
