Setup & site building · Guide
How to Open WordPress Dashboard in localhost (Step by Step)

Short answer
Start your local server, then open your local site address with /wp-admin/ on the end, such as http://localhost/mysite/wp-admin/, and log in with the admin details you set during install. In Local, click the WP Admin button instead. If the page fails, check that Apache and MySQL are running and the folder name is right.
Key takeaways
- The dashboard is always your local site address plus /wp-admin/.
- XAMPP and WAMP use localhost plus the folder name, and MAMP often adds port 8888.
- Local opens the dashboard with its WP Admin button.
- Log in with the local admin details, not your live site or hosting login.
- Redirects to the live site mean the home and siteurl values need changing.
How do you open the WordPress dashboard on localhost?
Start your local server, then visit your local site address with /wp-admin/ on the end, such as http://localhost/mysite/wp-admin/, and log in with the admin username and password you set during install.
The exact address depends on the tool you used to build the local site.
XAMPP and WAMP put sites under localhost plus a folder name. MAMP often adds a port number. Local (from WP Engine) gives each site its own domain, like mysite.local.
The login screen itself is the same file on every setup: wp-login.php. Visiting /wp-admin/ while logged out simply sends you there.
If you have not built a local site yet, start with our guide to setting up a local WordPress development environment.
What URL do you use for each local tool?
Use the local site address your tool created and add /wp-admin/ to it; the table below shows the usual pattern for the most common tools.
| Local tool | Typical site address | Dashboard address |
|---|---|---|
| XAMPP (Windows, Mac, Linux) | http://localhost/folder-name/ | http://localhost/folder-name/wp-admin/ |
| WAMP (Windows) | http://localhost/folder-name/ | http://localhost/folder-name/wp-admin/ |
| MAMP (Mac or Windows) | http://localhost:8888/folder-name/ | http://localhost:8888/folder-name/wp-admin/ |
| Local | http://site-name.local/ | Click the WP Admin button |
| WordPress in the site root | http://localhost/ | http://localhost/wp-admin/ |
The folder name is the folder that holds your WordPress files. For XAMPP that folder sits inside htdocs. For WAMP it usually sits inside www.
The port is the number after the colon. MAMP's default Apache port has long been 8888, but you can change it in MAMP's settings, so check the port shown there if the address fails.
If you are not sure of the folder name, open the server's web root folder and look for the folder that contains wp-admin, wp-content and wp-includes.
How do you open the dashboard with XAMPP?
Open the XAMPP Control Panel, start Apache and MySQL, then go to http://localhost/your-folder/wp-admin/ in your browser and log in.
Step by step:
- Open the XAMPP Control Panel
- Click Start next to Apache
- Click Start next to MySQL
- Wait until both module names turn green
- Open your browser and type http://localhost/your-folder/wp-admin/
- Enter your admin username or email and password
- Click Log In
Both services matter. Apache serves the PHP files, and MySQL (MariaDB in newer XAMPP builds) holds the database. If only Apache runs, you will see a database connection error instead of the login form.
You can download XAMPP from Apache Friends, the project that maintains it. If you have not installed WordPress inside it yet, follow our guide on adding WordPress to XAMPP.
How do you open the dashboard with Local?
Start the site in Local, select it in the sidebar, and click the WP Admin button on the site overview screen.
Local opens your browser at the site's wp-admin page. If you enabled one-click admin for that site, Local can log you in automatically as the user you picked. Otherwise, you log in with the username and password you chose when creating the site.
You can also type the address yourself. Local shows the site domain on the overview screen, and adding /wp-admin/ to it reaches the same login page.
Local handles the web server, PHP and database for you, so there is no Apache or MySQL to start by hand. You only need the site itself to be running.
How do you open the dashboard with MAMP or WAMP?
Start the servers in MAMP or WAMP, wait for the status lights to turn green, then open the site folder address with /wp-admin/ on the end.
For MAMP:
- Open MAMP and click Start
- Check the ports in MAMP's preferences or settings
- Visit http://localhost:8888/your-folder/wp-admin/ (use your own port)
- Log in with your WordPress admin details
For WAMP:
- Start WampServer and wait for the tray icon to turn green
- Visit http://localhost/your-folder/wp-admin/
- Log in
If you changed MAMP to use port 80, you can drop the port number from the address. You can find MAMP downloads and notes on the MAMP website.
What login details does the local site use?
The local site uses the admin username and password you entered during the WordPress install, not your live site's login and not your hosting account details.
This trips up many people. A fresh local install has its own users table. Your live site's password only works locally if you copied the live database into the local site.
If you moved a live site to localhost with a migration plugin, the users came with the database. In that case, your live login usually works on the local copy too.
Not sure which user exists? Open phpMyAdmin (usually at http://localhost/phpmyadmin/ for XAMPP and WAMP), pick the site's database, and look in the users table. The table name starts with your table prefix, such as wp_users.
What if you forgot the local admin password?
Reset it from phpMyAdmin, with WP-CLI, or with the “Lost your password?” link if your local setup can send email.
Most local stacks cannot send real email, so the reset link often never arrives. The quicker paths are:
- phpMyAdmin: open the users table, edit your user, type a new password in user_pass, choose MD5 in the function column, and save. WordPress upgrades the hash the next time you log in.
- WP-CLI: run the command below from the site folder.
- Local: use one-click admin, or open the site shell from Local and use WP-CLI.
wp user update admin --user_pass="new-strong-password"
Replace admin with your username or user ID. The wp user update command is part of WP-CLI, which Local ships with.
For more ways to do this, see our guide on changing a WordPress password.
Why does localhost/wp-admin not open?
The usual causes are a stopped server, the wrong folder name or port, a blocked port, a database error, or site URLs that still point to a live domain.
Match what you see to the likely cause:
| What you see | Likely cause | Fix |
|---|---|---|
| This site can't be reached | Apache or the site is not running | Start the server and try again |
| 404 Not Found | Wrong folder name in the URL | Check the folder name inside htdocs or www |
| Error establishing a database connection | MySQL stopped or wrong details in wp-config.php | Start MySQL and check DB_NAME, DB_USER and DB_PASSWORD |
| Redirects to the live site | siteurl and home still use the live domain | Update the URLs locally |
| Blank white page | PHP error | Turn on debug mode and read the error |
| Login page reloads | Cookie or URL mismatch | Make the site URLs match the address you use |
The database details live in wp-config.php. Our guide on where to find wp-config.php shows where that file sits.
How do you fix a redirect to the live site?
Add WP_HOME and WP_SITEURL to the local wp-config.php file, or change the home and siteurl values in the options table to your local address.
This happens after you copy a live database to your computer without replacing the URLs. WordPress reads the live domain from the database and sends you there.
The quick fix in wp-config.php, above the line that says to stop editing:
define( 'WP_HOME', 'http://localhost/mysite' );
define( 'WP_SITEURL', 'http://localhost/mysite' );
These constants are covered in the wp-config.php documentation. They override the database values, so remove them before you push the site back live.
For a lasting fix, run a search and replace on the database so links in posts also point to the local address. WP-CLI's search-replace command or a migration plugin can do this safely, including serialized data.
What causes port conflicts on localhost?
A port conflict happens when another program already uses port 80 or 443, so Apache cannot start and the local site does not load.
On Windows, common culprits include IIS, other local server stacks and some older apps that grab port 80. The XAMPP Control Panel usually shows a port error in its log when Apache fails to start.
You have two options:
- Stop the other program, then start Apache again
- Change Apache to another port, such as 8080, and add it to your URL: http://localhost:8080/mysite/wp-admin/
If you change the port, also update the site URLs to include it. Otherwise WordPress may redirect you back to the old address.
How do you fix a blank page or login loop on localhost?
Turn on WP_DEBUG to see the PHP error behind a blank page, and make sure the site URL matches the exact address you type to stop a login loop.
A blank page is often a plugin or theme error, or a PHP version mismatch. Set WP_DEBUG to true in wp-config.php and reload. Our guide to enabling debug mode walks through it.
A login that keeps sending you back to the form usually means the cookie domain does not match. Typing http://127.0.0.1/mysite/ while WordPress expects http://localhost/mysite/ is a classic example. Use the same host every time.
If a plugin is the cause, rename its folder inside wp-content/plugins to turn it off. Then log in and sort out the plugin from the dashboard.
For login problems on any site, local or live, our guide to fixing a login page that keeps refreshing goes deeper.
What should you do once you are in the dashboard?
Bookmark the wp-admin address, check Settings > General to confirm the local URLs, and set Settings > Reading to discourage search engines if the local site is ever exposed online.
A local site is usually private to your computer, so search engines cannot see it. Still, it is good practice to keep it clearly separate from the live site, for example with a different admin colour scheme in your profile.
If you are new to the admin area, our overview of the WordPress dashboard explains what each menu does. The Administration Screens documentation on WordPress.org covers the same ground in more detail.
From here, you can install themes and plugins, test updates and build pages exactly as you would on a live site, without any risk to visitors.
Frequently asked questions
What is the default WordPress admin URL on localhost?
It is your local site address followed by wp-admin. For a site in a folder called mysite under XAMPP, you type localhost, a slash, the folder name, then wp-admin. If WordPress sits in the web root, you type localhost and wp-admin with no folder in between.
Why does localhost/wp-admin show 404 Not Found?
The folder name in the address does not match the folder that holds WordPress. Open htdocs or www, find the folder containing wp-admin and wp-includes, and use that exact name in the URL. Folder names can be case sensitive on Mac and Linux.
Can I use my live site password on localhost?
Only if you copied the live database to your computer. A fresh local install has its own users, so you must use the username and password you created during that install. You can reset it through phpMyAdmin or WP-CLI.
Why does my local site redirect to my live website?
The home and siteurl settings in the database still hold your live domain. Add WP_HOME and WP_SITEURL to wp-config.php with your local address, or run a search and replace on the database to update every URL.
Do I need to start MySQL to open wp-admin?
Yes. WordPress reads users and settings from the database, so without MySQL or MariaDB running you will see a database connection error. In XAMPP, start both Apache and MySQL before opening the site.
Sources
- XAMPP Apache + MariaDB + PHP + Perl Apache Friends
- Local: local WordPress development WP Engine
- MAMP & MAMP PRO MAMP
- wp user update WordPress Developer Resources
- wp-config.php WordPress Developer Resources
- Administration Screens WordPress.org Documentation
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


