As an experienced CMS website operations personnel, I fully understand that the ease of deployment of the Content Management System (CMS) is crucial for efficient operation.AnQi CMS, developed with Go language, brings high performance, security, and SEO-friendly features, making it 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 1Panel or aaPanel, a mainstream server panel.
Docker technology as a lightweight, portable containerization solution greatly simplifies the deployment and management process of software.Whether it's updating, migrating, or scaling, 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 setup
Before starting the installation of AnQiCMS, your server needs to complete some basic settings.Firstly, ensure that your server has Docker environment installed.If you are using the 1Panel or aaPanel panel, these panels usually provide a simple Docker installation entry.In addition, AnQiCMS requires a database to store data, and MySQL is recommended.Finally, you will need a domain name and you need to 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 websitehttps://1panel.cn/) provided instructions to complete the installation.
Installation of core dependencies
After logging in to the 1Panel panel, we need to install several key components required for AnQiCMS to run. Visit the 'App Store' in 1Panel, search and installOpenRestyandMySQL. OpenResty will act as the reverse proxy server for AnQiCMS, while MySQL provides support for data storage.
Create AnQiCMS container
Next, we will create a Docker container instance for AnQiCMS 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 identifiable name for your AnQiCMS container, such asanqicmsIn the "Mirror" option, select "Manual Input", and then enter the official Docker image address of AnQiCMS in the input box:anqicms/anqicms:latestThe port configuration is a critical step. At the 'Exposed Ports' section, set both the server port and the container port to8001If you plan to deploy multiple AnQiCMS instances on the same server, please make sure each instance uses a different server port (for example8002/8003), but the container port always stays8001No change.
Continue scrolling down, in the 'Restart Strategy' section, it is recommended to choose 'Restart after failure' or 'Restart if not manually stopped', which helps ensure that AnQiCMS can automatically recover and run after unexpected situations, enhancing the stability of the website.After completing the 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 reverse proxy.Go to the 'Website' section on the left menu and click the 'Create Website' button.
In the popped-up interface, select the "reverse proxy" type. In the "main domain" field, enter your preset domain name, for exampletest.anqicms.com. At the "proxy address" input127.0.0.1:8001If you previously configured AnQiCMS container with a 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 (BaoTa International Edition) is another widely popular server control panel that also provides a convenient way to install AnQiCMS with Docker. If your server has not installed aaPanel yet, please visit its official website (https://www.aapanel.com/new/download.html),Choose the appropriate installation command based on your operating system to deploy.
Docker and MySQL environment deployment
Log in to the aaPanel dashboard first, and then install Docker.You can search and install "Docker" in the "App Store".AnQiCMS needs MySQL database.After Docker installation is complete, you can search and install MySQL in the Docker app store.Choose the version suitable for your server memory (recommend 5.6 for less than 2GB, otherwise 5.7 or higher), and make sure to check 'Allow external access'.After installation, click MySQL details and copy the root user's password, as it will be needed later when installing AnQiCMS.
One-click install AnQiCMS application
After the Docker environment is ready, go to the 'App Store' of aaPanel and searchAnQiCMSIn the search results, click the 'Install' button to enter the installation interface.
In the installation configuration, you need to fill in the website's "Domain" (domain name) and the "Port" (port) that AnQiCMS listens to, which is usually the default.8001If 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 also need to provide the relevant information about the MySQL database, including the database name and the MySQL root password you just copied.
After clicking "Confirm", aaPanel will begin to deploy AnQiCMS.This process may take 1 to 5 minutes.If an error occurs during the installation process, please troubleshoot according to the error prompts, and then click "Restart" to retry.http://127.0.0.1:8001.
Website Initialization and Daily Management
Whether you choose 1Panel or aaPanel for deployment, after AnQiCMS is installed, you can access it through your domain name (for example,http://test.anqicms.com/Access the website to perform the initial installation.
In the initialization interface, you need to configure the database connection information, set the background administrator account and password. After completing the initialization, your AnQiCMS site can run normally.
Access the background management interface, please add it to your domain name after your/system/for examplehttp://test.anqicms.com/system/.Please change the default administrator account and password when you first log in to ensure 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 is natively supported for multi-site management.In the Docker environment, you can achieve this in two ways: first, deploy an AnQiCMS Docker container for each site, with each container listening to a different host port, and then direct different domain names to the corresponding container ports through the panel's reverse proxy; second, in one AnQiCMS container, use its background 'multi-site management' feature to add and manage multiple websites.For the second method, you need to configure a separate domain name 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 backend.
Q2: How should you handle the issue of a port being occupied?If you encounter a port occupation prompt when creating a Docker container or setting up a reverse proxy, this means that the port you are trying to use has already been occupied by another program on the server.You can try changing to an unused port.lsof -i:{端口号}Command to check the occupation status 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 panel, 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" in MySQL.After resetting the password, you need to update the database connection information in the AnQiCMS configuration file (if AnQiCMS has been initialized and installed), or use the new password when initializing the AnQiCMS installation next time.