You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/04.pro/boards/portenta-x8/tutorials/wordpress-webserver/content.md
+17-17
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
-
title: 'Running Wordpress and Database Containers on the Portenta X8'
3
-
description: 'Learn how to run a database and Wordpress container on the Portenta X8'
2
+
title: 'Running WordPress and Database Containers on the Portenta X8'
3
+
description: 'Learn how to run a database and WordPress container on the Portenta X8'
4
4
difficulty: beginner
5
5
tags:
6
6
- containers
7
7
- Docker
8
-
- Wordpress
8
+
- WordPress
9
9
author: 'Benjamin Dannegård'
10
10
software:
11
11
- Terminal
@@ -16,13 +16,13 @@ hardware:
16
16
17
17
## Overview
18
18
19
-
The Arduino Portenta X8 is a powerful board that has many features that can be easily utilized with the help of Docker containers. In this tutorial we will be using the Portenta X8 to host a webserver and run Wordpress using containers. This is a simple way to configure and run your own database server container and Wordpress page. We can then access the Wordpress site on the X8 through our web browser and begin setting it up.
19
+
The Arduino Portenta X8 is a powerful board that has many features that can be easily utilized with the help of Docker containers. In this tutorial, we will be using the Portenta X8 to host a web server and run WordPress using containers. This is a simple way to configure and run your own database server container and WordPress page. We can then access the WordPress site on the X8 through our web browser and begin setting it up.
20
20
21
21
## Goals
22
22
23
23
- Create the file to install docker containers
24
24
- Install and run the containers
25
-
- Connect to the Wordpress container running on the Portenta X8
25
+
- Connect to the WordPress container running on the Portenta X8
26
26
27
27
### Required Hardware and Software
28
28
@@ -31,16 +31,16 @@ The Arduino Portenta X8 is a powerful board that has many features that can be e
31
31
32
32
## Instructions
33
33
34
-
First make sure your Portenta X8 is setup correctly by following the [getting started tutorial](https://docs.arduino.cc/tutorials/portenta-x8/out-of-the-box).
34
+
First, make sure your Portenta X8 is set up correctly by following the [getting started tutorial](https://docs.arduino.cc/tutorials/portenta-x8/out-of-the-box).
35
35
36
36
### Creating the Docker-compose.yml File
37
37
38
-
The Wordpress container we use is a multi-container application, which also requires a database server container. The Wordpress multi-container application uses Apache as its web server. This is required to make the service work and it is already included in the container, so it is nothing for us to worry about. We will be using **mariadb** as our database server container. This container can run on the Portenta X8's architecture. All we need to start using these containers is to write a **docker-compose.yml** file. This file will contain information about what image we want to install and some important configuration information, such as the username for the database, password, timezone and database name. The same goes for the Wordpress container: it will contain the password and username and we will also enter the database host name and which container it will use as database. We recommend that you change the default passwords to more secure ones by replacing the default ones that are stated in the file below.
38
+
The WordPress container we use is a multi-container application, which also requires a database server container. The WordPress multi-container application uses Apache as its web server. This is required to make the service work and it is already included in the container, so it is nothing for us to worry about. We will be using **MariaDB** as our database server container. This container can run on the Portenta X8's architecture. All we need to start using these containers is to write a **docker-compose.yml** file. This file will contain information about what image we want to install and some important configuration information, such as the username for the database, password, timezone and database name. The same goes for the WordPress container: it will contain the password and username and we will also enter the database hostname and which container will be used as the database. We recommend that you change the default passwords to more secure ones by replacing the default ones that are stated in the file below.
39
39
40
40
41
41
### The Complete Docker-compose.yml File
42
42
43
-
In this section you can find the complete **docker-compose.yml** file that we will be using for this tutorial.
43
+
In this section, you can find the complete **docker-compose.yml** file that we will be using for this tutorial.
44
44
45
45
```
46
46
version: "3.9"
@@ -84,19 +84,19 @@ Now let's create a directory on our X8 and put this **docker-compose.yml** file
84
84
85
85
### Installing The Containers
86
86
87
-
First we create a directory where we want to add our **docker-compose.yml** file. Using the `mkdir` command we will create a directory named "wordpress-test". Navigate into this directory with a simple `cd` command. Either copy the docker-compose.yml file into this directory or create it directly here. To create the file, we can use `cat > docker-compose.yml`, this will create the file, so you can copy contents of the file from above and paste it. Push enter once to go to a new line and press `ctrl C` to exit the file editor. To copy the file from your computer onto the device use: `adb push <path to docker-compose.yml file> /home/fio/wordpress-test`.
87
+
First, we create a directory where we want to add our **docker-compose.yml** file. Using the `mkdir` command we will create a directory named "wordpress-test". Navigate into this directory with a simple `cd` command. Either copy the docker-compose.yml file into this directory or create it directly here. To create the file, we can use `cat > docker-compose.yml`, this will create the file, so you can copy the content of the file from above and paste it. Push enter once to go to a new line and press `ctrl C` to exit the file editor. To copy the file from your computer onto the device use: `adb push <path to docker-compose.yml file> /home/fio/wordpress-test`.
88
88
89
89

90
90
91
-
Before installing the containers, make sure that no other container is running on the ports that the Wordpress container will use. You can check what containers are running and what port they are using by running the `docker ps -a` command. This will show a list of the currently installed and running containers on the Portenta X8. To remove a container first stop it with `docker stop <container id>`, then you can run `docker rm <container id>` to remove it. If you want more information about handling containers on your Portenta X8, take a look at our [managing containers with docker tutorial](https://docs.arduino.cc/tutorials/portenta-x8/docker-container).
91
+
Before installing the containers, make sure that no other container is running on the ports that the WordPress container will use. You can check what containers are running and what port they are using by running the `docker ps -a` command. This will show a list of the currently installed and running containers on the Portenta X8. To remove a container first stop it with `docker stop <container id>`, then you can run `docker rm <container id>` to remove it. If you want more information about handling containers on your Portenta X8, take a look at our [managing containers with docker tutorial](https://docs.arduino.cc/tutorials/portenta-x8/docker-container).
92
92
93
-
When you are in the correct directory and no other container is running on the ports that Wordpress will use, you can now run `docker compose up -d`. Using the `-d` tag in the command will allow running these containers in the background. If you run the command without the `-d` tag, the application will exit when you close the terminal. When the command is executed it will start installing the **Wordpress** and **mariadb** containers. This can take a while. To get the output from the containers use: `docker-compose logs -f`. Once it is done you can connect to the device and site.
93
+
When you are in the correct directory and no other container is running on the ports that WordPress will use, you can now run `docker compose up -d`. Using the `-d` tag in the command will allow running these containers in the background. If you run the command without the `-d` tag, the application will exit when you close the terminal. When the command is executed it will start installing the **WordPress** and **MariaDB** containers. This can take a while. To get the output from the containers use: `docker-compose logs -f`. Once it is done you can connect to the device and site.
94
94
95
95

96
96
97
-
### Connecting to the Wordpress Site
97
+
### Connecting to the WordPress Site
98
98
99
-
To connect to the Wordpress setup site, you simply need to access it with your Portenta X8s unique id and port. So for example: `http://portenta-x8-<uuid>.local:<port>`, where you would substitute the `<uuid>` with your Portenta X8's unique id and the port chosen for the Wordpress container with `<port>`. The `<uuid>` can be found on the setup page that is showed in the [Getting started tutorial](https://docs.arduino.cc/tutorials/portenta-x8/out-of-the-box), but you can also see it in the terminal when running `adb` or you can go to `http://192.168.7.1:8000` if you use Windows and Linux, on MacOS use `http://192.168.8.1:8000`.
99
+
To connect to the WordPress setup site, you simply need to access it with your Portenta X8s unique id and port. So for example: `http://portenta-x8-<uuid>.local:<port>`, where you would substitute the `<uuid>` with your Portenta X8's unique id and the port chosen for the WordPress container with `<port>`. The `<uuid>` can be found on the setup page that is shown in the [Getting started tutorial](https://docs.arduino.cc/tutorials/portenta-x8/out-of-the-box), but you can also see it in the terminal when running `adb` or you can go to `http://192.168.7.1:8000` if you use Windows and Linux, on MacOS use `http://192.168.8.1:8000`.
100
100
101
101
When you connect, you should get some feedback in the terminal. Text will begin printing in the terminal, showing you information about the connection that has just been established as shown in the image below.
102
102
@@ -106,15 +106,15 @@ Now you should see a webpage, like the following image, in your browser.
You are now free to go through the Wordpress set up process and configure it however you like.
109
+
You are now free to go through the WordPress setup process and configure it however you like.
110
110
111
111
## Conclusion
112
112
113
-
In this tutorial we went through how to install and run a Wordpress and database container on the Portenta X8. We then accessed the Wordpress site on our X8 through our web browser. So now you can setup your own Wordpress site on your X8 device and access it from another device.
113
+
In this tutorial, we went through how to install and run a WordPress and database container on the Portenta X8. We then accessed the WordPress site on our X8 through our web browser. So now you can set up your own WordPress site on your X8 device and access it from another device.
114
114
115
115
116
116
## Troubleshooting
117
117
118
-
- If the containers are not installing or running correctly, check if there are any other containers currently running on the same ports as the ones used by the Wordpress container. You can check this with ``docker ps -a``.
118
+
- If the containers are not installing or running correctly, check if there are any other containers currently running on the same ports as the ones used by the WordPress container. You can check this with ``docker ps -a``.
119
119
- If there is any issue running docker commands, make sure you are using ``sudo`` before the commands.
120
-
- If you cannot connect to the site when everything is running, you can doublecheck the X8s IP address. Run the command `ip s a` in the **adb shell**. This will display the X8's IP address via USB and WiFi. Try connecting via those IP addresses if all the rest fails.
120
+
- If you cannot connect to the site when everything is running, you can double-check the X8s IP address. Run the command `ip s a` in the **adb shell**. This will display the X8's IP address via USB and WiFi. Try connecting via those IP addresses if all the rest fails.
0 commit comments