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 isrocketchat123.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-composerepository. -
Hosts the
.envconfiguration file. -
Nginx Configuration:
-
Directory:
/root/nginx(containscompose.yml). -
Configuration files:
/data/nginx/user_conf.d/rocketchat[Server ID].hostkey.in.conf. -
SSL Certificates: Managed via the
nginx_secretsvolume, mounted at/etc/letsencryptwithin 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-composerepository fromhttps://github.com/RocketChat/rocketchat-compose.gitinto/opt/rocketchat. -
Environment File: The
.envfile is generated within/opt/rocketchatcontaining 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
443and forwards requests to the internal Rocket.Chat service at127.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_EMAILis 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:
(Note: Run from the/opt/rocketchatdirectory) -
To stop:
Nginx Proxy Stack
-
To start or update:
(Note: Run from the/root/nginxdirectory) -
To stop:
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. |