How to deploy AnQiCMS using Docker, for example with 1Panel or aaPanel?
As an experienced website operator familiar with Anqin CMS, I fully understand the importance of efficient deployment for enterprise content management.AnQiCMS with its efficiency in Go language, flexible customization capabilities, and easy scalability, has become an ideal choice for small and medium-sized enterprises and content operation teams.By combining Docker technology, the deployment experience of AnQiCMS has been significantly improved, especially with the assistance of panels like 1Panel or aaPanel, making the entire process unprecedentedly convenient and efficient.
Advantages of Docker-based deployment of AnQiCMS
AnQiCMS as an enterprise-level content management system developed based on the Go language, is inherently equipped with high performance and high concurrency features.Deployed inside a Docker container, further enhancing these advantages and introducing additional convenience.Docker provides a lightweight, portable, and self-sufficient runtime environment, packaging AnQiCMS and all its dependencies together, ensuring consistent performance of the application across different server environments.This means that AnQiCMS can run in the same way whether you are in the development, testing, or production environment, greatly reducing the issue of 'it works on my machine'.
Moreover, Docker's containerization feature brings excellent isolation.Each AnQiCMS instance runs in an independent container, with no interference between them, which enhances the security and stability of the system.For applications like AnQiCMS that emphasize content security, anti-crawling, watermark management, and other functions, container isolation is undoubtedly an additional safeguard.At the same time, Docker also simplifies the expansion and upgrade process of AnQiCMS.Whether it is horizontal expansion to cope with high traffic or version iteration updates, they can be completed quickly without affecting other services, which is consistent with the modular design concept of AnQiCMS.Combine with management panels like 1Panel or aaPanel, deploying and managing these Docker containers becomes intuitive and easy to use, even for operation personnel without a technical background.
Process of deploying AnQiCMS using 1Panel
1Panel provides a modern Web interface for managing servers and Docker containers, making the deployment of AnQiCMS very intuitive.
First, you need to install 1Panel on the server. The official website of 1Panel is (https://1panel.cn/ provided detailed installation instructions, please choose the appropriate command for your server operating system to install.After installation, it is recommended to install OpenResty (as a replacement for Nginx, used for reverse proxy) and MySQL (as a database service) in the 1Panel app store.
When 1Panel and its required software are ready, you can start deploying the AnQiCMS container.Navigate to the 'Container' section in the left menu of 1Panel, select the 'Container' tab, and then click the 'Create Container' button.In the pop-up configuration interface, you need to fill in the basic information of the container:
In the "Name" field, you can enter "anqicms" or any other easily identifiable name.Check the 'Mirror' option under 'Manual Input' and then enter the official Docker image name of AnQiCMS in the input box:anqicms/anqicms:latest.
In the "Port" settings, select "Expose Port", and set both the "Server Port" and "Container Port" to8001. It is worth noting that,8001Is the default port listened to by the AnQiCMS container. If you plan to deploy multiple independent AnQiCMS containers on the same server (instead of using the built-in multi-site feature of AnQiCMS), then the "server port" of each AnQiCMS container needs to be set to a different port number, for example8002/8003But the "container port" should remain8001Do not change. Scroll down to the 'Restart Strategy' section where you can choose 'Restart after failure' or 'Restart if not manually stopped' to ensure that the AnQiCMS service can recover automatically after an unexpected stop.
Finally, click the “Confirm” button, 1Panel will start creating and launching the AnQiCMS Docker container.
After the container is successfully created, the next step is to configure reverse proxy to access your AnQiCMS website through the domain name.In the left menu of 1Panel, select the 'Website' section, then click the 'Create Website' button.In the pop-up interface, select the 'Reverse Proxy' option.
In the 'Primary Domain' field, enter the domain name you wish to use to access the AnQiCMS website, for exampletest.anqicms.com.
Fill in the "proxy address" field.127.0.0.1:8001. The IP address points to the local server, and the port number corresponds to the 'server port' setting of your AnQiCMS container.If you have previously set a different server port for the AnQiCMS container (such as8002), then the corresponding port should also be filled in here.
Click "OK" to complete the creation of the site.
After completing the above steps, you can enter the domain name you have configured in the browser (for examplehttp://test.anqicms.com/) Visit AnQiCMS. When you visit for the first time, the system will guide you to the initialization installation interface, where you will complete necessary steps such as database configuration and administrator account setup.After installation, your AnQiCMS website can be used normally, the background access address is usually您的域名/system/.
The practice of deploying AnQiCMS using aaPanel
aaPanel (BaoTa International Edition) is also a widely popular server management panel, which supports Docker deployment and provides a convenient graphical user interface.
First, make sure that your server is installed with aaPanel. If you have not installed it, please visit the aaPanel official website (https://www.aapanel.com/new/download.html), follow the instructions to obtain the installation command and execute it on the server.
After the Docker environment is ready, you can install AnQiCMS through the "App Store" of aaPanel.In the aaPanel control panel, navigate to the Docker management interface, and then click 'App Store'.Enter "AnQiCMS" in the search box to search.
Found AnQiCMS in the search results, click the "Install" button to enter the installation configuration interface.In the installation settings, you need to fill in the "Domain" field, enter the website domain you wish to use, and set the "Port" to8001. This8001Is the default port inside the AnQiCMS container. Click 'Confirm' to start the installation.The installation process may take 1-5 minutes, please be patient.If an error occurs during installation, please check the error message and try clicking the "Restart" button to reinstall.If the automatic installation fails to configure the reverse proxy successfully, you may need to set it up manually.This usually involves adding a new website under the 'Website' menu in aaPanel, selecting 'Reverse proxy', and then pointing your domain to127.0.0.1:8001(Or you can configure other server ports for the AnQiCMS container).
AnQiCMS through aaPanel's Docker one-click deployment usually pre-installs the website and sets default credentials.
Default admin account:adminDefault admin password:123456Back-end access address:您的域名/system/For example, if your website domain ishttp://test.anqicms.com/The backend access address ishttp://test.anqicms.com/system/. It is strongly recommended to change the default administrator account and password immediately after your first login to ensure website security.
Multi-site management of AnQiCMS in Docker environment
AnQiCMS itself has powerful multi-site management functions, which are also applicable in the Docker environment and can be managed more centrally and efficiently.Deploy an AnQiCMS Docker container instance on a server, which can host multiple independent websites simultaneously.
The core principle is that all external domain requests are forwarded to the same AnQiCMS Docker container through reverse proxies on the server (such as Nginx, OpenResty, etc., configured by 1Panel or aaPanel)8001Port. After receiving the request, the AnQiCMS container will identify which site to provide the corresponding website content based on the domain name (identified through the HTTP Host header).
To add a new site on Dockerized AnQiCMS: First, configure reverse proxy for the new domain in your 1Panel or aaPanel. Point the new domain to the server port of the AnQiCMS Docker container (usually127.0.0.1:8001).
Next, log in to the back-end management interface of the AnQiCMS main site you have deployed.Find the "Multi-site Management" feature in the left menu.
Click "Add New Site" and fill in the details of the new site:
- Site name: Used for background recognition, can be customized.
- Site root directory: This path should start with
/app/, followed by a directory named based on the new domain name (for example, changenew.anqicms.comto replace dots with underscores, becoming/app/new_anqicms_com), used to store the independent cache and other data of the site, ensuring that it does not duplicate with other site directories. - website address: The complete URL of the new site, for example
http://new.anqicms.com. - Administrator account password: Set the background login credentials for the new site.
- Database nameSpecify a new database name for the new site, and it is recommended to name it based on the domain name (for example
new_anqicms_com) - Duplicate database informationDue to the AnQiCMS Docker container usually being used with a MySQL Docker container, you can choose to reuse the database connection information of the main site, and AnQiCMS will automatically create the table structure in the new database.
- Select the template to use: Select a default template for the new site.
Click "OK" to complete the creation of the new site. You can directly enter the admin panel of the new site from the "Visit Backend" button in the multi-site management list, or directly access the new domain name in the browser and add/system/Path. This method avoids the resource overhead of copying AnQiCMS code and launching independent containers for each site, achieving efficient multi-site hosting.
Conclusion
Deploy AnQiCMS by combining Docker with 1Panel or aaPanel, whether it is a content operation team or a small and medium-sized enterprise, can obtain a high-performance, secure, and easy-to-manage content publishing platform with the lowest technical threshold.This modern deployment method not only simplifies the initial setup, but also lays a solid foundation for future expansion and maintenance, allowing you to focus more on high-quality content creation and website operation, thereby attracting and retaining your users.
Frequently Asked Questions (FAQ)
Q1: How to deploy multiple independent AnQiCMS Docker container instances on the same server instead of using the built-in multi-site function of AnQiCMS?
A1:If you wish to deploy multiple completely independent AnQiCMS Docker containers (each with its own database and a separate AnQiCMS application), rather than using AnQiCMS's built-in multi-site feature to manage multiple logical sites within a single container, you will need to assign different 'server ports' and independent MySQL databases to each AnQiCMS container when creating them. For example, the server port for the first AnQiCMS container is8001And connectmysql_db1The server port of the second container is8002And connectmysql_db2. Then, you need to configure independent reverse proxy for each AnQiCMS instance in 1Panel or aaPanel, and point the respective domains (such assite1.comandsite2.com) separately to127.0.0.1:8001and127.0.0.1:8002.
Q2: Why can't the website or backend be accessed after AnQiCMS Docker deployment?
A2:There may be multiple reasons for access issues. First, please check if the firewall (such asufwor security group settings) on the server is open for the website access you are using80and443Port, as well as the 'server port' mapping of the AnQiCMS Docker container (such as8001)。其次,确认反向代理配置是否正确,域名是否已解析到服务器IP,并且反向代理的目标地址是否指向了AnQiCMS容器正确的IP和服务器端口(通常