WindowsmacOSLinux

Where Is the XAMPP htdocs Folder?

XAMPP serves websites out of an htdocs folder inside its own install directory, in a different place on each desktop OS.

Last updated

Opening http://localhost in a browser shows whatever sits in htdocs. Each project gets a subfolder there, so localhost/myproject maps to an htdocs/myproject directory on disk.

The stock dashboard page in htdocs is just files like everything else. Delete or replace it once your own project takes over. MySQL data sits nearby under mysql/data, which is the folder to preserve when migrating a local WordPress install.

Where XAMPP stores this, by platform

Windows
C:\xampp\htdocs

Default Control Panel install location. A custom install path moves htdocs along with it, so check where you installed first.

macOS
/Applications/XAMPP/htdocs

Same localhost mapping as Windows. Config files sit under /Applications/XAMPP/etc rather than beside htdocs.

Linux
/opt/lampp/htdocs

The tree is root owned, so copying projects in needs sudo or a chown. Start services with sudo /opt/lampp/lampp start.

Frequently asked questions

How do I change the document root?

Edit the DocumentRoot and matching Directory lines in httpd.conf, then restart Apache from the Control Panel. Keep both lines in agreement or permission errors follow.

Where is the XAMPP MySQL data?

Under mysql/data beside htdocs on every OS. Stop MySQL before copying that folder, and prefer phpMyAdmin exports for routine backups.

Notice an outdated path? Let us know.