WordPress With Docker: From Zero to Online for Beginners
About Lesson

Setting up Docker Environment

We recommend using the Windows, Ubuntu Desktop Linux, or macOS platforms to run Docker, as these platforms all support graphical installation.

In the initial teaching stage, we will primarily use the Windows platform as an example. Currently, there are still a significant number of users who use Windows, especially those who have spare computers. As long as your computer can install Docker, you can start building the environment.

For older hardware, such as 8th generation processors and earlier, it is recommended to abandon Docker Desktop and instead use Windows WSL2 Ubuntu directly. Docker can be installed via the command line using this method, which offers better performance. This tutorial will be covered in the next section, "Deploying and Installing WordPress.

Certainly, you can try setting up Docker using both of these different methods. These are all experiences personally learned by the instructor through trial and error.

We will provide two methods for installing Docker on Windows.

A. Docker Desktop GUI - Graphical User Interface (Suitable for newer hardware)
B. Installing Docker on WSL2 Ubuntu (Compatible with both new and old hardware, better performance)

A. Docker Desktop GUI - Graphical User Interface

The installation steps for Docker Desktop GUI on Windows.

Step 1: Download the Docker installation file.

Docker official website.

First, we need to visit the Docker official website to download the necessary installation file. Here's a little secret: the Docker official website is actually built using WordPress.

Choose the appropriate installation version based on your platform. Typically, Windows versions are 64-bit, so your computer's processor should support 64-bit. If you are using an older Apple computer, please select the Intel Chip 64-bit installation package. If you have a newer Apple processor, choose the Apple Chip version for downloading and installation.

Step 2: Install Docker.

After downloading is complete, double-click the installation file to initiate the Docker installation; it will begin the initialization process.

During the installation process on Windows, you will be prompted to configure settings.

  • The first option is to use Windows Subsystem for Linux, and this is a mandatory selection: 'Use WSL 2 instead of Hyper-V (recommended).'
  • Next, the 'Add shortcut to desktop' option is to add a shortcut of the Docker application to your desktop. Both of these options are typically preselected by default, so you don't need to change any settings.

hen, click 'Next,' and the installation process will begin. After the installation is complete, you will see the 'Close and restart' option; click it to close and restart your system.

Step 3: Start Docker.

After the restart is complete, simply click 'Run Docker Desktop' to start the Docker application. The first time you run it, you will be asked to agree to the terms of use; just click 'Agree' to proceed.

如果在執行過程中遇到錯誤訊息,最常見的是 Docker Desktop – WSL kernel version too low

This means that the Windows Subsystem for Linux (WSL) kernel version is too old.

You simply need to open Windows PowerShell with administrator privileges.

Enter the following command for the upgrade:wsl --update

After the upgrade is completed

Once you run Docker Desktop again, you will be able to use the Docker environment without any issues.

This way, the installation of the Docker environment is complete.

This is a GUI installation using Docker Desktop on Windows.

If your computer is relatively new, such as equipped with 10th generation or higher Intel i5 or i7 processors, using Docker Desktop will provide better performance. In contrast, older hardware may experience significantly poorer performance because Docker Desktop relies on Windows WSL2 Linux Type 1 technology, which achieves virtualization by directly accessing hardware. In recent years, with hardware iterations and technological breakthroughs, hardware performance has become more powerful, allowing for seamless execution of operating system kernels directly with hardware through virtualization technology.

For older hardware, such as 8th generation processors and earlier, it is recommended that you ditch Docker Desktop and go straight to Windows WSL2 Ubuntu and install Docker from the command line for better performance.

In the next section, we will teach you how to install Docker using WSL2 Ubuntu directly, without using Docker Desktop. This approach can provide better performance.

If you encounter issues with the subsystem, you can also enable subsystem-related components using Windows PowerShell.

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

If you encounter any installation issues, feel free to bring them up, and we can discuss and solve them together as a class.
Now, it's time to start the main event – deploying a series of WordPress website systems and services.

Join the conversation
0% Complete