Skip to content

Deployment Overview of Zammad on Server

Prerequisites and Basic Requirements

To ensure a successful deployment, the server must meet the following requirements:

  • Operating System: Ubuntu or Debian.

  • Privileges: Root or sudo access is required for package installation and service management.

  • Dependencies: The system requires ca-certificates, curl, and git.

  • Docker Engine: Docker CE and the Docker Compose plugin must be installed and running.

FQDN of the final panel on the hostkey.in domain

The application is accessible via a specific subdomain generated based on the server ID. The template for this domain is as follows:

Parameter Value
Prefix zammad
Domain hostkey.in
Full template zammad{Server_ID_from_Invapi}.hostkey.in

Application installation process

The application is deployed using a combination of package management and Docker Compose:

  1. System Preparation: The system updates the package repository and installs necessary prerequisites (ca-certificates, curl, git).

  2. Docker Installation: The official Docker GPG key and repository are added to the system, followed by the installation of docker-ce and docker-compose-plugin.

  3. Application Deployment:

  4. The application files are retrieved from the official Zammad Docker Compose repository into /root/zammad-docker-compose.

  5. The deployment is executed using docker compose up -d within the application directory.

  6. Web Server Configuration: Nginx and Certbot are installed to act as a reverse proxy and handle SSL termination.

Access Rights and Security

  • Firewall/Ports: The server is configured to listen on port 80 (HTTP) for Let's Encrypt challenges and port 443 (HTTPS) for secure traffic.

  • Nginx Configuration: A site configuration is created in /etc/nginx/sites-available/zammad and symlinked to /etc/nginx/sites-enabled/zammad. The default Nginx configuration is removed to prevent conflicts.

  • Proxy Security: The application environment is configured with RAILS_TRUSTED_PROXIES=127.0.0.1/32 to ensure the application correctly identifies the client IP through the reverse proxy.

Docker Containers and Their Deployment

The deployment utilizes Docker Compose to manage the Zammad ecosystem. All containers are managed within /root/zammad-docker-compose. The primary service configuration includes:

Service Image Ports (Internal) Environment Variables / Notes
Zammad Application zammad/zammad (via compose) 8080 Configured for HTTPS via NGINX_SERVER_SCHEME and ZAMMAD_HTTP_TYPE

Note: Specific container images are managed by the Docker Compose file located in /root/zammad-docker-compose.

Custom Scripts and Additional Setup

Following the initial container startup, several configuration steps are performed to finalize the environment:

  • Environment Configuration: The .env file in /root/zammad-docker-compose is modified to set NGINX_SERVER_SCHEME=https, ZAMMAD_HTTP_TYPE=https, and trusted proxy settings.

  • Container Refresh: After updating the environment variables, the containers are restarted using docker compose down && docker compose up -d to apply changes.

  • SSL Provisioning: Certbot is used to obtain a Let's Encrypt SSL certificate for the configured FQDN. The process includes an automatic redirect from HTTP to HTTPS.

Application Update Instructions

To update the Zammad application, execute the following commands in the application directory:

cd /root/zammad-docker-compose
docker compose pull && docker compose up -d

Location of configuration files and data

  • Application Directory: /root/zammad-docker-compose

  • Nginx Configuration: /etc/nginx/sites-available/zammad

  • SSL Certificates: /etc/letsencrypt/live/{domain}/

  • Docker Environment Variables: /root/zammad-docker-compose/.env

Available ports for connection

  • HTTPS (Secure Web Access): 443

  • HTTP (Redirect only): 80

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