Quickly deploy BT-Panel

更新时间:
复制 MD 格式

BT-Panel is an easy-to-use and powerful server and website management software that supports Linux and Windows. With BT-Panel, you can configure environments such as LAMP, LNMP, websites, databases, FTP, and SSL with a single click. You can also manage servers from a web interface to improve operations and maintenance (O&M) efficiency. This document describes how to use an Alibaba Cloud Marketplace image to quickly deploy BT-Panel on an ECS instance.

Note

For more information about BT-Panel, see the official BT-Panel website.

Quick deployment

Click Run Now to open Terraform Explorer. In Terraform Explorer, you can view and run the Terraform code to automatically deploy BT-Panel on an ECS instance.

Deployment guide

This document provides two methods to quickly deploy BT-Panel. You can choose a method based on your operating system.

Deployment method

Example operating system

Description

Method 1: Quickly deploy BT-Panel using ROS

Alibaba Cloud Linux 3

Note

This is the only supported operating system.

You can use Resource Orchestration Service (ROS) to automate the deployment of BT-Panel. For more information, see What is Resource Orchestration Service?.

Method 2: Deploy BT-Panel using an Alibaba Cloud Marketplace image

Alibaba Cloud Linux 3

Note

If you have specific requirements for the operating system, use this method. You can select an Alibaba Cloud Marketplace image for the corresponding operating system.

Alibaba Cloud Marketplace provides BT-Panel images. These images help you quickly set up BT-Panel and lower the barrier to deploying the environment. This method is suitable for enterprise or individual users who are new to Alibaba Cloud ECS. For more information, see Understand the image marketplace.

Method 1: Quickly deploy BT-Panel using ROS

Step 1: Deploy BT-Panel

  1. Click One-click Deployment. On the page that appears, configure the parameters as prompted, and then click Deploy Now.

    The key parameters are described as follows:

    • Region: Select the region where the ECS instance is located.

    • Instance Source:

      If you have specific requirements for the billing method, disk, or network of the ECS instance, you must first purchase an ECS instance that runs Alibaba Cloud Linux 3. Then, select the existing instance. For more information, see Create an instance on the custom launch tab.

      Create a new instance

      ROS automatically creates a spot instance and deploys BT-Panel on the instance.

      • Instance Image: Alibaba Cloud Linux 3

      • Instance Type: Select an instance type based on your requirements. For more information, see Instance families.

      • Instance Password: Enter and confirm the password for the ECS instance.

      Select an existing instance

      ROS automatically deploys BT-Panel on the selected instance. The ECS instance must have internet access and run Alibaba Cloud Linux 3.2104.

      Note

      A public IP address is automatically assigned to the ECS instance. Alternatively, an elastic IP address (EIP) is associated with the ECS instance. For instructions on how to enable public bandwidth, see Enable public bandwidth.

  2. ROS starts the automatic deployment. The deployment is successful when the progress reaches 100%.

    Note

    You can click the stack name to view information about the created resources, such as the ECS instance, VPC, and security group, in the ROS console. For more information, see View a stack.

    image

  3. Click the View Outputs tab to view and record the logon information for BT-Panel.

    The output keywords are described as follows:

    • EcsLoginAddress: The remote connection address of the ECS instance.

    • Console@PRIVATE_URL: The private network logon address for BT-Panel.

    • Console@PASSWORD: The logon password for BT-Panel.

    • Console@USERNAME: The username for BT-Panel.

    • Console@PublicURL: The public network logon address for BT-Panel.

      image

Step 2: Log on to BT-Panel for Linux

  1. On a Windows host with internet access, enter the public address of BT-Panel in a browser.

    In this example, the public address of BT-Panel is https://47.105.XX.XX:8888/cad432be. Use the address that is displayed on the View Outputs tab. If you cannot access BT-Panel, see the following documents to troubleshoot the issue:

    Note

    When you access the public address of BT-Panel from a browser for the first time, a message similar to "Your connection is not private" appears. Click Advanced, and then click Continue to 47.105.XX.XX (unsafe) to proceed. For more information, see the official BT-Panel documentation.

    image

  2. Enter the username and password that you recorded, and then log on to BT-Panel for Linux.

    image

  3. Select I have read and agree to the User Agreement and click Enter Panel.

  4. After you bind your BT-Panel account, the Recommended installation suite dialog box appears. Install the software that you need.

    For detailed usage instructions, see the BT-Panel official documentation.

    image

