
Custom Web Development Services

To install WordPress on localhost, you need a web server, PHP and a MySQL-compatible database running on your own computer. The fastest route is a one-click tool such as LocalWP or WordPress Studio, which sets everything up in a few minutes. If you want to understand every moving part, use XAMPP: start Apache and MySQL, create a database in phpMyAdmin, copy WordPress into the htdocs folder, and run the installer at localhost.
This guide covers both methods on Windows and Mac, the settings that trip people up, and how to fix the five errors that stop most local installs.
A local WordPress install runs only on your machine, so nothing you change is visible on the internet. It costs nothing, works offline, and lets you test themes, plugins, PHP versions and code changes without risking a live site.
Developers use local sites for building themes and plugins. Site owners use them to test a major update or redesign before touching production. Learners use them to explore WordPress without paying for hosting.
Pick the tool based on what you’re trying to do, not on which one is most popular.
| Tool | Best for | Setup time | Platforms |
| WordPress Studio | Beginners; fastest possible install | A few minutes | Windows, Mac |
| LocalWP | Most users; multiple sites, switching PHP versions, SSL | A few minutes | Windows, Mac, Linux |
| XAMPP (manual) | Learning how WordPress, PHP and MySQL fit together | 15–20 minutes | Windows, Mac, Linux |
| Docker / wp-env | Developers matching production or working in teams | 5–15 minutes if Docker is installed | Windows, Mac, Linux |
| WordPress Playground | Quick tests in the browser, no install at all | Seconds | Any browser |
If you just need a working site today, use Studio or LocalWP. If you’re learning or need full control over Apache and PHP settings, use XAMPP.
WordPress.org currently recommends PHP 8.3 or newer and MariaDB 10.11+ or MySQL 8.0+. WordPress will still run on PHP 7.4, but that version is past end of life.
The more useful rule is to match your local PHP version to the one your live host runs. A plugin that works on PHP 8.3 locally can fail on a host still running 8.1, and you’ll only find out after deploying. Check your live site’s version under Tools → Site Health → Info → Server.

One-click tools bundle the server, PHP and database for you and run the WordPress installer in the background.
LocalWP also gives you one-click SSL for the local domain, a database viewer, and a shortcut to open the site folder in your code editor.
Studio has fewer settings than LocalWP, which is the point: it’s the shortest path to a working local site.

XAMPP bundles Apache (web server), MariaDB (a MySQL-compatible database, still labelled “MySQL” in the panel), PHP and phpMyAdmin. Here’s the full manual process.

The folder name becomes part of your local URL: http://localhost/mysite.
| Field | Value on a default XAMPP install |
| Database name | wp_local (the one you created) |
| Username | root |
| Password | leave blank |
| Database host | localhost |
| Table prefix | wp_ (change it if you’ll run several sites in one database) |
A root user with no password is acceptable only because XAMPP is running on your own machine and isn’t exposed to the internet. Never copy those database credentials to a live server.
Most failed local installs come down to five problems.
Another program is using the port. On Windows, common culprits are IIS, the World Wide Web Publishing Service, or other local server software. Either stop that program, or change Apache’s port: in XAMPP, click Config → httpd.conf, change Listen 80 to Listen 8080, save, and restart Apache. Your site then lives at http://localhost:8080/mysite.
Usually another MySQL instance or a previous XAMPP install is still running. Stop the other service, or change the port in my.ini and add the port to the database host in wp-config.php, for example localhost:3307.
WordPress can’t reach the database. Check that MySQL is running in the Control Panel, then check the database name, username, password and host in wp-config.php. A single typo in the database name causes this error.
Pretty permalinks need Apache’s mod_rewrite and a writable .htaccess file. Go to Settings → Permalinks and click Save Changes to regenerate .htaccess. On XAMPP, mod_rewrite is normally enabled; if not, uncomment the LoadModule rewrite_module line in httpd.conf.
PHP’s default upload limit is too small for many themes and plugins. Open php.ini (Config → PHP (php.ini) in XAMPP) and raise upload_max_filesize and post_max_size, for example to 64M, then restart Apache.
When the site is ready, you need to move both the files and the database, and update every URL from localhost to your real domain.
The simplest route is a migration plugin: export the site as a package locally, then import it on the live WordPress install. The plugin handles the search-and-replace of URLs, including serialised data, which a plain text find-and-replace in the SQL file can break.
Doing it manually works too: upload the files via SFTP, export the database from phpMyAdmin, import it on the host, update wp-config.php with the live database details, and run a search-replace with WP-CLI.
If you’d rather not handle migrations yourself, our team can take a site from local to live, including redirects, SSL and caching. See our WordPress development services.
Once your local site is running:
If you’re deciding whether WordPress is the right platform for your next project at all, read WordPress vs a custom-coded website. Planning a professional build instead of a DIY one? Here’s what WordPress development costs.
Yes. LocalWP and WordPress Studio install everything for you, Docker-based tools suit developers, and WordPress Playground runs WordPress in your browser with no install.
There isn’t one. You set the admin username and password during installation. On a default XAMPP setup, the database user is root with no password, which is separate from your WordPress login.
No. It runs only on your computer. To show it to someone, you need a sharing feature in your local tool, a temporary tunnel, or to move it to a staging server.
Yes. In XAMPP, create a separate folder and database for each site. LocalWP and Studio let you add as many sites as you like from the app.