Title: dockerized wordpress problem
Last modified: January 31, 2024

---

# dockerized wordpress problem

 *  [khrob](https://wordpress.org/support/users/khrob/)
 * (@khrob)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/dockerized-wordpress-problem/)
 * Good morning,
   I work at a small development company and we would like to start
   dockerizing our applications.
 * Among other things, we are trying to dockerize wordpress for a client’s website.
 * We have used the following docker-compose file:
 *     ```wp-block-code
       version: '3'
       services:
         cosde_wp:
           image: wordpress:6.4.1
           container_name: cosde_wp
           ports:
             - 82:80
           restart: unless-stopped
           environment:
             - WORDPRESS_DB_HOST=ip_db:3306
             - WORDPRESS_DB_USER=user
             - WORDPRESS_DB_PASSWORD=password
             - WORDPRESS_DB_NAME=db_name
           volumes:
             - ./wp-data:/var/www/html:rw
       ```
   
 * The server running Docker is a Debian 11 Bullseye VM.
   The database is hosted 
   on a separate server.
 * Everything is pretty basic; the container starts, we did the initial settings
   and created the WordPress user for the client’s external designer who will be
   creating the actual website.
 * The designer installed the Elementor plugin, and this is where the problems begin.
   Every time a page is created or modified, the error “The preview cannot be loaded”
   appears. I have done some tests and I can create pages and upload images, but
   it seems that the pages have no formatting. Even after downloading and applying
   a theme, the pages appear to be unformatted.
 * If it may be helpful, these are the permissions of the wp-data directory:
   `drwxr-
   xr-x 5 www-data www-data 4096 Jan 31 10:32 wp-data`
 * Can someone kindly tell me if there are any specific settings needed to make 
   dockerized WordPress work correctly? Is it necessary to apply specific privileges
   to the folders inside the container? Or is what happens an error of the Elementor
   plugin?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdockerized-wordpress-problem%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [luk4](https://wordpress.org/support/users/luk4/)
 * (@luk4)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/dockerized-wordpress-problem/#post-17388351)
 * Hi [@michel225](https://wordpress.org/support/users/michel225/)
 * Be sure WordPress is able to [loopback to itself](https://developer.wordpress.org/advanced-administration/wordpress/loopback/).
   From my experience, that’s usually the main issue on Docker environements with
   a reverse proxy.
 * To check this, go to Tools › [Site Health](https://wordpress.org/documentation/article/site-health-screen/).
   You might be warned about other relevant issues as well there.
 * Also, it looks like the [REST API endpoint](https://developer.wordpress.org/rest-api/)
   of the website is available at `/index.php?rest_route=/` which is unusual since
   it’s usually `/wp-json/`. See: [https://developer.wordpress.org/rest-api/key-concepts/#routes-endpoints](https://developer.wordpress.org/rest-api/key-concepts/#routes-endpoints)
 * Maybe Elementor is looking for it at the usual endpoint, idk. Try to go to Settings›
   Permalinks, choose a pretty permalink structure and hit _Save_. See: [https://wordpress.org/documentation/article/settings-permalinks-screen/](https://wordpress.org/documentation/article/settings-permalinks-screen/)
 *  Thread Starter [khrob](https://wordpress.org/support/users/khrob/)
 * (@khrob)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/dockerized-wordpress-problem/#post-17391080)
 * Thank you for your response, I’ve checked, but in status > site health, everything
   seems normal to me.
 * Site Health
 * Good
 * From the Firefox Web Developer tool, we discovered that the website is attempting
   to load some content using HTTP instead of HTTPS. We’re not sure why. Here are
   the alerts we’re receiving: “Loading failed for the <script> with source ‘[http://&#8230](http://&#8230);'”
   and “Transfer: Mixed Block.”
 *  [luk4](https://wordpress.org/support/users/luk4/)
 * (@luk4)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/dockerized-wordpress-problem/#post-17391947)
 * Try to check all the URLs of the website stored in the database are using the
   HTTPS scheme then. You can use a plugin such as [Better Search Replace](https://wordpress.org/plugins/better-search-replace/).
 * Edit: There are also a couple things to try related to your original error. See
   [https://elementor.com/help/how-to-fix-the-preview-could-not-be-loaded-error/](https://elementor.com/help/how-to-fix-the-preview-could-not-be-loaded-error/)
   In particular and as previously mentionned, enable the pretty permalinks and 
   be sure to hit the _Save_ button to overwrite the `.htaccess`.
    -  This reply was modified 2 years, 4 months ago by [luk4](https://wordpress.org/support/users/luk4/).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘dockerized wordpress problem’ is closed to new replies.

## Tags

 * [docker](https://wordpress.org/support/topic-tag/docker/)
 * [WordPress](https://wordpress.org/support/topic-tag/wordpress/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [luk4](https://wordpress.org/support/users/luk4/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/dockerized-wordpress-problem/#post-17391947)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
