Introducing our new CEO Don Johnson - Read More

bitnami/wordpress

Verified Publisher

By VMware

Updated 42 minutes ago

Bitnami container image for WordPress

Image
Content Management System
263

100M+

Bitnami package for WordPress

What is WordPress?

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.

Overview of WordPress

TL;DR

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.

Why use Bitnami Images?

  • Bitnami closely tracks upstream source changes and promptly publishes new versions of this image using our automated systems.
  • With Bitnami images the latest bug fixes and features are available as soon as possible.
  • Bitnami containers, virtual machines and cloud images use the same components and configuration approach - making it easy to switch between formats based on your project needs.
  • All our images are based on minideb -a minimalist Debian based container image that gives you a small base container image and the familiarity of a leading Linux distribution- or scratch -an explicitly empty image-.
  • All Bitnami images available in Docker Hub are signed with Notation. Check this post to know how to verify the integrity of the images.
  • Bitnami container images are released on a regular basis with the latest distribution packages available.

Looking to use WordPress in production? Try VMware Tanzu Application Catalog, the commercial edition of the Bitnami catalog.

How to deploy WordPress in Kubernetes?

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.

Why use a non-root container?

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.

Only latest stable branch maintained in the free Bitnami catalog

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.

Supported tags and respective Dockerfile links

Learn 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.

Get this image

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 .

How to use this image

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.

Using the Docker Command Line

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/

Run the application using Docker Compose
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.

Persisting your application

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.

Mount host directories as data volumes with Docker Compose

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.

Mount host directories as data volumes using the Docker command line

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.

Configuration

Environment variables

Customizable environment variables

NameDescriptionDefault Value
WORDPRESS_DATA_TO_PERSISTFiles to persist relative to the WordPress installation directory. To provide multiple values, separate them with a whitespace.wp-config.php wp-content
WORDPRESS_ENABLE_HTTPSWhether to enable HTTPS for WordPress by default.no
WORDPRESS_BLOG_NAMEWordPress blog name."User's blog"
WORDPRESS_SCHEMEScheme to generate application URLs. Deprecated by WORDPRESS_ENABLE_HTTPS.http
WORDPRESS_HTACCESS_OVERRIDE_NONESet the Apache AllowOverride variable to None. All the default directives will be loaded from /opt/bitnami/wordpress/wordpress-htaccess.conf.yes
WORDPRESS_ENABLE_HTACCESS_PERSISTENCEPersist 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_PERMISSIONSForce 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_PREFIXTable prefix to use in WordPress.wp_
WORDPRESS_PLUGINSList 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_ARGSExtra flags to append to the WordPress 'wp core install' command call.nil
WORDPRESS_EXTRA_CLI_ARGSExtra flags to append to all WP-CLI command calls.nil
WORDPRESS_EXTRA_WP_CONFIG_CONTENTExtra configuration to append to wp-config.php during install.nil
WORDPRESS_SKIP_BOOTSTRAPWhether to perform initial bootstrapping for the application.no
WORDPRESS_AUTO_UPDATE_LEVELLevel of auto-updates to allow for the WordPress core installation. Valid values: major, minor, none.none
WORDPRESS_AUTH_KEYValue of the AUTH_KEYnil
WORDPRESS_SECURE_AUTH_KEYValue of the SECURE_AUTH_KEYnil
WORDPRESS_LOGGED_IN_KEYValue of the LOGGED_IN_KEYnil
WORDPRESS_NONCE_KEYValue of the NONCE_KEYnil
WORDPRESS_AUTH_SALTValue of the AUTH_SALTnil
WORDPRESS_SECURE_AUTH_SALTValue of the SECURE_AUTH_SALTnil
WORDPRESS_LOGGED_IN_SALTValue of the LOGGED_IN_SALTnil
WORDPRESS_NONCE_SALTValue of the NONCE_SALTnil
WORDPRESS_ENABLE_REVERSE_PROXYEnable WordPress support for reverse proxy headersno
WORDPRESS_ENABLE_XML_RPCEnable the WordPress XML-RPC endpointno
WORDPRESS_USERNAMEWordPress user name.user
WORDPRESS_PASSWORDWordPress user password.bitnami
WORDPRESS_EMAILWordPress user e-mail address.user@example.com
WORDPRESS_FIRST_NAMEWordPress user first name.UserName
WORDPRESS_LAST_NAMEWordPress user last name.LastName
WORDPRESS_ENABLE_MULTISITEEnable WordPress Multisite configuration.no
WORDPRESS_MULTISITE_NETWORK_TYPEWordPress Multisite network type to enable. Valid values: subfolder, subdirectory, subdomain.subdomain
WORDPRESS_MULTISITE_EXTERNAL_HTTP_PORT_NUMBERExternal HTTP port for WordPress Multisite.80
WORDPRESS_MULTISITE_EXTERNAL_HTTPS_PORT_NUMBERExternal HTTPS port for WordPress Multisite.443
WORDPRESS_MULTISITE_HOSTWordPress hostname/address. Only used for Multisite installations.nil
WORDPRESS_MULTISITE_ENABLE_NIP_IO_REDIRECTIONWhether 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_MAXKMaximum upload file size allowed for WordPress Multisite uploads, in kilobytes.81920
WORDPRESS_SMTP_HOSTWordPress SMTP server host.nil
WORDPRESS_SMTP_PORT_NUMBERWordPress SMTP server port number.nil
WORDPRESS_SMTP_USERWordPress SMTP server user.nil
WORDPRESS_SMTP_FROM_EMAILWordPress 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

Docker Pull Command

docker pull bitnami/wordpress
Bitnami