Installs a configured and ready to use WordPress including MySQL and WP-CLI
50K+
WordPress Docker image bundled with MySQL and WordPress CLI. Installs an automatically configured and ready to use WordPress.
Everything needed to run WordPress is included in the image and no manual configuration is needed. This image is perfect for (automated) testing and development.
The MySQL database is accessible from the host.
Run WordPress
docker run --name my-wordpress -p 80:80 -d kaihofstetter/wordpress-cli
Access WordPress
http://localhost
Log in to WordPress
http://localhost/wp-login.php
Username: 'admin_user'
Password: 'secret'
If you don't want to use the default port 80 on the host to access WordPress, besides changing the Docker port mapping (e.g. '...-p 8080:80...'), you also need to change the configured WordPress site URL by setting the WP_URL environment variable (e.g. '...WP_URL="localhost:8080"...').
WordPress needs to know the site URL used by the host, because WordPress redirects to the site URL and uses links to the site URL.
Run WordPress
docker run --name my-wordpress -p 8080:80 -e WP_URL="localhost:8080" -d kaihofstetter/wordpress-cli
Access WordPress
http://localhost:8080
Run WordPress with mapped MySQL port 3306:
docker run --name my-wordpress -p 80:80 -p 3306:3306 -d kaihofstetter/wordpress-cli
The MySQL database is accessible via port 3306, user: WordPress and password: secret.
The included WordPress command line interpreter (WP CLI) can be executed via docker exec:
docker exec -i -t my-wordpress sudo -E -u www-data wp --path="/var/www/html" ...
For example:
docker exec -i -t my-wordpress sudo -E -u www-data wp --path="/var/www/html" core version
For more information about WP CLI commands : http://wp-cli.org/commands/
You can use the following environment variables to configure MySQL and WordPress
Content type
Image
Digest
sha256:a43449a06…
Size
147.7 MB
Last updated
over 8 years ago
docker pull kaihofstetter/wordpress-cli