Method 2: Deploy BT-Panel using an Alibaba Cloud Marketplace image

Step 1: Use a BT-Panel image to create an ECS instance

Note
  1. Log in to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Instance.

  3. In the upper-left corner of the page, select a region and resource group.地域

  4. On the Instances page, click Create Instance.

  5. On the Custom Launch page, in the Image section, choose Marketplace Image > Select from Marketplace (Includes OS).镜像

  6. In the search box, enter BT-Panel, click Search, select an image, and then click Use.

    You can click the title of an image in the search results to go to the Alibaba Cloud Marketplace page for the image and view its configuration details. This example uses the BT-Panel for Linux (Alibaba Cloud Linux 3/LAMP/LNMP/Tomcat/Node.js/) image.

    Note
    • If you have specific requirements for the operating system and its version, select an Alibaba Cloud Marketplace image for the corresponding operating system.

    • When you select an Alibaba Cloud Marketplace image, note the image fee. If the image fee is ¥0/hour, the image is free of charge.

    • You can click the image name to go to the image details page. On this page, you can view the image details and user guide.

    image

  7. On the Custom Launch page, configure the other parameters as prompted and complete the purchase.

    Note the following parameters. For more information about the other parameters, see Create an instance on the custom launch tab.

    • Instance: Select an instance type with at least 2 GiB of memory.

    • Image: The Image section is automatically set to the image you selected.

    • Public IP: Select Assign Public IPv4 Address and set a bandwidth value as needed.

Step 2: Log on to BT-Panel

  1. Obtain the logon information for BT-Panel.

    1. Remotely connect to the ECS instance. For more information, see Log on to a Linux instance using Workbench.

    2. Run the following command to obtain the private and public addresses, username, and password for BT-Panel:

      bt default

      The command output is similar to the following:

      image

  2. In the inbound direction, add a rule to the security group of the ECS instance to allow access to port 8888 of BT-Panel. For more information, see Add a security group rule.

    In this example, the BT-Panel port is 8888. Use the port number that you obtained in Step 1. For data security, this example allows access only to the required ports in addition to the default ports that are allowed when the server is created.

    image

  3. On a Windows host with internet access, enter the public address of BT-Panel, http://<ECS instance public IP>:8888/login, in a browser.

    If you cannot access BT-Panel, see the following documents to troubleshoot the issue:

    Important

    Use the public address of BT-Panel that you obtained in Step 1.

  4. Enter the username and password that you recorded, and then log on to BT-Panel for Linux.

    image

  5. Select I have read and agree to the User Agreement and click Enter Panel.

  6. After you bind your BT-Panel account, the Recommended installation suite dialog box appears. Install the software that you need.

    For detailed usage instructions, see the BT-Panel official documentation.

    image

Method 3: Quickly deploy BT-Panel using Terraform

