> 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/tutorials/expose-local-web-server.md).

# Expose a local web server

### 1. Prepare the website

We have here a website as follows

![Website files](/files/-Ls3YQkaFWyeDkFspOxU)

##

### 2. Start a web server

We will serve the website by using any webserver (apache, nginx..etc), in our case we chose `http-server`(a simple, zero-configuration command-line http server).

![Starting a webserver](/files/-Ls3biNtddD40QNDhA3l)

Now we have website running on localhost at `http://localhost:8081` .

##

### 3. Start an HTTP tunnel

`loclx tunnel http --to 127.0.0.1:8081 --subdomain hello-world`

After creating the tunnel and getting a shareable link to our website, we can access the website from that URL.

![Our website accessible now from the internet](/files/-Ls3zfvVUk9ndd5yMtpL)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://localxpose.gitbook.io/docs/tutorials/expose-local-web-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
