Install WordPress using Docker
Using Images Provided by Bitnami #
Since the WordPress deployment package described here is no longer available, I am trying the Docker image still provided by Bitnami. Don’t ask why—it’s just a habit.
Install Docker Engine and Docker Compose first. Refer to the official Docker manual.
For the standalone docker-compose command:
| |
To upgrade Docker Compose, run the commands above again to replace the executable.
Then run the Docker image as instructed in the Bitnami documentation:
| |
That is mostly it. Edit docker-compose.yml—especially its environment variables—to initialize your site properly.
The configuration also starts a MariaDB image; refer to its documentation.
Some useful commands:
| |
Official WordPress Image #
Then I tried the official WordPress image. The process is almost the same; refer to the image documentation. I find it easy to use Docker Compose to start the container.
Increasing the Upload Limit #
When I tried to upload photos to the media library, an error said that the maximum upload size was 2 MB. Come on, it was already 2023—what image quality can you get in 2 MB?
First, enter the container:
| |
There are two ways to solve it:
- Edit
/var/www/html/.htaccessand add:
| |
- Find and edit
php.ini, then add:
| |
I created a php.ini file under /usr/local/etc/php/conf.d/. Your path may differ, although it should be the same when using the official WordPress image.