~ / blog / hosting-xampp-localnet

Hosting a Local Website with XAMPP and LocalToNet

A step-by-step guide to exposing a locally hosted site with XAMPP and LocalToNet for demos, testing, and short-lived external access.

What This Covers

How to stand up a local Apache and PHP stack quickly, then make it reachable from the internet without router changes.

Target / Lab

Local web server setup for demos and short-lived testing

Tools Used
XAMPPApacheLocalToNet
Key Takeaways
  • Use XAMPP to get a local web stack running with minimal setup overhead.
  • Use LocalToNet to share a temporary public URL without touching port forwarding.
  • Treat exposed local services as short-lived test environments, not permanent deployments.
// contents
  1. Overview
  2. Requirements
  3. Step 1 — Install & Configure XAMPP
  4. Step 2 — Expose Localhost with LocalToNet
  5. Final Result

Overview

Sometimes you need to quickly spin up a web server — to test a PHP app, share a local project with someone, or set up a target for practicing web exploitation. XAMPP gives you Apache + MySQL + PHP in one installer. LocalToNet gives you a public URL tunneling into your localhost, bypassing router NAT without any port forwarding config.

This combo is especially useful for security testing labs — spin up a vulnerable app locally, expose it temporarily, and tear it down when done.

Requirements

// what you need
A PC running Windows, macOS, or Linux
XAMPP installed (free from apachefriends.org)
A LocalToNet account (free tier available)

Step 1 — Install & Configure XAMPP

1

Download and install XAMPP

Grab the installer from apachefriends.org and run it. The defaults are fine — just make sure Apache and MySQL are checked.

2

Start Apache

Open the XAMPP Control Panel and click Start next to the Apache module. The status should turn green.

3

Test your local server

Visit http://localhost in your browser. You should see the XAMPP welcome page — that means Apache is running.

4

Place your files

Put your project files in the XAMPP document root:

windows path
C:\xampp\htdocs\your-project\
linux / mac path
/opt/lampp/htdocs/your-project/

Access your project at http://localhost/your-project/index.html (or .php).

ℹ️ PHP files

If you're running PHP, make sure the file extension is .php — Apache needs to process it through the PHP interpreter, not serve it as static HTML.

Step 2 — Expose Localhost with LocalToNet

1

Sign up and download LocalToNet

Create a free account at localtonet.com, then download the LocalToNet client application for your OS.

2

Add LocalToNet to your PATH

Extract the binary and add its folder to your system's environment variables so you can run it from any terminal.

windows — add to PATH via PowerShell
$env:PATH += ";C:\path\to\localtonet"
linux / mac — add to PATH
export PATH=$PATH:/path/to/localtonet
# Add the above line to ~/.bashrc or ~/.zshrc to persist it
3

Authenticate and connect

Open a terminal and run:

bash
localtonet

When prompted, enter your AuthToken — find it in your LocalToNet dashboard under your account settings.

4

Create an HTTP tunnel

In the LocalToNet dashboard, go to My Tokens → HTTP tab → create a new tunnel. Point it at localhost:80 (XAMPP's Apache port). Start the tunnel and LocalToNet will generate a public URL like https://abc123.localto.net.

✅ Done!

Anyone with that URL can now access your local project from anywhere on the internet — no router config, no static IP needed.

Final Result

You now have a full local web server stack running on your machine, publicly accessible via a tunnel URL. This is useful for sharing work-in-progress projects, running vulnerable web apps for practice, or setting up temporary targets for penetration testing labs.

⚠️ Security note

Don't leave tunnels open when not in use — especially if you're running intentionally vulnerable apps. Anyone with the URL can access your local server. Tear down the tunnel when you're done.

Move through the archive

Browse all posts
Newer post Getting Started with Burp Suite 2025-07-23 . ~5 min read Older post Understanding SQL Injection 2025-06-15 . ~7 min read

More from the archive

A few more write-ups to keep the thread going.

← Back to blog