Skip to content

Deployment Overview of BrainyCP on Server

Prerequisites and Basic Requirements

The following requirements must be met before deploying the BrainyCP application:

  • 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: Port 8000.

  • External secure access: Port 443.

FQDN of the Final Panel

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

Replace <Server ID> with the specific identifier assigned to the server instance.

File and Directory Structure

The application and its supporting components are organized in the following locations:

  • Installation Directory: /usr/local/brainycp

  • Installer Script: /root/install.sh

  • Nginx Configuration Directory: /root/nginx

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

  • Nginx Environment File: /data/nginx/nginx-certbot.env

  • SSL Certificates Storage: /etc/letsencrypt (mounted via Docker volume)

Application Installation Process

The BrainyCP application is installed using a non-interactive shell script. The process involves the following steps:

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

  2. If not present, ensure the wget utility is installed via the apt package manager.

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

  4. Execute the installer with automatic confirmation of all checks 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 by Docker containers defined in a Compose file.

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

Container Configuration:

  • Service Name: nginx

  • Image: jonasal/nginx-certbot:latest

  • Restart Policy: unless-stopped

  • Network Mode: host

  • Environment Variables:

  • CERTBOT_EMAIL: [email protected]

  • Volumes:

  • nginx_secrets (external) mounted to /etc/letsencrypt.

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

Deployment Command: To start or update the containers, execute the following command from the /root/nginx directory:

docker compose up -d

Proxy Servers

The deployment utilizes Nginx within a Docker container to handle reverse proxying and SSL termination via Certbot.

Configuration Details:

  • The Nginx configuration file for the specific instance is located at /data/nginx/user_conf.d/brainycp<Server ID>.hostkey.in.conf.

  • The proxy is configured to forward traffic from the external port to the internal application port.

  • The proxy_pass directive is set to http://127.0.0.1:8002 within the location block.

  • SSL certificates are managed automatically by the nginx-certbot container using the Let's Encrypt service.

Permission Settings

The following permissions are applied to critical directories and files:

  • /root/nginx: 0755 (Owner: root, Group: root).

  • /root/nginx/compose.yml: 0644 (Owner: root, Group: root).

  • /root/install.sh: 0700 (Owner: root).

Location of Configuration Files and Data

Key configuration and data files are stored in the following paths:

  • Main Application: /usr/local/brainycp

  • Docker Compose Definition: /root/nginx/compose.yml

  • Nginx Environment Variables: /data/nginx/nginx-certbot.env

  • Custom Nginx Site Config: /data/nginx/user_conf.d/brainycp<Server ID>.hostkey.in.conf

  • SSL Certificates: /etc/letsencrypt (via Docker volume mount)

Available Ports for Connection

The system exposes the following ports for connectivity:

  • Port 443: HTTPS traffic for external access to the BrainyCP panel.

  • Port 8000: Internal communication port for the BrainyCP application.

  • Port 8002: Internal proxy target port used by the Nginx container to forward requests.

Starting, Stopping, and Updating

Service management for the proxy and SSL components is handled via Docker Compose.

  • Start/Update Containers:

    cd /root/nginx
    docker compose up -d
    

  • Stop Containers:

    cd /root/nginx
    docker compose down
    

  • View Logs:

    docker compose logs -f
    

The BrainyCP application service itself is managed by the system's native service manager after the initial installation and reboot.

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