Administrator
Published on 2026-01-14 / 0 Visits
0
0

How to deploy a WordPress website using the 1Panel control panel

Overview

This tutorial provides a comprehensive guide on how to deploy a WordPress website in 1Panel using the PHP Runtime Environment, complete with domain configuration and HTTPS setup. As a modern Linux server management panel, 1Panel offers a robust, all-in-one solution for website deployment and administration.

The PHP Runtime management in 1Panel offers:

  • Multi-version PHP Support: Supports PHP 5.6, 7.0-7.4, and 8.0-8.3. You can flexibly select or switch versions based on your application's requirements.

  • Extension Management: Provides a library of common PHP extensions (including mysqli, gd, curl, zip, mbstring, etc.) with one-click installation, uninstallation, and configuration.

  • Visual Configuration: A GUI for effortless adjustment of core PHP parameters, such as file upload limits, memory limits, execution time, and disabled functions.

Prerequisites

Before starting, please ensure you have the following:

  • A Linux server with a public IP address (e.g., BandwagonHost, VMRack, Alibaba Cloud, etc.).

  • 1Panel installed and configured on your server.

  • A registered domain with access to manage its DNS records.

  • Relevant firewall ports (80 and 443) opened on your server.

Step 1: Install Required Runtime Environments

1.1 Install OpenResty

OpenResty is the core Web Server used for website management in 1Panel. It is built on Nginx and integrates enhanced LuaJIT along with a rich set of third-party modules.

  1. Log in to your 1Panel dashboard.

  2. Click on App Store in the left sidebar.

  3. Locate OpenResty in the application list.

  4. Keep the installation parameters at their defaults, click Install, and wait for the process to complete.

install-openresty.png

1.2 Install MySQL Database

WordPress requires a database to store its content, and MySQL is the most widely used choice for this purpose.

  1. Locate MySQL in the App Store.

  2. Keep the installation parameters at their defaults and click Install.

  3. Wait for the installation process to complete.

install-mysql.png

1.3 Configure the PHP Runtime Environment

Since WordPress is built on PHP, a dedicated PHP runtime environment must be configured.

  1. Click Websites -> PHP Runtimes in the left sidebar.

  2. Select PHP and click Create Runtime.

  3. Fill in the Name and other parameters. Select the appropriate PHP version (this tutorial uses the latest v8.4.6).

  4. For the Extension Template, select WordPress. This template automatically includes common extensions required by the WordPress core.

  5. Add any additional extensions based on the specific requirements of your chosen themes or plugins.

  6. Click OK and wait for the runtime environment to be successfully created.

create-php-runtime.png

Step 2: Create the Website

2.1 Create Website Record

  1. Click Websites in the left sidebar menu.

  2. Click Create Website.

  3. Select the Runtime tab, then choose the PHP Runtime environment you just created.

  4. Enter the Website Information:

    • Name: The display name of your WordPress site.

    • Primary Domain: Your domain name (e.g., wp.demo.lxware.co).

    • Alias (Slug): The name of the root directory corresponding to your website.

  5. Set the Default Website status to the site you just created (optional, depending on your routing needs).

create-website.png

default-website.png

2.2 Test the Website

Access the website using your server's IP address. If the PHP Info page (or environment details) appears, it indicates that the website has been successfully created and the environment is running correctly.

test-website.png

第三步:部署 WordPress

Step 3: Deploy WordPress

3.1 Download WordPress

  1. Click the Directory Icon next to your website to enter the Site Root Directory.

    install-wordpress-1.png

  2. Using the remote download function, download the latest version of WordPress from https://wordpress.org/latest.zip.

    install-wordpress-2.png

    install-wordpress-3.png

  3. After the download is complete, extract the files to your website's root directory. The WordPress files will be extracted by default to a directory named "wordpress" within the current directory. 

    install-wordpress-4.png

  4. Go back to the website settings, change the website's operating directory to "wordpress", and click "Save and Reload".

    modify-website-runtime-directory.png

3.2 Create the Database

  1. Click Databases in the left sidebar menu.

  2. Under the MySQL tab, click Create Database.

  3. Fill in the Database Information:

    • Name: The name for your WordPress database (e.g., wordpress).

    • Username: The database user for WordPress (e.g., wordpress).

    • Password: The database password. This is typically randomly generated by the system—ensure you copy and save this password for later use.

  4. Click OK and wait for the database creation to complete.

    create-database.png

  5. Click on "Connection Information" to record the container connection information for the database, as well as the database name, username, and password created above. This information will be needed later when configuring WordPress. 

    database-connection-information.png

3.3 Complete the WordPress Installation

  1. Access your server's IP address in a web browser.

  2. If the WordPress Installation Wizard appears, it indicates that the WordPress files have been deployed correctly and the setup is ready to proceed.

    setup-wordpress-1.png

  3. Select your language, click Continue, enter your database information, and then click Submit.

    setup-wordpress-2.png

  4. Follow the WordPress Installation Wizard to complete the setup:

    • Select Language: Choose your preferred language for the site backend and frontend.

    • Fill in Website Information: Provide your Site Title and connect the database using the credentials created in the previous step.

    • Create Admin Account: Set up your administrator username, password, and email address.

    • Complete Installation: Click the install button and wait for the "Success!" message to appear.

setup-wordpress-3.png

Step 4: Configure Domain Access

4.1 Add DNS Records

  1. Log in to your Domain Management Console (e.g., Tencent Cloud, Cloudflare, Alibaba Cloud, etc.).

  2. Add an A Record with the following details:

    • Record Type: A

    • Host (Hostname): @ (for the root domain) or www

    • Value (Points to): Your server's Public IP Address

    • TTL: 600 (or the default value)

dns-record.png

4.2 Verify Domain Propagation

Access your domain name in a web browser. If the WordPress homepage appears, it indicates that the domain name resolution (DNS propagation) was successful.

  1. verify-dns-record.png

Step 5: Configure HTTPS Certificate

5.1 Create an ACME Account

  1. In 1Panel, click on Certificates in the sidebar.

  2. Click Manage ACME Accounts.

  3. Enter your Email Address.

  4. Select the Account Type and Encryption Algorithm.

  5. Click Create to set up the ACME account.

acme-account.png

5.2 Configure DNS Provider

  1. Click Manage DNS Providers.

  2. Select your DNS Service Provider (e.g., Tencent Cloud).

  3. Enter your API Credentials (such as SecretId and SecretKey).

dns-provider.png

5.3 Apply for an SSL Certificate

  1. On the Certificates page, click the Apply button.

  2. Fill in the Certificate Information:

    • Primary Domain: Your domain name (e.g., example.com).

    • ACME Account: Select the account you just created.

    • Verification Method: Select DNS Verification.

    • DNS Provider: Select the DNS account you just configured.

  3. Click Confirm and wait for the certificate issuance process to complete.

apply-ssl-certificate.png

5.4 Enable HTTPS

  1. Go to the Websites management page.

  2. Click on your Website Name to enter the configuration panel.

  3. In the SSL Settings section:

    • Toggle Enable HTTPS.

    • Select the Certificate you just applied for.

    • Configure HTTPS Redirection (Force HTTPS) to ensure all traffic is secure.

  4. Save the settings.

  5. Access your website again using the HTTPS address: https://wp.demo.lxware.com. If the WordPress homepage loads correctly, your HTTPS configuration is successful.

verify-https.png


Comment