{"id":2264,"date":"2025-01-15T12:30:00","date_gmt":"2025-01-15T18:30:00","guid":{"rendered":"https:\/\/www.linuxcloudvps.com\/blog\/?p=2264"},"modified":"2024-12-09T03:31:27","modified_gmt":"2024-12-09T09:31:27","slug":"how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/","title":{"rendered":"How to Install WordPress with Docker Compose on Ubuntu 24.04"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">WordPress is an open-source content management system written in PHP that offers various features such as plugins, and fully customizable themes. You can install WordPress with LAMP, LEMP stack, or Docker container to ensure it functions properly. A Docker container is a set of platforms as a service that uses OS-level virtualization to deliver software in packages called containers. So, in this blog post, we will install WordPress inside a Docker container with WordPress Docker Image isolated from the other container for the MySQL database. We call these multi-container applications on the server and use the Docker Compose tool to achieve this setup, which we will explain later.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Installing WordPress with Docker Composer on Ubuntu 24.04 may take up to 1 hour. Let&#8217;s get to it!<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <a href=\"https:\/\/www.linuxcloudvps.com\/cloud-vps.html\" target=\"_blank\" rel=\"noreferrer noopener\">server running Ubuntu 24.04 <\/a>or any Linux OS<\/li>\n\n\n\n<li>User privileges: root or non-root user with sudo privileges<\/li>\n\n\n\n<li>Domain name with A record pointed to the server IP address<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1. Update the System<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We assume that you have a fresh Ubuntu 24.04 OS. Before we start with installing any dependencies we need to update the system packages. To do that execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt update -y &amp;&amp; sudo apt upgrade -y<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2. Install Docker<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are a couple of steps for us can install the Docker and start its service. Firstly, we need to install the Docker dependencies:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install software-properties-common apt-transport-https ca-certificates -y<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Secondly, we need to add the Docker GPG key:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo gpg --dearmor -o \/usr\/share\/keyrings\/docker-archive-keyring.gpg<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Thirdly, after the key is added we need to add the repo:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">echo \"deb [arch=amd64 signed-by=\/usr\/share\/keyrings\/docker-archive-keyring.gpg] https:\/\/download.docker.com\/linux\/ubuntu $(lsb_release -cs) stable\" | sudo tee \/etc\/apt\/sources.list.d\/docker.list &gt; \/dev\/null<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once the repo is added, update the system and install Docker:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> \nsudo apt update -y\n\nsudo apt install docker-ce docker-ce-cli containerd.io -y\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After the installation start and enable the Docker service:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl start docker &amp;&amp; sudo systemctl enable docker<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To check the status of the Docker service execute the command below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl status docker<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you did everything correctly, you should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# sudo systemctl status docker\n\u25cf docker.service - Docker Application Container Engine\n     Loaded: loaded (\/usr\/lib\/systemd\/system\/docker.service; enabled; preset: enabled)\n     Active: active (running) since Fri 2024-12-06 18:43:10 CST; 5min ago\nTriggeredBy: \u25cf docker.socket\n       Docs: https:\/\/docs.docker.com\n   Main PID: 9781 (dockerd)\n      Tasks: 9\n     Memory: 20.4M (peak: 21.1M)\n        CPU: 889ms\n     CGroup: \/system.slice\/docker.service\n             \u2514\u25009781 \/usr\/bin\/dockerd -H fd:\/\/ --containerd=\/run\/containerd\/containerd.sock\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3. Install Docker Compose<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Docker Composer is a tool for managing multi-container Docker applications. We need this feature since this installation will be with two different containers. One is for WordPress application using the WordPress Docker Image and the other is for MySQL database using the MySQL docker image.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To install Docker Compose execute the command below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo curl -L \"https:\/\/github.com\/docker\/compose\/releases\/download\/v2.24.7\/docker-compose-$(uname -s)-$(uname -m)\" -o \/usr\/local\/bin\/docker-compose<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, grant permissions to all users for the docker-compose to be executable:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo chmod +x \/usr\/local\/bin\/docker-compose<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If everything is OK, check the docker-compose version with the command below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker-compose --version<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should get output similar to this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# docker-compose --version\nDocker Compose version v2.24.7\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4. Install WordPress with Docker Compose<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Firstly, we need to <strong>create WordPress directory<\/strong>, and navigate to that directory. In that directory, we will place all docker files.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/opt\n\nmkdir wordpress\/\n\ncd wordpress\/\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once the wordpress directory is created, inside it create the following directory and file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir nginx-conf\n\ntouch nginx-conf\/nginx.conf\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open the <strong>nginx.conf<\/strong> file with your favorite editor and paste the following lines of code:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n        listen 80;\n        listen [::]:80;\n\n        server_name docker.rosehostingtest.com;\n\n        index index.php index.html index.htm;\n\n        root \/var\/www\/html;\n\n        location ~ \/.well-known\/acme-challenge {\n                allow all;\n                root \/var\/www\/html;\n        }\n\n        location \/ {\n                try_files $uri $uri\/ \/index.php$is_args$args;\n        }\n\n        location ~ \\.php$ {\n                try_files $uri =404;\n                fastcgi_split_path_info ^(.+\\.php)(\/.+)$;\n                fastcgi_pass wordpress:9000;\n                fastcgi_index index.php;\n                include fastcgi_params;\n                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n                fastcgi_param PATH_INFO $fastcgi_path_info;\n        }\n\n        location ~ \/\\.ht {\n                deny all;\n        }\n\n        location = \/favicon.ico {\n                log_not_found off; access_log off;\n        }\n        location = \/robots.txt {\n                log_not_found off; access_log off; allow all;\n        }\n        location ~* \\.(css|gif|ico|jpeg|jpg|js|png)$ {\n                expires max;\n                log_not_found off;\n        }\n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Do not forget to change our domain <strong>docker.rosehostingtest.com<\/strong> in the <strong>server_name<\/strong> directive with your domain name.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next is to create a Docker Compose YAML file that will contain <strong>WordPress docker image<\/strong>, <strong>MySQL docker image<\/strong>, and <strong>Webserver Docker Image<\/strong>. To do that execute the command below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">touch docker-compose.yml<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open the file with yout favorite editor and paste the following lines of code:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">version: '3'<br><br>services:<br>  db:<br>    image: mysql:8.0<br>    container_name: db<br>    restart: unless-stopped<br>    environment:<br>      - MYSQL_ROOT_PASSWORD=MySQLRootPassword<br>      - MYSQL_USER=wpuser<br>      - MYSQL_PASSWORD=YourStrongPasswordHere<br>      - MYSQL_DATABASE=wpdb<br>    volumes:<br>      - dbdata:\/var\/lib\/mysql<br>    command: '--default-authentication-plugin=mysql_native_password'<br>    networks:<br>      - app-network<br><br>  wordpress:<br>    depends_on:<br>      - db<br>    image: wordpress:php8.3-fpm-alpine<br>    container_name: wordpress<br>    restart: unless-stopped<br>    environment:<br>      - WORDPRESS_DB_HOST=db:3306<br>      - WORDPRESS_DB_USER=wpuser<br>      - WORDPRESS_DB_PASSWORD=YourStrongPasswordHere<br>      - WORDPRESS_DB_NAME=wpdb<br>    volumes:<br>      - wordpress:\/var\/www\/html<br>    networks:<br>      - app-network<br>  webserver:<br>    depends_on:<br>      - wordpress<br>    image: nginx:1.15.12-alpine<br>    container_name: webserver<br>    restart: unless-stopped<br>    ports:<br>      - \"80:80\"<br>    volumes:<br>      - wordpress:\/var\/www\/html<br>      - .\/nginx-conf:\/etc\/nginx\/conf.d<br>    networks:<br>      - app-network<br><br>volumes:<br>  wordpress:<br>  dbdata:<br><br>networks:<br>  app-network:<br>    driver: bridge<br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file and close it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next step is to start the service with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo docker-compose up -d<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock1.png\"><img decoding=\"async\" width=\"970\" height=\"772\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock1-970x772.png\" alt=\"\" class=\"wp-image-2265\" srcset=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock1-970x772.png 970w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock1-377x300.png 377w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock1-768x611.png 768w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock1.png 1052w\" sizes=\"(max-width: 970px) 100vw, 970px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once, the images and volumes are created you should receive the following output:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock2.png\"><img decoding=\"async\" width=\"970\" height=\"148\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock2-970x148.png\" alt=\"\" class=\"wp-image-2266\" srcset=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock2-970x148.png 970w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock2-470x71.png 470w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock2-768x117.png 768w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock2.png 1052w\" sizes=\"(max-width: 970px) 100vw, 970px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To check the started containers with more info you can execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker ps<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should receive the followiong output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:\/opt\/wordpress# docker ps\nCONTAINER ID   IMAGE                         COMMAND                  CREATED         STATUS         PORTS                                                                      NAMES\n2ba8f3b94cdf   nginx:1.15.12-alpine          \"nginx -g 'daemon of\u2026\"   4 minutes ago   Up 4 minutes   0.0.0.0:80-&gt;80\/tcp, :::80-&gt;80\/tcp, 0.0.0.0:443-&gt;443\/tcp, :::443-&gt;443\/tcp   webserver\ned8416fecb34   wordpress:php8.3-fpm-alpine   \"docker-entrypoint.s\u2026\"   4 minutes ago   Up 4 minutes   9000\/tcp                                                                   wordpress\n5148e233d9ed   mysql:8.0                     \"docker-entrypoint.s\u2026\"   4 minutes ago   Up 4 minutes   3306\/tcp, 33060\/tcp\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5. Finish the WordPress Installation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To finish the WordPress installation access your domain in the browser you set in Step. 4 In our blog post we need to access the <strong>http:\/\/docker.rosehostingtest.com<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock3.png\"><img decoding=\"async\" width=\"812\" height=\"909\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock3.png\" alt=\"\" class=\"wp-image-2267\" srcset=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock3.png 812w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock3-268x300.png 268w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock3-768x860.png 768w\" sizes=\"(max-width: 812px) 100vw, 812px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Select your language anc click on the <strong>Continue<\/strong>. On the next window, create WordPress credentials for future use.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock4.png\"><img decoding=\"async\" width=\"812\" height=\"909\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock4.png\" alt=\"\" class=\"wp-image-2268\" srcset=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock4.png 812w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock4-268x300.png 268w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock4-768x860.png 768w\" sizes=\"(max-width: 812px) 100vw, 812px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once done, click on <strong>Install WordPress<\/strong>. Once the installation is complete you will receive the following output:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock5.png\"><img decoding=\"async\" width=\"812\" height=\"439\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock5.png\" alt=\"\" class=\"wp-image-2269\" srcset=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock5.png 812w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock5-470x254.png 470w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock5-768x415.png 768w\" sizes=\"(max-width: 812px) 100vw, 812px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Click on <strong>Log In<\/strong> and fill the credentials you set before:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock6.png\"><img decoding=\"async\" width=\"758\" height=\"506\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock6.png\" alt=\"\" class=\"wp-image-2270\" srcset=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock6.png 758w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock6-449x300.png 449w\" sizes=\"(max-width: 758px) 100vw, 758px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once logged in you will be redirected to the WordPress admin dashboard:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock7.png\"><img decoding=\"async\" width=\"970\" height=\"457\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock7-970x457.png\" alt=\"\" class=\"wp-image-2271\" srcset=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock7-970x457.png 970w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock7-470x222.png 470w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock7-768x362.png 768w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock7-1536x724.png 1536w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock7.png 1845w\" sizes=\"(max-width: 970px) 100vw, 970px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6. Install SSL certificate with Certbot Image<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This step is optional, since the website may work without an SSL certificate. But if you want to access it securely via HTTPS protocol, follow the steps below.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We need to make changes into the <strong>docker-compose.yml<\/strong> and <strong>nginx-conf\/nginx.conf<\/strong> files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Into the <strong>docker-compose.yml<\/strong> we need to add a new block for the certbot image, assign volume for that image, and modify the webserver block. To that open the docker-compose.yml file add the <strong>&#8211; certbot-etc:\/etc\/letsencrypt<\/strong> in the webserver volumes list and the volumes block. It should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">  webserver:<br>    depends_on:<br>      - wordpress<br>    image: nginx:1.15.12-alpine<br>    container_name: webserver<br>    restart: unless-stopped<br>    ports:<br>      - \"80:80\"<br>    volumes:<br>      - wordpress:\/var\/www\/html<br>      - .\/nginx-conf:\/etc\/nginx\/conf.d<br>   <strong>- certbot-etc:\/etc\/letsencrypt<\/strong><br>    networks:<br>      - app-network<br><br> <strong> certbot:<br>    depends_on:<br>      - webserver<br>    image: certbot\/certbot<br>    container_name: certbot<br>    volumes:<br>      - certbot-etc:\/etc\/letsencrypt<br>      - wordpress:\/var\/www\/html<br>    command: certonly --webroot --webroot-path=\/var\/www\/html --email admin@docker.rosehostingtest.com --agree-tos --no-eff-email --dry-run -d docker.rosehostingtest.com<\/strong><br><br>volumes:<br> <strong>certbot-etc:<\/strong><br>  wordpress:<br>  dbdata:<br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file, and close it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since the changes are made in the webserver (wordpress docker image) and a new certbot block is added we need to reload the webserver and start the newly added certbot image. To do that we can execute this simple command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker-compose up -d --force-recreate --no-deps webserver certbot<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock8.png\"><img decoding=\"async\" width=\"970\" height=\"234\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock8-970x234.png\" alt=\"\" class=\"wp-image-2272\" srcset=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock8-970x234.png 970w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock8-470x114.png 470w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock8-768x186.png 768w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock8-1536x371.png 1536w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2024\/12\/dock8.png 1845w\" sizes=\"(max-width: 970px) 100vw, 970px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once the webserver container is recreated and the certbot container is created, we need to check the log of the newly created container:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker logs certbot<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the container is up and runnnig and the &#8211;dry-run is successfull (usually the process may take up to 1 minute) you should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:\/opt\/wordpress# docker logs certbot\nSaving debug log to \/var\/log\/letsencrypt\/letsencrypt.log\nSimulating a certificate request for docker.rosehostingtest.com\nThe dry run was successful.\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we can remove the <strong>&#8211;dry-run<\/strong> option from the certbot image to generate an SSL certificate for our domain. The line in the certbot image should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>command: certonly --webroot --webroot-path=\/var\/www\/html --email admin@docker.rosehostingtest.com --agree-tos --no-eff-email -d docker.rosehostingtest.com<\/strong><br><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file, close it and recreate the certbot image.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker-compose up -d --force-recreate --no-deps certbot<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the logs of the certbot image again:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker logs certbot<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If everything is OK, with the SSL certificate you should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:\/opt\/wordpress# docker logs certbot\nSaving debug log to \/var\/log\/letsencrypt\/letsencrypt.log\nAccount registered.\nRequesting a certificate for docker.rosehostingtest.com\nroot@host:\/opt\/wordpress# docker logs certbot\nSaving debug log to \/var\/log\/letsencrypt\/letsencrypt.log\nAccount registered.\nRequesting a certificate for docker.rosehostingtest.com\n\nSuccessfully received certificate.\nCertificate is saved at: \/etc\/letsencrypt\/live\/docker.rosehostingtest.com\/fullchain.pem\nKey is saved at:         \/etc\/letsencrypt\/live\/docker.rosehostingtest.com\/privkey.pem\nThis certificate expires on 2025-03-08.\nThese files will be updated when the certificate renews.\nNEXT STEPS:\n- The certificate will need to be renewed before it expires. Certbot can automatically renew the certificate in the background, but you may need to take steps to enable that functionality. See https:\/\/certbot.org\/renewal-setup for instructions.\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nIf you like Certbot, please consider supporting our work by:\n * Donating to ISRG \/ Let's Encrypt:   https:\/\/letsencrypt.org\/donate\n * Donating to EFF:                    https:\/\/eff.org\/donate-le\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This means, that the SSL certificate is generated, and the key along with the certificate is located at:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Certificate is saved at: \/etc\/letsencrypt\/live\/docker.rosehostingtest.com\/fullchain.pem\nKey is saved at:         \/etc\/letsencrypt\/live\/docker.rosehostingtest.com\/privkey.pem\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, we need to make some changes into the <strong>nginx-conf\/nginx.conf<\/strong> file. First execute the following command to get the recommend Nginx security parameter for certbot:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -sSLo nginx-conf\/options-ssl-nginx.conf https:\/\/raw.githubusercontent.com\/certbot\/certbot\/master\/certbot-nginx\/certbot_nginx\/_internal\/tls_configs\/options-ssl-nginx.conf<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next open the nginx-conf\/nginx.conf file to add the server block for port 443 along with the SSL certificate paths. The content should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n        listen 80;\n        listen [::]:80;\n\n        server_name docker.rosehostingtest.com;\n\n        location ~ \/.well-known\/acme-challenge {\n                allow all;\n                root \/var\/www\/html;\n        }\n\n        location \/ {\n                rewrite ^ https:\/\/$host$request_uri? permanent;\n        }\n}\n\nserver {\n        listen 443 ssl http2;\n        listen [::]:443 ssl http2;\n        server_name docker.rosehostingtest.com;\n\n        index index.php index.html index.htm;\n\n        root \/var\/www\/html;\n\n        server_tokens off;\n\n     <strong>ssl_certificate \/etc\/letsencrypt\/live\/docker.rosehostingtest.com\/fullchain.pem;\n        ssl_certificate_key \/etc\/letsencrypt\/live\/docker.rosehostingtest.com\/privkey.pem;\n\n        include \/etc\/nginx\/conf.d\/options-ssl-nginx.conf;\n     <\/strong>\n        add_header X-Frame-Options \"SAMEORIGIN\" always;\n        add_header X-XSS-Protection \"1; mode=block\" always;\n        add_header X-Content-Type-Options \"nosniff\" always;\n        add_header Referrer-Policy \"no-referrer-when-downgrade\" always;\n        add_header Content-Security-Policy \"default-src * data: 'unsafe-eval' 'unsafe-inline'\" always;\n        # add_header Strict-Transport-Security \"max-age=31536000; includeSubDomains; preload\" always;\n        # enable strict transport security only if you understand the implications\n\n        location \/ {\n                try_files $uri $uri\/ \/index.php$is_args$args;\n        }\n\n        location ~ \\.php$ {\n                try_files $uri =404;\n                fastcgi_split_path_info ^(.+\\.php)(\/.+)$;\n                fastcgi_pass wordpress:9000;\n                fastcgi_index index.php;\n                include fastcgi_params;\n                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n                fastcgi_param PATH_INFO $fastcgi_path_info;\n        }\n\n        location ~ \/\\.ht {\n                deny all;\n        }\n\n        location = \/favicon.ico {\n                log_not_found off; access_log off;\n        }\n        location = \/robots.txt {\n                log_not_found off; access_log off; allow all;\n        }\n        location ~* \\.(css|gif|ico|jpeg|jpg|js|png)$ {\n                expires max;\n                log_not_found off;\n        }\n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file and close it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The last is to add the <strong>port 443<\/strong> into the list of ports in the webserver block in the docker-compose.yml file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">  webserver:\n    depends_on:\n      - wordpress\n    image: nginx:1.15.12-alpine\n    container_name: webserver\n    restart: unless-stopped\n    ports:\n      - \"80:80\"\n   <strong>- \"443:443\"<\/strong>\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Since, these changes are for the webserver image, we need to recreate the webserver container with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">docker-compose up -d --force-recreate --no-deps webserver<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, you can access the website securely at <strong>https:\/\/docker.rosehostingtest.com<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Congratulations<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s it. You&#8217;ve successfully learned how to insall WordPress with Docker Compose on Ubuntu 24.04.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you liked this post about installing WordPress with Docker Compose on Ubuntu 24.04, please share it with your friends or leave a comment down below.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress is an open-source content management system written in PHP that offers various features such as plugins, and fully customizable themes. You can install WordPress with LAMP, LEMP stack, or Docker container to ensure it functions properly. A Docker container is a set of platforms as a service that uses OS-level virtualization to deliver software &#8230; <a title=\"How to Install WordPress with Docker Compose on Ubuntu 24.04\" class=\"read-more\" href=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/\" aria-label=\"More on How to Install WordPress with Docker Compose on Ubuntu 24.04\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":2279,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[332],"tags":[287,168,300,37],"class_list":["post-2264","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu-24-04","tag-docker","tag-how-to-install","tag-ubuntu-24-04","tag-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install WordPress with Docker Compose on Ubuntu 24.04 | LinuxCloudVPS Blog<\/title>\n<meta name=\"description\" content=\"Learn how to install WordPress with Docker Compose on Ubuntu 24.04 using our latest easy-to-follow step-by-step guide.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install WordPress with Docker Compose on Ubuntu 24.04 | LinuxCloudVPS Blog\" \/>\n<meta property=\"og:description\" content=\"Learn how to install WordPress with Docker Compose on Ubuntu 24.04 using our latest easy-to-follow step-by-step guide.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxCloudVPS Blog\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/LinuxCloudVPS\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-15T18:30:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2025\/01\/How-to-install-wordpress-with-docker-compose-on-ubuntu-24-04.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"410\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@LinuxCloudVPS\" \/>\n<meta name=\"twitter:site\" content=\"@LinuxCloudVPS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/person\\\/ed907227ee7d151c617e6d0fe74f531a\"},\"headline\":\"How to Install WordPress with Docker Compose on Ubuntu 24.04\",\"datePublished\":\"2025-01-15T18:30:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\\\/\"},\"wordCount\":1064,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/How-to-install-wordpress-with-docker-compose-on-ubuntu-24-04.webp\",\"keywords\":[\"docker\",\"how to install\",\"ubuntu 24.04\",\"wordpress\"],\"articleSection\":[\"ubuntu 24.04\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\\\/\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\\\/\",\"name\":\"How to Install WordPress with Docker Compose on Ubuntu 24.04 | LinuxCloudVPS Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/How-to-install-wordpress-with-docker-compose-on-ubuntu-24-04.webp\",\"datePublished\":\"2025-01-15T18:30:00+00:00\",\"description\":\"Learn how to install WordPress with Docker Compose on Ubuntu 24.04 using our latest easy-to-follow step-by-step guide.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/How-to-install-wordpress-with-docker-compose-on-ubuntu-24-04.webp\",\"contentUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/01\\\/How-to-install-wordpress-with-docker-compose-on-ubuntu-24-04.webp\",\"width\":742,\"height\":410,\"caption\":\"How to Install WordPress with Docker Compose on Ubuntu 24.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install WordPress with Docker Compose on Ubuntu 24.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\",\"name\":\"LinuxCloudVPS\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\",\"name\":\"LinuxCloudVPS\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/logo.png\",\"width\":217,\"height\":25,\"caption\":\"LinuxCloudVPS\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"http:\\\/\\\/www.facebook.com\\\/LinuxCloudVPS\",\"https:\\\/\\\/x.com\\\/LinuxCloudVPS\",\"http:\\\/\\\/www.linkedin.com\\\/company\\\/linuxcloudvps-com\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/person\\\/ed907227ee7d151c617e6d0fe74f531a\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"http:\\\/\\\/www.linuxcloudvps.com\\\/\"],\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/author\\\/r0s3admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install WordPress with Docker Compose on Ubuntu 24.04 | LinuxCloudVPS Blog","description":"Learn how to install WordPress with Docker Compose on Ubuntu 24.04 using our latest easy-to-follow step-by-step guide.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Install WordPress with Docker Compose on Ubuntu 24.04 | LinuxCloudVPS Blog","og_description":"Learn how to install WordPress with Docker Compose on Ubuntu 24.04 using our latest easy-to-follow step-by-step guide.","og_url":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/","og_site_name":"LinuxCloudVPS Blog","article_publisher":"http:\/\/www.facebook.com\/LinuxCloudVPS","article_published_time":"2025-01-15T18:30:00+00:00","og_image":[{"width":742,"height":410,"url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2025\/01\/How-to-install-wordpress-with-docker-compose-on-ubuntu-24-04.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@LinuxCloudVPS","twitter_site":"@LinuxCloudVPS","twitter_misc":{"Written by":"admin","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/#article","isPartOf":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/"},"author":{"name":"admin","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/person\/ed907227ee7d151c617e6d0fe74f531a"},"headline":"How to Install WordPress with Docker Compose on Ubuntu 24.04","datePublished":"2025-01-15T18:30:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/"},"wordCount":1064,"commentCount":0,"publisher":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2025\/01\/How-to-install-wordpress-with-docker-compose-on-ubuntu-24-04.webp","keywords":["docker","how to install","ubuntu 24.04","wordpress"],"articleSection":["ubuntu 24.04"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/","url":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/","name":"How to Install WordPress with Docker Compose on Ubuntu 24.04 | LinuxCloudVPS Blog","isPartOf":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/#primaryimage"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2025\/01\/How-to-install-wordpress-with-docker-compose-on-ubuntu-24-04.webp","datePublished":"2025-01-15T18:30:00+00:00","description":"Learn how to install WordPress with Docker Compose on Ubuntu 24.04 using our latest easy-to-follow step-by-step guide.","breadcrumb":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/#primaryimage","url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2025\/01\/How-to-install-wordpress-with-docker-compose-on-ubuntu-24-04.webp","contentUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2025\/01\/How-to-install-wordpress-with-docker-compose-on-ubuntu-24-04.webp","width":742,"height":410,"caption":"How to Install WordPress with Docker Compose on Ubuntu 24.04"},{"@type":"BreadcrumbList","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-install-wordpress-with-docker-compose-on-ubuntu-24-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.linuxcloudvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Install WordPress with Docker Compose on Ubuntu 24.04"}]},{"@type":"WebSite","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#website","url":"https:\/\/www.linuxcloudvps.com\/blog\/","name":"LinuxCloudVPS","description":"","publisher":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.linuxcloudvps.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization","name":"LinuxCloudVPS","url":"https:\/\/www.linuxcloudvps.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2023\/08\/logo.png","contentUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2023\/08\/logo.png","width":217,"height":25,"caption":"LinuxCloudVPS"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/www.facebook.com\/LinuxCloudVPS","https:\/\/x.com\/LinuxCloudVPS","http:\/\/www.linkedin.com\/company\/linuxcloudvps-com"]},{"@type":"Person","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/person\/ed907227ee7d151c617e6d0fe74f531a","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"admin"},"sameAs":["http:\/\/www.linuxcloudvps.com\/"],"url":"https:\/\/www.linuxcloudvps.com\/blog\/author\/r0s3admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/2264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/comments?post=2264"}],"version-history":[{"count":8,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/2264\/revisions"}],"predecessor-version":[{"id":2290,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/2264\/revisions\/2290"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/media\/2279"}],"wp:attachment":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/media?parent=2264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/categories?post=2264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/tags?post=2264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}