Docker deployment of AnQi CMS

Calendar 👁️ 0

Docker deployment is the fastest installation method for AnQiCMS, suitable for quick experience and testing environments.

Docker image address:https://hub.docker.com/r/anqicms/anqicms


Method one: Docker command line deployment

Suitable for environments where Docker is already installed (any operating system).

Quick start

# 拉取最新镜像
docker pull anqicms/anqicms:latest

# 运行容器
docker run -d --name anqicms -p 8001:8001 anqicms/anqicms:latest

Parameter description

# -d          后台运行
# --name      容器名称(可自定义)
# -p 8001:8001 映射端口:宿主机端口:容器端口

Operation after startup

  1. Browser accesshttp://服务器IP:8001
  2. Enter the initialization installation interface (if the container does not come with a database, you need to connect to MySQL separately)
  3. Access after installation is completehttp://服务器IP:8001/system/Enter the backend

Prompt: MySQL in Docker containers needs to be deployed separately. It is recommended to create a MySQL container in the same Docker network and fill in the internal network address of the MySQL container during initialization.

Use Docker Compose (recommended)

Createdocker-compose.ymlFile:

version: '3'

services:
  mysql:
    image: mysql:5.7
    container_name: anqicms-mysql
    environment:
      MYSQL_ROOT_PASSWORD: your_root_password
      MYSQL_DATABASE: anqicms
      MYSQL_CHARACTER_SET_SERVER: utf8mb4
      MYSQL_COLLATION_SERVER: utf8mb4_unicode_ci
    volumes:
      - ./mysql-data:/var/lib/mysql
    restart: always

  anqicms:
    image: anqicms/anqicms:latest
    container_name: anqicms
    ports:
      - "8001:8001"
    depends_on:
      - mysql
    restart: always

Start:

docker-compose up -d

Fill in the database host during the initial installation.anqicms-mysql(Container name), usernameroot, and the password isyour_root_password.

Management commands

# 查看容器状态
docker ps | grep anqicms

# 查看容器日志
docker logs anqicms

# 停止容器
docker stop anqicms

# 启动容器
docker start anqicms

# 重启容器
docker restart anqicms

# 删除容器
docker rm -f anqicms

Method two: Baidu Panel Docker One-click Deployment

Applicable version: Baidu Panel 9.2.0+ (versions released after September 5, 2024)

The demonstration is based on Baota Panel version 9.5.0.

Step 1: Install Docker

  1. Log in to Baota Panel
  2. → Click the menu on the leftDocker(If not found, go to)panel settingspanel menu hidden→ Enable Docker display
  3. When entering for the first time, it will prompt to install Docker, clickInstall immediately
  4. After installation is complete, dependency installation is also required

bt-docker-open.png

docker-bt-1.png

Step 2: Install Docker version MySQL

  1. In DockerApp StoreSearchmysql
  2. ClickInstall
  3. If the server memory is less than 2GB, select5.6version, otherwise default5.7
  4. TickAllow external access(Default ticked)
  5. Click after installation is completeDetailsCopy root password

bt-docker-mysql.png

bt-docker-mysql-pass.png

Step 3: Install AnQiCMS

  1. In DockerApp StoreSearchanqicms
  2. ClickInstall

docker-bt-2.png

  1. Enter configuration information:
Configuration item Description
Website domain The domain name parsed to the server (such aswww.anqicms.com)
Database name DefaultanqicmsNeed to be modified when installing multiple sites
Database password MySQL root password copied in the previous step
Port Default8001Need to be modified to when installing multiple sites8002/8003etc.)

bt-docker-anqicms.png

  1. ClickConfirmWaiting for 1-5 minutes to complete installation

docker-bt-4.png

Step 4: Start using

Default account password after installation:

Project content
Default account admin
Default password 123456
Back-end address http://你的域名/system/

Second method of expansion: Add multiple sites through Baota reverse proxy

If you have already deployed AnQiCMS through Baota Docker and want to add more sites on the same server, you can use Baota'sreverse proxy sitefunction to implement, no need to create a new container.

Step 1: Add reverse proxy site

  1. Baota panel →websiteReverse ProxyAdd Reverse Proxy
  2. Fill in the following configuration:
Configuration item Fill in the content
Domain New site domain (such asdev.anqicms.com)
Target URL http://127.0.0.1:8001(Default port, if multiple containers are installed, fill in the corresponding port)

docker-bt-5.png

  1. ClickConfirmComplete creation

Step 2: Add a new site in the AnQiCMS backend

  1. Log in to the main site backend →Multi-site managementAdd a new site
  2. Enter the following information:
field Description
Site name Fill in according to the actual situation
Site root directory Start with/app/Start with, such as/app/dev_anqicms.com(Root directory of Docker container)
website address New site domain name, such ashttp://dev.anqicms.com
Administrator account Administrator account for the new site
Administrator password The administrator password of the new site
Database name New database name, such asdev_anqicms_com(Do not duplicate existing libraries)
Duplicate database information SelectReuse the default database account information(Docker environment has complete database permissions)
Select the template to use Select According to Requirement

