To start a new WordPress Docker container on the Kyup cloud hosting platform you can use our One-click Docker image integration which is accessible from our Dashboard. Below, you will find instructions on how to setup WordPress using the official MySQL and WordPress Docker images.

In order to have a working WordPress application we’ll need to set up two containers with Docker images:

  1. MySQL container
  2. WordPress container

Start a MySQL Docker Container

To start new containers on the Kyup infrastructure, you need to have an account with us. You can sign up for free and then simply log in to the Kyup dashboard.

Select Container Name and Root Password

Once you access your Kyup account you need to launch a new container. To do this use the LAUNCH CONTAINER button on the left menu in your Kyup dashboard.

image07

Once you click this button you’ll be redirected to the container order page. You will be asked to type a name for your new container, select a password and resources first.

Find and Pull the MySQL Docker Image

Once you add the resources you need to your container you have to find and run the official MySQL Docker image. Here are the steps you need to follow:

Click on Applications and choose the DOCKER option:

image04

Once you click on the DOCKER option you’ll see the following interface:

image01

In order to setup the MySQL container we need to find and pull the official MySQL Docker image.

Type “MySQL” in the Search Term field and press the “Search” button. The interface will list all of the Docker images that are related to MySQL. The official image is always listed on top. To pull the official MySQL image click the “PULL” button right next to it:

image06

Now you need to wait some time for the interface to pull the image, so that you can use it to start a new container.

Define Docker Image Environment Variables

Once the image is pulled you’ll see the below interface which allows you to launch the container, select a specific version of the image and edit certain environment variables before you launch the container:

image02

In our case we want to use the latest version of the MySQL Docker image. To have a working MySQL server with a new database we will define the following variables:

  • MYSQL_ROOT_PASSWORD = 9tud(27Xd5
  • MYSQL_DATABASE = wordpressdb
  • MYSQL_USER = wordpressuser
  • MYSQL_PASSWORD = cgrX38c0C

In our case the list of variables looks like this:

image03

Once you define the variables you simply need to launch the container. The system will take care of the rest - it will launch the containers, download the Docker image and start the MySQL service creating the DB you configured via the MYSQL_DATABASE variable.

Note: Due to security reasons please do not use the same login details/passwords as the ones used in this tutorial.

Find the IP of the MySQL Docker Container

Once the container is up and running you need to find out what is the IP address of the MySQL server because we’ll need it later during the setup of the WordPress Docker image. To find out the IP address of the MySQL container go to your Kyup User Area and click on the “Containers” menu item on the left. Then find the container that you just created and write down its IP address. In our case the IP of the container is “109.73.225.228”.

Start the WordPress Container

Launch a New Container

Now that you have the MySQL container up and running you need to launch a new container which will host the WordPress application. To do this we’ll use the official WordPress Docker image. To launch a new container again use the LAUNCH CONTAINER button on the left menu in your Kyup dashboard. Type a name for the container and also select a root password for it.

Find and Pull the WordPress Docker Image

Then select “DOCKER” from the Applications tab. In the search field type “WordPress” and press the “Search” button. The official WordPress image will be listed in the interface:

image00

Add the Needed Environment Variables

Pull the image and wait for the environment variables interface to be loaded. Then you need to add the following variables:

  • WORDPRESS_DB_HOST = 109.73.225.228
  • WORDPRESS_DB_USER = wordpressuser
  • WORDPRESS_DB_PASSWORD = cgrX38c0C
  • WORDPRESS_DB_NAME = wordpressdb
  • WORDPRESS_TABLE_PREFIX = wpprefix_

As you can see the first 4 variables are the same as the ones we used to setup the MySQL container. The final step is to launch the container. The container will be launched and you’ll need to wait several minutes for the WordPress to be downloaded and configured on the new container.

Access the Container and Complete the WordPress Installation

Once this is done the WordPress installation page will become accessible via the IP address of the WordPress container. In our case the address is the following: http://37.60.242.47/

image05

You can also connect to your Kyup containers created from Docker images via SSH. More information how to do this can be found in our How to SSH into a container tutorial.