LIVEReading: Run WordPress Locally in Under 10 MinutesTotal time: 8 minSteps: 6Worked first time: 85% LIVEReading: Run WordPress Locally in Under 10 MinutesTotal time: 8 minSteps: 6Worked first time: 85%
CBW
Run WordPress Locally in Under 10 Minutes
Easygithub.com/wordpress/wordpress2026-06-30

Run WordPress Locally in Under 10 Minutes

Spin up a full WordPress site on your own computer using Docker. No coding required — just copy-paste commands.

// Build stats

  • Total time8 min
  • Number of steps6
  • DifficultyEasy
  • Worked first time85%
// Before you start

What you need

  • A Mac, Windows, or Linux computer
  • Docker Desktop installed and running (docker.com/products/docker-desktop)
  • A terminal app (Terminal on Mac, PowerShell on Windows)
  • About 500 MB of free disk space
01
Step 1 of 6

Create a project folder

1 min

We need one tidy folder to hold everything. This command makes a folder called 'my-wordpress' and moves you into it.

Terminal · mac
$ mkdir my-wordpress && cd my-wordpress
What you should see
Your terminal prompt changes to show you are inside the my-wordpress folder.
02
Step 2 of 6

Create the Docker Compose file

2 min

Docker Compose is a recipe file that tells Docker exactly which software to download and how to wire it together. WordPress needs two things: the WordPress application itself, and a MySQL database. The command below writes that recipe file for you in one shot. On Mac or Linux use the first command; on Windows PowerShell use the second.

Terminal · mac
$ cat > docker-compose.yml << 'EOF'
$ version: '3.8'
$ services:
$ db:
$ image: mysql:8.0
$ restart: always
$ environment:
$ MYSQL_ROOT_PASSWORD: rootpass
$ MYSQL_DATABASE: wordpress
$ MYSQL_USER: wpuser
$ MYSQL_PASSWORD: wppass
$ volumes:
$ - db_data:/var/lib/mysql
$ wordpress:
$ image: wordpress:latest
$ restart: always
$ ports:
$ - "8080:80"
$ environment:
$ WORDPRESS_DB_HOST: db
$ WORDPRESS_DB_USER: wpuser
$ WORDPRESS_DB_PASSWORD: wppass
$ WORDPRESS_DB_NAME: wordpress
$ volumes:
$ - wp_data:/var/www/html
$ volumes:
$ db_data:
$ wp_data:
$ EOF
$
$ # Windows PowerShell alternative:
$ # @'
$ # (paste the yaml block above)
$ # '@ | Set-Content docker-compose.yml
What you should see
A file named docker-compose.yml appears in your folder. You can confirm with: ls
This might happen

Port 8080 is already in use by another app

Open docker-compose.yml in any text editor and change '8080:80' to '8081:80', then use localhost:8081 in your browser instead.

03
Step 3 of 6

Download and start WordPress

3-5 min

This single command tells Docker to download the WordPress and MySQL images from the internet and start them both. The first run takes a few minutes because it is downloading roughly 400 MB. Future starts are instant.

Terminal · mac
$ docker compose up -d
What you should see
You should see lines like '[+] Running 2/2' and 'Container my-wordpress-wordpress-1 Started'. No red error text.
This might happen

'docker compose' is not recognized — you may have an older Docker version

Try 'docker-compose up -d' (with a hyphen) instead.

04
Step 4 of 6

Open WordPress in your browser

1 min

WordPress is now running on your computer. Open your web browser and go to the address below. You will see the famous WordPress five-minute install screen where you pick your site title, username, and password.

Terminal · mac
$ open http://localhost:8080
$
$ # Windows: start http://localhost:8080
$ # Or just type http://localhost:8080 into any browser
What you should see
A WordPress language-selection screen appears in your browser.
This might happen

The page shows 'Error establishing a database connection'

The database container is still starting up. Wait 30 seconds and refresh the page.

05
Step 5 of 6

Complete the WordPress setup wizard

2 min

Fill in your site title, choose an admin username and a strong password, and enter your email address. Click 'Install WordPress'. That is it — your site is live locally. Log in at http://localhost:8080/wp-admin with the credentials you just chose.

Terminal · mac
$ # No terminal command needed for this step.
$ # Fill in the browser form and click 'Install WordPress'.
What you should see
A 'Success!' screen appears. You can now log in to your WordPress dashboard.
06
Step 6 of 6

Stop and restart WordPress any time

1 min

When you are done working, stop the containers to free up memory. Your content is saved in Docker volumes and will still be there next time you start it up again.

Terminal · mac
$ # Stop:
$ docker compose down
$
$ # Start again later (from inside the my-wordpress folder):
$ docker compose up -d
What you should see
Stop: 'Container my-wordpress-wordpress-1 Stopped'. Start: '[+] Running 2/2'.
This might happen

Running 'docker compose down -v' deletes ALL your content permanently

Only use 'docker compose down' (without -v) to preserve your posts, themes, and plugins.

// Status

cooked. baked. worked.

A fully working WordPress site running at http://localhost:8080 on your own computer, with a complete admin dashboard where you can install themes, plugins, and create content.

// the honest bit

The honest part

This guide runs WordPress locally for development and testing only — it is not exposed to the internet. The GitHub repo (wordpress/wordpress) is a read-only mirror of the official Subversion codebase; you cannot contribute via pull requests there. For a public website you will need a hosting provider. The Docker setup here uses simple passwords — never use these credentials on a real server.