Last update at :2024-02-12,Edit by888u
Docker is an open source containerization software that creates an isolated environment for running applications. Compared with virtual machines, each container does not require its own operating system, but rather shares the host's kernel. How to install WordPress website program on Docker? Tutorial on installing WordPress with docker. This article will introduce the steps to install the WordPress application on Docker.
Step 1. Install Docker
Docker can be used for Windows, macOS and Linux. Here we mainly take Linux server or Windows server as an example. Recommended VPS: Bandwagonhost 4 top-level line VPS package summary: American cn2 gia, Hong Kong cn2 gia, Japanese cn2 gia, Japanese Softbank (softbank)
①The main steps to install Docker on Linux server (operating system is Ubuntu 18.04):
Use the SSH tool to log in to the Linux server, and then run the following command to update the package list.
sudo apt-get update
Allow apt to access repositories on https.
sudo apt-get installapt-transport-httpsca-certificatescurlgnupg-agentsoftware-properties-common
Add Docker's GPG key.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
Add Docker repository.
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu$(lsb_release -cs)stable"
Update Docker's repository.
sudo apt-get update
Install Docker.
sudo apt install docker-ce
②Main steps to install Docker on Windows server:
Download and install the Windows version of Docker Desktop through the Docker official website. In the Configuration dialog box, select or cancel the relevant check boxes according to your preferences. After setting, click the OK button.
After Docker is installed, you will see the Docker icon in the Windows taskbar.
Step 2. Install and configure the WordPress website program on Docker
Check the installed Docker Compose version.
docker-compose –version
Create a new directory for WordPress.
mkdir ~/wordpress/
cd ~/wordpress/
Create a new docker-compose.yml and paste the following content, and modify the following MySQL database user name, password and other information according to the actual situation
version: '3.9'services:db:image: mysql:5.7volumes:– db_data:/var/lib/mysqlrestart: alwaysenvironment:MYSQL_ROOT_PASSWORD: somewordpressMYSQL_DATABASE: wordpressMYSQL_USER: wordpressMYSQL_PASSWORD: wordpresswordpress:depends_on:– dbimage: wordpress:latestports: – “8000:80” restart: alwaysenvironment:WORDPRESS_DB_HOST: db:3306WORDPRESS_DB_USER: wordpressWORDPRESS_DB_PASSWORD: wordpressWORDPRESS_DB_NAME: wordpressvolumes:db_data: {}
Run the following command in the directory to create the container:
docker-compose up -d
Then open the browser and enter localhost:8000. If nothing unexpected happens, the WordPress settings page will be displayed.
Follow the installation wizard, select the appropriate language version, and then click the Continue button to proceed to the next step. On the Welcome interface, set the site name, login user name, password and other information. After confirming that it is correct, click the Install WordPress button to install it.
Once again, it is recommended that if you need to purchase a machine to install and deploy docker, you can refer to: Bandwagonhost's 4 top line VPS package summary: American cn2 gia, Hong Kong cn2 gia, Japanese cn2 gia, Japanese Softbank (softbank)!
Recommended site searches: domain name space agency, free virtual host, how to check domain name registration number, Wanwang registered domain name query Hong Kong server hosting, instant solution server, free website domain name registration, space registration, dual-line server, Hong Kong vps, < /p>
发表评论