How to update WordPress in Docker

Add RSS feed to Reader and sync to Readwise.

This post applies to when you’ve installed your WordPress site on your local machine using Docker for development. Updating WordPress from with its admin panel does not persist the update if you restart the Docker container. To keep it updated:

  • Backup the databases & files
  • Stop the docker container
    • It is not required to run docker compose down, you could just stop in Docker Dashboard GUI or run docker compose stop.
  • Ensure that the site’s compose.yaml‘s WordPress service section is set to image: wordpress:latest.
  • Navigate to the site’s folder and run docker compose pull
  • Start the docker container from the GUI or by running the docker compose start command
  • Login to your site’s wp-admin and update WordPress again using the option in the WordPress Dashboard
  • The site will now remain updated even if you restart your Docker container

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *