As a senior security enterprise CMS website operation personnel, I know that the ease of deployment of the content management system (CMS) is crucial for efficient operation.The AnQi CMS, developed with Go language, brings high performance, security, and SEO-friendly features, becoming the preferred choice for many small and medium-sized enterprises and content operation teams.Today, I will give you a detailed introduction on how to use Docker container technology to quickly and stably install and run AnQiCMS through mainstream server panels such as 1Panel or aaPanel.

Docker technology as a lightweight, portable containerization solution greatly simplifies the deployment and management process of software.Whether it is updating, migrating, or expanding, Docker can provide a consistent and efficient environment.For AnQiCMS, deploying it in a Docker container means you can avoid complex environment configuration and focus on content creation and operation itself.

Preparation: Infrastructure construction

Before starting the installation of AnQiCMS, your server needs to complete some basic settings.First, make sure that your server has Docker installed.If you are using the 1Panel or aaPanel panel, these panels usually provide a simple Docker installation entry.Moreover, AnQiCMS needs a database to store data, MySQL is recommended.Finally, you will need a domain and resolve it correctly to your server's IP address.

Install AnQiCMS via 1Panel

1Panel is a powerful modern server operation and maintenance panel. If you have not installed 1Panel yet, please refer to its official website(https://1panel.cn/) for installation instructions.

Core dependency installation

After logging into the 1Panel dashboard, we need to install several key components required for AnQiCMS to run. Access the 1Panel App Store, search, and installOpenRestyandMySQLOpenResty will act as the reverse proxy server for AnQiCMS, while MySQL provides support for data storage.

Create AnQiCMS container

Next, we will create an AnQiCMS Docker container instance in 1Panel.Navigate to the "Container" section of the left menu, select the "Container" tab, and then click the "Create Container" button.

In the pop-up configuration interface, specify an easily recognizable name for your AnQiCMS container, for exampleanqicmsIn the "Image" option, select "Manual Input" and then enter the official Docker image address of AnQiCMS:anqicms/anqicms:latest. Port configuration is a critical step. Set the server port and container port at the "Expose Port" location.8001. If you plan to deploy multiple AnQiCMS instances on the same server, make sure each instance uses a different server port (for example8002/8003), but keep the container port consistent.8001Unchanged.

Continue scrolling down, in the 'Restart Strategy' section, it is recommended to select 'Restart after failure' or 'Restart if not manually stopped', this helps ensure that AnQiCMS can automatically recover and run after unexpected situations, improving the stability of the website.After completing the above configuration, click the "Confirm" button, 1Panel will start creating your AnQiCMS container.

Configure reverse proxy site

After the container is created, we need to forward external domain requests to the internal port of the AnQiCMS container through a reverse proxy.Go to the 'Website' section on the left menu, click the 'Create Website' button.

In the pop-up interface, select the "Reverse Proxy" type. In the "Primary Domain" field, enter your preset domain name, for exampletest.anqicms.com. Enter the proxy address in the "Proxy Address" field,127.0.0.1:8001. If you previously configured the AnQiCMS container with non8001The server port, here you need to fill in the corresponding port according to the actual situation. Finally, click "Confirm" to complete the creation of the reverse proxy site.

Install AnQiCMS via aaPanel

aaPanel (Bt international version) is another popular server control panel, also provides a convenient way to install AnQiCMS via Docker. If your server has not installed aaPanel, please visit its official website (https://www.aapanel.com/new/download.htmlPlease choose the appropriate installation command for deployment according to your operating system.

Docker and MySQL environment deployment

After logging into the aaPanel panel, you first need to install Docker.You can search for and install "Docker" in the "App Store".AnQiCMS needs MySQL database. After the Docker installation is complete, you can search for and install MySQL in the Docker App Store.Choose the version suitable for your server memory (below 2GB, recommend 5.6, otherwise 5.7 or higher), and be sure to check 'Allow external access'.After installation, click on MySQL details, copy the root user's password, as it will be needed later when installing AnQiCMS.

One-click installation of AnQiCMS application

After the Docker environment is ready, go to the 'App Store' of aaPanel, searchAnQiCMSIn the search results, click the 'Install' button to enter the installation interface.

In the installation settings, you need to fill in the website's "Domain" (domain) and the "Port" (port) that AnQiCMS listens to, the default is usually8001. If you plan to run multiple AnQiCMS instances on the same server, please allocate a different port for each instance (for example8002/8003),to avoid conflicts. In addition, you need to provide the relevant information of the MySQL database, including the database name and the copied MySQL root password.

Click "Confirm" and aaPanel will start deploying AnQiCMS.This process may take 1 to 5 minutes. If an error occurs during installation, please check the error message and then click "Restart" to retry.If the automatic installation of the reverse proxy fails, you can also manually go to the “Website” menu, select “Add Site” and configure “Reverse Proxy”, pointing the domain to the internal address of the Docker container, for examplehttp://127.0.0.1:8001.

Website initialization and daily management

No matter whether you choose 1Panel or aaPanel for deployment, after the AnQiCMS installation is completed, you can access it through your domain name (such ashttp://test.anqicms.com/Visit the website to perform the initial installation.

On the initialization interface, you need to configure database connection information, set up the background administrator account and password. After completing the initialization, your AnQiCMS site can run normally.

Access the admin interface, please add your domain name after/system/For examplehttp://test.anqicms.com/system/. Please change the default administrator account and password when you first log in to ensure the website security.AnQiCMS powerful content management, SEO optimization, multi-site support, and other functions will help you efficiently carry out website operation.

Frequently Asked Questions

Q1: After installing AnQiCMS in Docker, how to manage multiple sites?AnQiCMS natively supports multi-site management. In the Docker environment, you can achieve this in two ways: first, deploy an AnQiCMS Docker container independently for each site, with each container listening on a different host port, and then use the panel's reverse proxy to direct different domain names to the corresponding container ports;It is in an AnQiCMS container, using its background "multi-site management" feature to add and manage multiple websites.For the second method, you need to configure a separate domain and reverse proxy for each new site in the panel, and then proxy these requests to the same AnQiCMS container instance, and then configure it in the AnQiCMS background.

Q2: How should you handle the issue of a port being occupied?If you encounter a prompt indicating that the port is occupied when creating a Docker container or setting up a reverse proxy, this means that the port you are trying to use is already occupied by another program on the server.You can try to change to an unused port. You can use it under Linux system,lsof -i:{端口号}Command to check the occupancy of a specific port. If you need to release the occupied port, you can usekill -9 {PID}Command (wherein{PID}is the process ID of the occupied port).

Q3: I forgot the database password of AnQiCMS, how can I find or reset it in the Docker environment?If you forget the MySQL database password used by AnQiCMS, you can log in to your 1Panel or aaPanel dashboard, go to the MySQL management interface to view or reset the root user's password.These options can usually be found in the 'Details' or 'Settings' of MySQL.After resetting your password, you need to update the database connection information in the AnQiCMS configuration file (if AnQiCMS has already been initialized and installed), or use the new password when initializing AnQiCMS next time.