docker-bt-11.png

  1. ClickConfirmComplete creation

Step 3: Use the new site

After creation, the new site can be accessed directly. The back-end address ishttp://新域名/system/.

docker-bt-12.png


Method three: 1Panel Docker Deployment

Step 1: Install MySQL and OpenResty

In 1PanelApp StoreInstall the following software:

  • OpenResty(As a reverse proxy instead of Nginx)
  • MySQL5.7+ or 8.0

Step 2: Create AnQiCMS container

  1. → Click the menu on the leftcontainercontainerTab →Create container
  2. Fill in the following configuration:
Project Fill in the content
name anqicms
Mirror Manual inputanqicms/anqicms:latest
Port (server) 8001(Change to when installing multiple sites)8002/8003etc.)
Port (container) 8001
Restart rules Restart after failure

1panel-1.png

1panel-2.png

  1. ClickConfirm

Step 3: Set reverse proxy

  1. → Click the menu on the leftwebsiteCreate a website
  2. SelectReverse Proxy

1panel-3.png

  1. Fill in the configuration:
Project Fill in the content
Main domain Parsed domain name, such astest.anqicms.com
Proxy address 127.0.0.1:8001

1panel-4.png

  1. ClickConfirm

Step 4: Initialize installation

  1. Browser accesshttp://test.anqicms.com
  2. Enter the initial installation interface
  3. Enter database information (Database host should be filled with MySQL container name or internal IP address)
  4. After installation is complete, visithttp://test.anqicms.com/system/Enter the backend

Method 4: aaPanel (Baota International Edition) Docker Deployment

Step 1: Install aaPanel

aaPanel Download Address:https://www.aaPanel.com/new/download.html

Step 2: Install Docker and AnQiCMS

  1. Log in to aaPanel
  2. Enter the Docker interface, install Docker (if not installed)
  3. InApp Storesearch inanqicms

aapanel-11.png

  1. ClickInstall

aapanel-12.png

  1. Enter domain and port (default8001)
  2. ClickConfirmWait for 1-5 minutes

aapanel-13.png

Step 3: Start using

The default account password is the same as Baota Docker deployment:

Project content
Default account admin
Default password 123456
Back-end address http://你的域名/system/

Docker deployment comparison summary

Deployment method Difficulty Applicable scenarios Do you need additional configuration
Docker command line ★★ Familiar with Docker developers Need to deploy MySQL separately
Docker Compose ★★ Development and Test Environment One-time configuration, one-click startup subsequent
Baota Docker Novice, quick experience Automatically handle MySQL and reverse proxy
1Panel Docker ★★ 1Panel User Need to manually configure reverse proxy
aaPanel Docker Users with overseas servers Automatically Process

❓ Can I deploy MySQL without Docker? Can I use the MySQL on the host machine?

Absolutely.You don't have to deploy MySQL with Docker. You can use the existing MySQL on the host machine or a remote MySQL service.

When initializing the installation, enter one of the following addresses for the database host:

MySQL Location Database Host Address Description
Host Machine (same server) host.docker.internal Special address for Docker to access the host machine internally
Host Machine (same server) 172.17.0.1 Host machine address of Docker's default bridge
Remote MySQL Server 公网IP或域名 Enter the accessible remote address
On the same Docker network 容器名称 Asanqicms-mysql(Must be on the same Docker network)

❓ Will data be lost if the Docker container is restarted or deleted? How to persistently save?

By default, the container's data will be lost.Because MySQL's data files are stored inside the container, the data will be lost after the container is deleted. The solution is to useData volume mount.

Using Docker Compose (the recommended method) has already automatically done data volume mount (./mysql-data:/var/lib/mysql), and the data will be stored inmysql-data/In the directory, the data is still retained after the container is restarted/deleted.

If usingdocker runStart with the command line, you can add it.-vParameter mounting data volume:

docker run -d --name anqicms-mysql \
  -e MYSQL_ROOT_PASSWORD=yourpassword \
  -v ./mysql-data:/var/lib/mysql \    # ← 这行就是数据持久化
  mysql:5.7

