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

Spin up a full WordPress site on your own computer using Docker. No coding required — just copy-paste commands.
We need one tidy folder to hold everything. This command makes a folder called 'my-wordpress' and moves you into it.
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.
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.
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.
'docker compose' is not recognized — you may have an older Docker version
Try 'docker-compose up -d' (with a hyphen) instead.
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.
The page shows 'Error establishing a database connection'
The database container is still starting up. Wait 30 seconds and refresh the page.
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.
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.
Running 'docker compose down -v' deletes ALL your content permanently
Only use 'docker compose down' (without -v) to preserve your posts, themes, and plugins.
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.
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.