bitnami/wordpress
Bitnami container image for WordPress
100M+
WordPress is the world's most popular blogging and content management platform. Powerful yet simple, everyone from students to global corporations use it to build beautiful, functional websites.
docker run --name wordpress bitnami/wordpress:latest
Warning: This quick setup is only intended for development environments. You are encouraged to change the insecure default credentials and check out the available configuration options in the Environment Variables section for a more secure deployment.
Looking to use WordPress in production? Try VMware Tanzu Application Catalog, the commercial edition of the Bitnami catalog.
Deploying Bitnami applications as Helm Charts is the easiest way to get started with our applications on Kubernetes. Read more about the installation in the Bitnami WordPress Chart GitHub repository.
Bitnami containers can be used with Kubeapps for deployment and management of Helm Charts in clusters.
Non-root container images add an extra layer of security and are generally recommended for production environments. However, because they run as a non-root user, privileged tasks are typically off-limits. Learn more about non-root containers in our docs.
Starting December 10th 2024, only the latest stable branch of any container will receive updates in the free Bitnami catalog. To access up-to-date releases for all upstream-supported branches, consider upgrading to Bitnami Premium. Previous versions already released will not be deleted. They are still available to pull from DockerHub.
Please check the Bitnami Premium page in our partner Arrow Electronics for more information.
Dockerfile
linksLearn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags in our documentation page.
You can see the equivalence between the different tags by taking a look at the tags-info.yaml
file present in the branch folder, i.e bitnami/ASSET/BRANCH/DISTRO/tags-info.yaml
.
Subscribe to project updates by watching the bitnami/containers GitHub repo.
The recommended way to get the Bitnami WordPress Docker Image is to pull the prebuilt image from the Docker Hub Registry.
docker pull bitnami/wordpress:latest
To use a specific version, you can pull a versioned tag. You can view the list of available versions in the Docker Hub Registry.
docker pull bitnami/wordpress:[TAG]
If you wish, you can also build the image yourself by cloning the repository, changing to the directory containing the Dockerfile and executing the docker build
command. Remember to replace the APP
, VERSION
and OPERATING-SYSTEM
path placeholders in the example command below with the correct values.
git clone https://github.com/bitnami/containers.git
cd bitnami/APP/VERSION/OPERATING-SYSTEM
docker build -t bitnami/APP:latest .
WordPress requires access to a MySQL or MariaDB database to store information. We'll use the Bitnami Docker Image for MariaDB for the database requirements.
Step 1: Create a network
docker network create wordpress-network
Step 2: Create a volume for MariaDB persistence and create a MariaDB container
$ docker volume create --name mariadb_data
docker run -d --name mariadb \
--env ALLOW_EMPTY_PASSWORD=yes \
--env MARIADB_USER=bn_wordpress \
--env MARIADB_PASSWORD=bitnami \
--env MARIADB_DATABASE=bitnami_wordpress \
--network wordpress-network \
--volume mariadb_data:/bitnami/mariadb \
bitnami/mariadb:latest
Step 3: Create volumes for WordPress persistence and launch the container
$ docker volume create --name wordpress_data
docker run -d --name wordpress \
-p 8080:8080 -p 8443:8443 \
--env ALLOW_EMPTY_PASSWORD=yes \
--env WORDPRESS_DATABASE_USER=bn_wordpress \
--env WORDPRESS_DATABASE_PASSWORD=bitnami \
--env WORDPRESS_DATABASE_NAME=bitnami_wordpress \
--network wordpress-network \
--volume wordpress_data:/bitnami/wordpress \
bitnami/wordpress:latest
Access your application at http://your-ip/
curl -sSL https://raw.githubusercontent.com/bitnami/containers/main/bitnami/wordpress/docker-compose.yml > docker-compose.yml
docker-compose up -d
Please be aware this file has not undergone internal testing. Consequently, we advise its use exclusively for development or testing purposes. For production-ready deployments, we highly recommend utilizing its associated Bitnami Helm chart.
If you detect any issue in the docker-compose.yaml
file, feel free to report it or contribute with a fix by following our Contributing Guidelines.
If you remove the container all your data will be lost, and the next time you run the image the database will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed.
For persistence you should mount a directory at the /bitnami/wordpress
path. If the mounted directory is empty, it will be initialized on the first run. Additionally you should mount a volume for persistence of the MariaDB data.
The above examples define the Docker volumes named mariadb_data
and wordpress_data
. The WordPress application state will persist as long as volumes are not removed.
To avoid inadvertent removal of volumes, you can mount host directories as data volumes. Alternatively you can make use of volume plugins to host the volume data.
This requires a minor change to the docker-compose.yml
file present in this repository:
mariadb:
...
volumes:
- - 'mariadb_data:/bitnami/mariadb'
+ - /path/to/mariadb-persistence:/bitnami/mariadb
...
wordpress:
...
volumes:
- - 'wordpress_data:/bitnami/wordpress'
+ - /path/to/wordpress-persistence:/bitnami/wordpress
...
-volumes:
- mariadb_data:
- driver: local
- wordpress_data:
- driver: local
NOTE: As this is a non-root container, the mounted files and directories must have the proper permissions for the UID
1001
.
Step 1: Create a network (if it does not exist)
docker network create wordpress-network
Step 2. Create a MariaDB container with host volume
docker run -d --name mariadb \
--env ALLOW_EMPTY_PASSWORD=yes \
--env MARIADB_USER=bn_wordpress \
--env MARIADB_PASSWORD=bitnami \
--env MARIADB_DATABASE=bitnami_wordpress \
--network wordpress-network \
--volume /path/to/mariadb-persistence:/bitnami/mariadb \
bitnami/mariadb:latest
NOTE: As this is a non-root container, the mounted files and directories must have the proper permissions for the UID
1001
.
Step 3. Create the WordPress container with host volumes
docker run -d --name wordpress \
-p 8080:8080 -p 8443:8443 \
--env ALLOW_EMPTY_PASSWORD=yes \
--env WORDPRESS_DATABASE_USER=bn_wordpress \
--env WORDPRESS_DATABASE_PASSWORD=bitnami \
--env WORDPRESS_DATABASE_NAME=bitnami_wordpress \
--network wordpress-network \
--volume /path/to/wordpress-persistence:/bitnami/wordpress \
bitnami/wordpress:latest
NOTE: As this is a non-root container, the mounted files and directories must have the proper permissions for the UID
1001
.
Customizable environment variables
Name | Description | Default Value |
---|---|---|
WORDPRESS_DATA_TO_PERSIST | Files to persist relative to the WordPress installation directory. To provide multiple values, separate them with a whitespace. | wp-config.php wp-content |
WORDPRESS_ENABLE_HTTPS | Whether to enable HTTPS for WordPress by default. | no |
WORDPRESS_BLOG_NAME | WordPress blog name. | "User's blog" |
WORDPRESS_SCHEME | Scheme to generate application URLs. Deprecated by WORDPRESS_ENABLE_HTTPS . | http |
WORDPRESS_HTACCESS_OVERRIDE_NONE | Set the Apache AllowOverride variable to None . All the default directives will be loaded from /opt/bitnami/wordpress/wordpress-htaccess.conf . | yes |
WORDPRESS_ENABLE_HTACCESS_PERSISTENCE | Persist the custom changes of the htaccess. It depends on the value of WORDPRESS_HTACCESS_OVERRIDE_NONE , when yes it will persist /opt/bitnami/wordpress/wordpress-htaccess.conf if no it will persist /opt/bitnami/wordpress/.htaccess . | no |
WORDPRESS_RESET_DATA_PERMISSIONS | Force resetting ownership/permissions on persisted data when initializing, otherwise it assumes the ownership/permissions are correct. Ignored when running as non-root. | no |
WORDPRESS_TABLE_PREFIX | Table prefix to use in WordPress. | wp_ |
WORDPRESS_PLUGINS | List of WordPress plugins to install and activate, separated via commas. Can also be set to all to activate all currently installed plugins, or none to skip. | none |
WORDPRESS_EXTRA_INSTALL_ARGS | Extra flags to append to the WordPress 'wp core install' command call. | nil |
WORDPRESS_EXTRA_CLI_ARGS | Extra flags to append to all WP-CLI command calls. | nil |
WORDPRESS_EXTRA_WP_CONFIG_CONTENT | Extra configuration to append to wp-config.php during install. | nil |
WORDPRESS_SKIP_BOOTSTRAP | Whether to perform initial bootstrapping for the application. | no |
WORDPRESS_AUTO_UPDATE_LEVEL | Level of auto-updates to allow for the WordPress core installation. Valid values: major , minor , none . | none |
WORDPRESS_AUTH_KEY | Value of the AUTH_KEY | nil |
WORDPRESS_SECURE_AUTH_KEY | Value of the SECURE_AUTH_KEY | nil |
WORDPRESS_LOGGED_IN_KEY | Value of the LOGGED_IN_KEY | nil |
WORDPRESS_NONCE_KEY | Value of the NONCE_KEY | nil |
WORDPRESS_AUTH_SALT | Value of the AUTH_SALT | nil |
WORDPRESS_SECURE_AUTH_SALT | Value of the SECURE_AUTH_SALT | nil |
WORDPRESS_LOGGED_IN_SALT | Value of the LOGGED_IN_SALT | nil |
WORDPRESS_NONCE_SALT | Value of the NONCE_SALT | nil |
WORDPRESS_ENABLE_REVERSE_PROXY | Enable WordPress support for reverse proxy headers | no |
WORDPRESS_ENABLE_XML_RPC | Enable the WordPress XML-RPC endpoint | no |
WORDPRESS_USERNAME | WordPress user name. | user |
WORDPRESS_PASSWORD | WordPress user password. | bitnami |
WORDPRESS_EMAIL | WordPress user e-mail address. | user@example.com |
WORDPRESS_FIRST_NAME | WordPress user first name. | UserName |
WORDPRESS_LAST_NAME | WordPress user last name. | LastName |
WORDPRESS_ENABLE_MULTISITE | Enable WordPress Multisite configuration. | no |
WORDPRESS_MULTISITE_NETWORK_TYPE | WordPress Multisite network type to enable. Valid values: subfolder , subdirectory , subdomain . | subdomain |
WORDPRESS_MULTISITE_EXTERNAL_HTTP_PORT_NUMBER | External HTTP port for WordPress Multisite. | 80 |
WORDPRESS_MULTISITE_EXTERNAL_HTTPS_PORT_NUMBER | External HTTPS port for WordPress Multisite. | 443 |
WORDPRESS_MULTISITE_HOST | WordPress hostname/address. Only used for Multisite installations. | nil |
WORDPRESS_MULTISITE_ENABLE_NIP_IO_REDIRECTION | Whether to enable IP address redirection to nip.io wildcard DNS when enabling WordPress Multisite. This is only supported when running on an IP address with subdomain network type. | no |
WORDPRESS_MULTISITE_FILEUPLOAD_MAXK | Maximum upload file size allowed for WordPress Multisite uploads, in kilobytes. | 81920 |
WORDPRESS_SMTP_HOST | WordPress SMTP server host. | nil |
WORDPRESS_SMTP_PORT_NUMBER | WordPress SMTP server port number. | nil |
WORDPRESS_SMTP_USER | WordPress SMTP server user. | nil |
WORDPRESS_SMTP_FROM_EMAIL | WordPress SMTP from email. | ${WORDPRESS_SMTP_USER} |
`W |
Note: the README for this container is longer than the DockerHub length limit of 25000, so it has been trimmed. The full README can be found at https://github.com/bitnami/containers/blob/main/bitnami/wordpress/README.md