The AnQiCMS container itself (anqicms/anqicmsis a pure program, there is no persistent data, restarting will not lose the configuration.

❓ How to upgrade AnQiCMS in the Docker version?

Upgrade steps:

# 1. 拉取最新镜像
docker pull anqicms/anqicms:latest

# 2. 删除旧容器(数据不会丢失,因为 MySQL 在另一个容器中或使用数据卷挂载)
docker rm -f anqicms

# 3. 重新创建容器(使用同样的启动命令)
docker run -d --name anqicms -p 8001:8001 anqicms/anqicms:latest

# 4. 进入后台 → 工具 → 更新缓存 → 点击"更新数据库表结构"

If you are using Docker Compose:

docker compose pull     # 拉取最新镜像
docker compose up -d    # 重新创建容器

❓ After Docker deployment, are the templates and attachments stored in the container or the host machine? Can I directly modify the template file?

By default, the template and attachments are stored inside the container. Deleting the container will cause them to be lost, and the template files cannot be edited directly on the host machine.

Suggestion:If you plan to modify the template file, it is recommended to mount the template directory to the host machine:

# docker-compose.yml 中为 anqicms 服务添加
volumes:
  - ./template:/app/template    # 模板目录挂载到宿主机
  - ./public:/app/public        # 静态资源目录挂载到宿主机
  - ./data:/app/data            # 数据目录挂载到宿主机

Related articles

Manual deployment of AnQi CMS on the server

Use case: Linux servers without a panel (such as CentOS / Ubuntu), suitable for users familiar with command-line operations.Deployed by downloading the package, configuring Nginx reverse proxy, and MySQL database. Preparations A Linux server (CentOS 7+ or Ubuntu 20.04+) with Nginx and MySQL 5.6.35+ installed (recommended to use the LNMP one-click installation package) A domain name resolved to the server Downloaded AnQiCMS Linux installation package Installation steps Step 1: Download and unzip # Log in to the server ssh

2026-07-18

Installation of Anqi CMS - Deployment with PHPStudy (Xiao Pi panel)

The application scenario: Windows local development environment or Windows server. PHPStudy (Xiao Pi panel) integrates components such as Nginx, MySQL, PHP, and AnQiCMS runs through Nginx reverse proxy.Preparation has been completed PHPStudy (Xiaopi Panel) software running mode has been switched to Nginx + MySQL package A local test domain (such as dev.anqicms.com) or access using IP + port AnQiCMS Windows installation package has been downloaded Installation steps Step 1: Create a site Open PHPStudy

2026-07-18

Installation of Anqi CMS - Baota panel deployment

2.2 Tower Panel Deployment Applicable Version: Tower Panel 7.9.3+. Tower Panel Deployment is divided into two methods: traditional deployment (uploading installation packages, configuring reverse proxy) and Docker one-click deployment. This chapter will introduce the traditional deployment method first.Preparation A Linux server with Baota panel installed (CentOS / Ubuntu / Debian are all okay) A domain name resolved to the server (such as www.anqicms.com) MySQL 5.6.35+ installed (recommended 5.7+ or 8.0) Download AnQiCMS Linux package from the official website or GitHub Method one: Baota 7

2026-07-18

Download and install AnQi CMS

Introduce the various download channels of AnQi CMS installation package (official website, GitHub, mirror site), the method of version selection for different operating systems and architectures, and the file verification method of the installation package to ensure that the correct and complete version is downloaded.

2026-07-10

Source code compilation installation of AnQi CMS

Target audience: Developers who need secondary development, customization features, or whose needs cannot be met by the official binary packages. Difficulty: ⭐⭐⭐⭐ (requires familiarity with GoLang and command line operations) Prerequisites Software version requirements Description GoLang 1.13+ (recommended 1.25+) Compile Go source code Git any version Clone code repository MySQL 5.6.35+ Run database If GoLang has not been installed, please visit https://go.dev/dl/ to download and install.Clone from GitHub (recommended) git clone https://github

2026-07-18

Deployment of multiple sites on the same server for AnQi CMS

The AnQiCMS supports running multiple independent sites on the same server, each with its own domain name, database, template, and administrator. This chapter details the complete steps and注意事项 for multi-site configuration.Plan one: Multi-site management (recommended) Eligibility: A main AnQiCMS site that is already installed and running. This plan uses the built-in multi-site management feature of AnQiCMS, where all sites share the same AnQiCMS program but run independently.Do not copy the code multiple times. Preparations Have deployed and run a AnQiCMS main site (port 8001) The main station background has Multi-site management Menu permissions (default installed sites have it)

2026-07-18

Installation guide and initialization of AnQi CMS

When you first start AnQiCMS, you need to complete the initial installation, including configuring database connection information, setting up the administrator account password, specifying the site name, and other key steps, which are essential before the system can be officially used.When do you need to initialize The following situations require initialization installation: Scenario Description First deployment Fresh installation AnQiCMS Restore factory settings Clear data and reinstall If installed through Baota Docker or aaPanel Docker, the system will automatically complete the initialization (default account admin / password 123456), no manual initialization process is required.Initialization step Step 1: Ensure AnQiCMS is started

2026-07-18

Installation of AnQi CMS - Troubleshooting common installation issues

Summarize common problems and solutions during the installation of Anqi CMS, covering typical scenarios such as port occupation, database connection failure, blank page, permission error, and missing dependencies, to help users quickly locate and solve problems.Question 1: Port occupied. Phenomenon: After starting AnQiCMS, the website cannot be accessed. Reason: The default port 8001 is occupied by another program.Troubleshooting method: # On Linux / MacOS: Check which process is occupying port 8001 lsof -i:8001 # Example output: # COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME #

2026-07-18