Skip to content

Deployment Overview of CloudPanel on Server

Prerequisites and Basic Requirements

The deployment of CloudPanel requires a fresh installation on an Ubuntu-based server. The system must have root privileges to execute installation scripts and manage services. Before proceeding, ensure the following conditions are met:

  • The server must run a supported Ubuntu operating system.

  • Root access (sudo privileges) is required for all installation and configuration steps.

  • Ports 80, 443, and 3306 must be available and not occupied by other services such as nginx, apache2, mysql, or mariadb.

  • Existing database installations (MySQL, MariaDB, Percona) and web servers will be purged and removed to prevent conflicts.

FQDN of the Final Panel

The fully qualified domain name (FQDN) for accessing the CloudPanel interface is constructed using the provided prefix and server ID within the hostkey.in zone. The access URL follows this format:

  • Domain Structure: cloudPanel<Server ID>.hostkey.in

  • External Port: 443 (HTTPS)

  • Internal Path: /

  • Full URL Example: cloudPanel<Server ID>.hostkey.in:443

File and Directory Structure

The application installs configuration files, logs, and data in specific locations on the host server. Key directories include:

  • Application Configuration: /etc/cloudpanel

  • SSL Certificates: Managed within Docker volumes linked to /etc/letsencrypt inside the container.

  • Nginx User Configuration: /data/nginx/user_conf.d

  • Docker Compose for Proxy: /root/nginx/compose.yml

Application Installation Process

CloudPanel is installed using the official installer script, which is downloaded and executed with specific modifications to ensure compatibility with the required database version.

  1. System Preparation: Existing database and web server services (mysql, mariadb, nginx, apache2) are stopped and disabled.

  2. Package Removal: Any existing installations of CloudPanel, MySQL, MariaDB, or Percona are removed, and their data directories (/var/lib/mysql, /etc/mysql, /var/run/mysqld) are deleted.

  3. Dependency Installation: Essential packages such as curl, wget, lsof, ca-certificates, and gnupg are installed.

  4. Installer Execution: The installer is downloaded from https://installer.cloudpanel.io/ce/v2/install.sh to /root/cloudpanel-install.sh.

  5. Script Modification: The installer script is patched to use MYSQL_8.0 instead of the default engine and allows package downgrades during the upgrade process.

  6. Final Installation: The script is executed to deploy CloudPanel, creating the directory /etc/cloudpanel upon success.

Docker Containers and Their Deployment

A proxy container is deployed to manage SSL certificates and routing for the CloudPanel instance. This container is managed via Docker Compose.

  • Container Image: jonasal/nginx-certbot:latest

  • Deployment Method: docker compose up -d

  • Working Directory: /root/nginx

  • Configuration File: /root/nginx/compose.yml

The Docker Compose configuration includes:

  • Restart Policy: unless-stopped

  • Network Mode: host

  • Volume Mounts:

  • nginx_secrets (external volume) mapped to /etc/letsencrypt for SSL storage.

  • Host directory /data/nginx/user_conf.d mapped to /etc/nginx/user_conf.d for custom configurations.

  • Environment Variables:

  • CERTBOT_EMAIL: Set to [email protected].

Proxy Servers

The application utilizes an Nginx-based proxy container to handle SSL termination via Certbot. This setup ensures that traffic to the hostkey.in domain is encrypted and routed correctly.

  • Proxy Software: Nginx (via Docker container)

  • SSL Provider: Let's Encrypt (Certbot)

  • Certificate Email: [email protected]

  • Custom Domain Support: Configured via files in /data/nginx/user_conf.d.

  • Routing: The proxy configuration redirects traffic for cloudPanel<Server ID>.hostkey.in to the internal CloudPanel service.

Permission Settings

File and directory permissions are set during the installation and Docker deployment phases to ensure security and proper functionality.

  • Nginx Config Directory: /root/nginx

  • Owner: root

  • Group: root

  • Mode: 0644

  • Compose File: /root/nginx/compose.yml

  • Owner: root

  • Group: root

  • Mode: 0644

  • Custom Config Directory: /data/nginx/user_conf.d

  • Accessible by the Nginx container via volume mount.

Available Ports for Connection

The deployment configures the following ports for internal and external communication:

Port Direction Protocol Description
8443 Internal HTTPS Internal communication between the proxy and CloudPanel service.
443 External HTTPS Public access to the CloudPanel web interface via the proxy.
80 External HTTP Used for SSL certificate renewal (HTTP challenge) by Certbot.
3306 Internal/External MySQL Database connection port (must be free before installation).

Starting, Stopping, and Updating

Service management is handled through the Docker Compose CLI for the proxy and standard service commands for the main application.

  • Start Proxy Container:

    cd /root/nginx
    docker compose up -d
    

  • Stop Proxy Container:

    cd /root/nginx
    docker compose down
    

  • Check Proxy Status:

    docker ps
    

  • Main Service Management: The CloudPanel service runs as a managed service. To restart the Nginx service if required:

    systemctl restart nginx
    

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×