Skip to content

Deployment Overview of BrainyCP on Server

Prerequisites and Basic Requirements

  • Operating System: Ubuntu (compatible with apt package manager).

  • Privileges: Root access is required for installation and configuration.

  • Domain: The application is configured for the hostkey.in zone.

  • Ports:

  • Internal communication: 8000

  • External HTTPS access: 443

FQDN of the Final Panel

The fully qualified domain name for accessing the panel follows the format: brainycp<Server ID>.hostkey.in:443

File and Directory Structure

The deployment utilizes the following directory structure for configuration, data, and certificates:

  • Application installation directory: /usr/local/brainycp

  • Installer script location: /root/install.sh

  • Nginx configuration directory: /root/nginx

  • Nginx user configuration directory: /data/nginx/user_conf.d

  • Let's Encrypt secrets volume mount: /etc/letsencrypt (mapped from nginx_secrets)

Application Installation Process

The BrainyCP application is installed using a shell script provided by the developer. The process involves the following steps:

  1. Verify if the installation directory /usr/local/brainycp exists.

  2. If not present, ensure the wget utility is installed.

  3. Download the installer script from http://core.brainycp.com/install.sh to /root/install.sh.

  4. Execute the installer non-interactively using the command:

    yes | bash ./install.sh
    

  5. Reboot the server immediately after a successful installation to finalize the setup.

Docker Containers and Their Deployment

The reverse proxy and SSL management are handled via Docker containers using a docker compose configuration.

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

  • Service Name: nginx

  • Image: jonasal/nginx-certbot:latest

  • Restart Policy: unless-stopped

  • Network Mode: host

  • Environment Variables:

  • CERTBOT_EMAIL: [email protected]

  • Volume Mounts:

  • nginx_secrets (external volume) mapped to /etc/letsencrypt

  • /data/nginx/user_conf.d mapped to /etc/nginx/user_conf.d

To start the container stack, execute the following command from the /root/nginx directory:

docker compose up -d

Proxy Servers

The deployment utilizes Nginx with Certbot for SSL termination and reverse proxying.

  • Proxy Target: The Nginx configuration forwards traffic to the internal application service at http://127.0.0.1:8002.

  • Configuration File: The specific site configuration is located at /data/nginx/user_conf.d/brainycp<Server ID>.hostkey.in.conf.

  • SSL Management: Handled automatically by the nginx-certbot container using the letsencrypt volume.

Starting, Stopping, and Updating

Service management for the proxy layer is performed using Docker Compose commands within the /root/nginx directory.

  • Start/Restart:

    cd /root/nginx
    docker compose up -d
    

  • Stop:

    cd /root/nginx
    docker compose down
    

  • Update: To update the container image, pull the latest version and restart the service:

    cd /root/nginx
    docker compose pull
    docker compose up -d
    

Available Ports for Connection

  • Port 443: External HTTPS access for the BrainyCP panel.

  • Port 8000: Internal port defined for the application (used internally by the system).

  • Port 8002: Internal port used by the Nginx proxy to forward requests to the application backend.

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