Skip to content

Deployment Overview of Rocket.Chat on Server

Prerequisites and Basic Requirements

To successfully deploy Rocket.Chat on the server, the following requirements must be met:

  • Operating System: AlmaLinux or Ubuntu (Docker-managed installation required).

  • Privileges: Root access is necessary for configuration and container management.

  • Domain Configuration: The server must be configured to resolve the fully qualified domain name (FQDN) in the format rocketchat[Server ID].hostkey.in.

  • Ports:

  • Internal communication: Port 3000 (used by the Rocket.Chat application).

  • External access: Port 443 (HTTPS via the Nginx proxy).

FQDN of the Final Panel

The application is accessible via the following fully qualified domain name structure:

  • Format: rocketchat[Server ID].hostkey.in:443

  • Example: If the server ID is 123, the address is rocketchat123.hostkey.in.

File and Directory Structure

The deployment utilizes specific directories for configuration files, data storage, and certificates:

  • Application Data: /opt/rocketchat

  • Contains the rocketchat-compose repository.

  • Hosts the .env configuration file.

  • Nginx Configuration:

  • Directory: /root/nginx (contains compose.yml).

  • Configuration files: /data/nginx/user_conf.d/rocketchat[Server ID].hostkey.in.conf.

  • SSL Certificates: Managed via the nginx_secrets volume, mounted at /etc/letsencrypt within the Nginx container.

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

Application Installation Process

Rocket.Chat is deployed using Docker Compose with the following version parameters:

  • Rocket.Chat Version: 8.1.0

  • MongoDB Version: 8.2

  • Repository: The deployment clones the official rocketchat-compose repository from https://github.com/RocketChat/rocketchat-compose.git into /opt/rocketchat.

  • Environment File: The .env file is generated within /opt/rocketchat containing version definitions and the domain root URL.

Docker Containers and Their Deployment

The system utilizes two primary Docker Compose stacks:

Rocket.Chat Stack

  • Project Source: /opt/rocketchat

  • Compose Files:

  • compose.database.yml (MongoDB service)

  • compose.yml (Rocket.Chat application)

  • Execution: The stack is started using the Docker Compose V2 plugin.

Nginx and Certbot Stack

  • Project Source: /root/nginx

  • Image: jonasal/nginx-certbot:latest

  • Purpose: Handles SSL termination via Certbot and reverse proxying to the internal Rocket.Chat service.

  • Network Mode: Host.

Proxy Servers

Nginx is configured as the reverse proxy to handle external traffic and SSL termination.

  • Proxy Configuration: The Nginx server listens on port 443 and forwards requests to the internal Rocket.Chat service at 127.0.0.1:3000.

  • Certbot Integration: The Nginx container includes Certbot to automatically obtain and renew SSL certificates for the domain.

  • Configuration File: The proxy pass rule is defined in /data/nginx/user_conf.d/rocketchat[Server ID].hostkey.in.conf.

  • Environment Variable: The CERTBOT_EMAIL is set to [email protected] for certificate notifications.

Databases

Rocket.Chat uses MongoDB as its backend database.

  • Version: 8.2

  • Deployment Method: Managed via Docker Compose using compose.database.yml.

  • Location: Data is stored within the Docker volume system associated with the Rocket.Chat stack in /opt/rocketchat.

Available Ports for Connection

  • Port 3000: Internal port for the Rocket.Chat application (accessible only within the container network or localhost).

  • Port 443: External port for secure HTTPS access via the Nginx proxy.

Permission Settings

File and directory permissions are set during the deployment process to ensure security and proper function:

  • /opt/rocketchat:

  • Owner: root

  • Group: root

  • Mode: Standard directory permissions apply.

  • /opt/rocketchat/.env:

  • Owner: root

  • Group: root

  • Mode: 0644 (Read-only for group/others).

  • /root/nginx:

  • Owner: root

  • Group: root

  • Mode: 0755.

  • /root/nginx/compose.yml:

  • Owner: root

  • Group: root

  • Mode: 0644.

Starting, Stopping, and Updating

Service management is handled via Docker Compose commands targeting the specific project directories.

Rocket.Chat Stack

  • To start or update:

    docker compose -f compose.database.yml -f compose.yml -p rocketchat up -d
    
    (Note: Run from the /opt/rocketchat directory)

  • To stop:

    docker compose -f compose.database.yml -f compose.yml -p rocketchat down
    

Nginx Proxy Stack

  • To start or update:

    docker compose -p nginx up -d
    
    (Note: Run from the /root/nginx directory)

  • To stop:

    docker compose -p nginx down
    

Location of Configuration Files and Data

The following table summarizes the key configuration locations:

Component File Path / Directory Description
Rocket.Chat Environment /opt/rocketchat/.env Defines version, domain, and port settings.
Rocket.Chat Source /opt/rocketchat/ Contains compose.yml and compose.database.yml.
Nginx Compose Definition /root/nginx/compose.yml Defines the Nginx and Certbot container.
Nginx Site Config /data/nginx/user_conf.d/rocketchat[Server ID].hostkey.in.conf Custom proxy_pass configuration.
Nginx Environment /data/nginx/nginx-certbot.env Environment variables for the Nginx stack.
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×