Step 1: Deploy BT-Panel

  1. Click Run Now to open Terraform Explorer. The following Terraform code is automatically loaded.

    Terraform code

    // Instance name
    variable "name" {
      default = "terraform-example"
    }
    
    // Instance type
    variable "instance_type" {
      default = "ecs.e-c1m2.xlarge"
    }
    
    // Instance logon password
    variable "instance_password" {
      default = "Test@12345"
    }
    
    // Region
    variable "region" {
      default = "cn-beijing"
    }
    
    provider "alicloud" {
      region = var.region
    }
    
    variable "create_instance" {
      default = true
    }
    
    // Instance ID
    variable "instance_id" {
      default = ""
    }
    
    // Image ID
    variable "image_id" {
      default = "debian_12_8_x64_20G_alibase_20241216.vhd"
    }
    
    // Create a VPC
    resource "alicloud_vpc" "vpc" {
      count      = var.create_instance ? 1 : 0
      cidr_block = "192.168.0.0/16"
    }
    
    // Create a vSwitch
    resource "alicloud_vswitch" "vswitch" {
      count        = var.create_instance ? 1 : 0
      vpc_id       = alicloud_vpc.vpc[0].id
      cidr_block   = "192.168.0.0/16"
      zone_id      = data.alicloud_zones.default.zones.0.id
      vswitch_name = var.name
    }
    
    // Create a security group
    resource "alicloud_security_group" "group" {
      count               = var.create_instance ? 1 : 0
      security_group_name = var.name
      description         = "foo"
      vpc_id              = alicloud_vpc.vpc[0].id
    }
    
    // Create a security group rule (This is an example. Set the rule based on your security policy.)
    resource "alicloud_security_group_rule" "allow_all_tcp" {
      count             = var.create_instance ? 1 : 0
      type              = "ingress"                           # Rule type: inbound
      ip_protocol       = "tcp"                               # Protocol type: TCP
      policy            = "accept"                            # Policy: accept
      port_range        = "22/22"                             # Port range: only port 22
      priority          = 1                                   # Priority: 1
      security_group_id = alicloud_security_group.group[0].id # Associate with the previously created security group
      cidr_ip           = "0.0.0.0/0"                         # Allow access from all IP addresses
    }
    
    resource "alicloud_security_group_rule" "allow_tcp_80" {
      count             = var.create_instance ? 1 : 0
      type              = "ingress"
      ip_protocol       = "tcp"
      nic_type          = "intranet"
      policy            = "accept"
      port_range        = "80/80"
      priority          = 1
      security_group_id = alicloud_security_group.group[0].id
      cidr_ip           = "0.0.0.0/0"
    }
    
    resource "alicloud_security_group_rule" "allow_tcp_443" {
      count             = var.create_instance ? 1 : 0
      type              = "ingress"
      ip_protocol       = "tcp"
      nic_type          = "intranet"
      policy            = "accept"
      port_range        = "443/443"
      priority          = 1
      security_group_id = alicloud_security_group.group[0].id
      cidr_ip           = "0.0.0.0/0"
    }
    
    resource "alicloud_security_group_rule" "allow_icmp_all" {
      count             = var.create_instance ? 1 : 0
      type              = "ingress"
      ip_protocol       = "icmp"
      nic_type          = "intranet"
      policy            = "accept"
      port_range        = "-1/-1"
      priority          = 1
      security_group_id = alicloud_security_group.group[0].id
      cidr_ip           = "0.0.0.0/0"
    }
    
    data "alicloud_zones" "default" {
      available_disk_category     = "cloud_essd"
      available_resource_creation = "VSwitch"
      available_instance_type     = var.instance_type
    }
    
    // Create an instance
    resource "alicloud_instance" "instance" {
      count             = var.create_instance ? 1 : 0
      availability_zone = data.alicloud_zones.default.zones.0.id
      security_groups   = alicloud_security_group.group.*.id
      # series III
      instance_type              = var.instance_type
      system_disk_category       = "cloud_essd"
      system_disk_name           = var.name
      system_disk_description    = "test_foo_system_disk_description"
      image_id                   = var.image_id
      instance_name              = var.name
      vswitch_id                 = alicloud_vswitch.vswitch.0.id
      internet_max_bandwidth_out = 10
      password                   = var.instance_password
    }
    
    resource "alicloud_ecs_command" "install_content" {
      name            = "install_content"
      type            = "RunShellScript"
      command_content = base64encode(local.install_content)
      timeout         = 3600
      working_dir     = "/root"
      depends_on      = [alicloud_instance.instance]
    }
    
    resource "alicloud_ecs_invocation" "invocation_install" {
      instance_id = [local.instanceId]
      command_id  = alicloud_ecs_command.install_content.id
      timeouts {
        create = "15m"
      }
    }
    
    data "alicloud_instances" "default" {
      count = var.create_instance ? 0 : 1
      ids   = [var.instance_id]
    }
    
    locals {
      instanceId         = var.create_instance ? alicloud_instance.instance[0].id : var.instance_id
      instance_public_ip = var.create_instance ? element(alicloud_instance.instance.*.public_ip, 0) : lookup(data.alicloud_instances.default[0].instances.0, "public_ip")
      install_content    = <<SHELL
    echo '#!/bin/bash
    # Check the operating system version
    if [ -f /etc/os-release ]; then
        source /etc/os-release || { echo "Cannot read the /etc/os-release file"; exit 1; }
        if [ -z "$${ID:-}" ] || [ -z "$${VERSION_ID:-}" ]; then
            echo "The /etc/os-release file format is not as expected or lacks necessary information"
            exit 1
        fi
        OS=$ID
        VER=$VERSION_ID
        echo "Operating system: $OS Version: $VER"
    else
        echo "Cannot detect the operating system version. The /etc/os-release file does not exist"
        exit 1
    fi
    if [[ $OS == "alinux" ]]; then
    url="https://download.bt.cn/install/install_lts.sh"
    if [ -f /usr/bin/curl ]; then
        curl -sSO "$url"
    else
        wget -O install_lts.sh "$url"
    fi
    yes | bash install_lts.sh ed8484bec
    
    elif [[ $OS == "centos" ]]; then
    url="https://download.bt.cn/install/install_lts.sh"
    if [ -f /usr/bin/curl ]; then
        curl -sSO "$url"
    else
        wget -O install_lts.sh "$url"
    fi
    yes | bash install_lts.sh ed8484bec
    elif [[ $OS == "ubuntu" ]]; then
    wget -O install.sh https://download.bt.cn/install/install_lts.sh && yes | sudo bash install.sh ed8484bec
    elif [[ $OS == "debian" ]]; then
    wget -O install.sh https://download.bt.cn/install/install_lts.sh && yes | bash install.sh ed8484bec
    else
        echo "Unsupported operating system"
        exit 1
    fi
    ' > install.sh
    chmod +x install.sh
    timeout 300s ./install.sh
    bt default > credentials.txt
    SHELL
    }
    
    output "credentials_info" {
      value = "To obtain the logon information for BT-Panel, log on to the ECS instance and view the credentials.txt file in the user's home directory"
    }
    
    output "ecs_login_address" {
      value = "ECS remote connection address: https://ecs-workbench.aliyun.com/?from=EcsConsole&instanceType=ecs&regionId=${var.region}&instanceId=${local.instanceId}"
    }
  2. Modify the parameters based on your requirements. By default, a VPC-connected instance and a pay-as-you-go ECS instance that runs Debian are created in the China (Beijing) region. For more information about instance billing, see Billing overview.

  3. Click Start Debugging to preview the details of the resources to be created. If the resource information is correct, click Preview and Execute to start creating the resources. The deployment is complete when the task execution status is Successful.

Step 2: Log on to BT-Panel for Linux

  1. Obtain the logon information for BT-Panel.

    1. Remotely connect to the ECS instance. For more information, see Log on to a Linux instance using Workbench.

    2. Run the following command to obtain the private and public addresses, username, and password for BT-Panel:

      bt default

      The command output is similar to the following:

      image

  2. In the inbound direction, add a rule to the security group of the ECS instance to allow access to port 8888 of BT-Panel. For more information, see Add a security group rule.

    In this example, the BT-Panel port is 8888. Use the port number that you obtained in Step 1. For data security, this example allows access only to the required ports in addition to the default ports that are allowed when the server is created.

    image

  3. On a Windows host with internet access, enter the public address of BT-Panel, http://<ECS instance public IP>:8888/login, in a browser.

    If you cannot access BT-Panel, see the following documents to troubleshoot the issue:

    Important

    Use the public address of BT-Panel that you obtained in Step 1.

  4. Enter the username and password that you recorded, and then log on to BT-Panel for Linux.

    image

  5. Select I have read and agree to the User Agreement and click Enter Panel.

  6. After you bind your BT-Panel account, the Recommended installation suite dialog box appears. Install the software that you need.

    For detailed usage instructions, see the BT-Panel official documentation.

    image