How to Install Zammad Ticketing System on CentOS 7

Zammad is an open source helpdesk/customer support system written in Ruby. It's a web-based ticketing system with many features, including support to manage customer communication over several channels like Facebook, telegram, chat, and emails. Zammad is distributed under the GNU AFFERO General public License (AGPL) and can be installed on different platforms like Linux, AIX, FreeBSD, OpenBSD, and MacOSX. It's available on Github and is free for install on your own server.

In this tutorial, I will show you how to install and configure Zammad Ticketing System using the Nginx web server and PostgreSQL for the database system. We will be using CentOS 7 server, and using SSL Letsencrypt to secure client-server connections.

What we will do

  1. Install Zammad Ticketing System
  2. Install and Configure Letsencrypt
  3. Configure Nginx Web server
  4. Zammad Configuration
  5. Zammad Additional Tips

Prerequisites

  • CentOS 7 System
  • At least 2GB RAM
  • Root Privileges

Step 1 - Install Zammad Ticketing System

Before installing Zammad ticketing system on CentOS 7, we need to install EPEL (Extra Packages for Enterprise Linux) repository for our Nginx web server installation.

Add EPEL repository by installing the epel package using the following yum command.

sudo yum -y install epel-release

EPEL repository has been added to the system.

Next, import the Zammad key with the rpm import command.

sudo rpm --import https://rpm.packager.io/key

Add the Zammad repository by creating a new .repo file in the 'yum.repos.d' directory using the vim editor.

vim /etc/yum.repos.d/zammad.repo

Paste the following info there.

[zammad]
name=Repository for zammad/zammad application.
baseurl=https://rpm.packager.io/gh/zammad/zammad/centos7/stable
enabled=1

That's it. Save and exit.

Now install Zammad using the following yum command.

sudo yum -y install zammad

Note: When we are installing Zammad, it will automatically install other required packages, including Nginx web server and PostgreSQL database.

And after the installation is complete, you will see the result similar to the one shown below.

Install zammad ticketing system

Zammad and other packages - Nginx web server and PostgreSQL database - have been installed.

Step 2 - Install and Configure Letsencrypt SSL

In this tutorial, we want to set up Zammad under Nginx HTTPS and using free SSL from the Letsencrypt. And we will do that in this step and use the certbot tool (Letsencrypt Agent) that can be installed from the repository.

Install certbot package tool from the repository using yum.

yum -y install certbot

Next, we need to generate new SSL certificates with the certbot tool. Make sure you have your own domain to generate the certificate files. We will use a domain name 'zammad.hakase-labs.com'.

Go to the Nginx configuration directory and open the nginx.conf file in the vim editor.

cd /etc/nginx/
vim nginx.conf

Paste the following configuration under the 'server {}' block.

        location ~ /.well-known {
                allow all;
        }

Save and exit. Then test the configuration and restart the web server.

nginx -t
systemctl restart nginx

Configure Nginx

Before generating SSL certificate files, make sure your system port for HTTP and HTTPS is not blocked by the firewall. You can open the HTTP and HTTPS ports on CentOS using the firewall-cmd command as shown below.

firewall-cmd --permanent --add-service=https
firewall-cmd --reload

Now generate SSL certificate files using the following certbot command.

certbot certonly --standalone -d zammad.hakase-labs.co

You will be asked about your email address for renewing notification - type your email address and press 'Enter' to continue. For Letsencrypt Term Of Services (TOS), type 'A' to agree. Similarly, when asked to share email with EFF Foundation, just type 'N' for no.

Create the SSL certificate

When the certbot command is complete, you will see the result as shown below.

Certbot command finished successfully

New SSL certificate files for our Zammad installation has been generated. All certificates are in the '/etc/letsencryp/live/' directory.

Step 3 - Configure Nginx Web server

In this step, we will configure a virtual host file for Zammad. It's automatically created in the '/etc/nginx/conf.d/' directory during zammad installation.

Go to the '/etc/nginx/conf.d/' and edit the zammad.conf file.

cd /etc/nginx/conf.d/
vim zammad.conf

Change all configuration as shown below.

#
# this is the Nginx config for zammad
#

upstream zammad {
    server localhost:3000;
}

upstream zammad-websocket {
    server localhost:6042;
}

server {
    listen 80;
    server_name zammad.hakase-labs.co;
    return 301 https://$host$request_uri;
}

server {
    listen 443 http2 ssl;

    ssl_certificate /etc/letsencrypt/live/zammad.hakase-labs.co/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/zammad.hakase-labs.co/privkey.pem;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
    ssl_ecdh_curve secp384r1;
    ssl_session_cache shared:SSL:10m;
    ssl_session_tickets off;
    ssl_stapling on;
    ssl_stapling_verify on;
    resolver 8.8.8.8 8.8.4.4 valid=300s;
    resolver_timeout 5s;
    add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;

    # replace 'localhost' with your fqdn if you want to use zammad from remote
    server_name zammad.irsyadf.me;

    root /opt/zammad/public;

    access_log /var/log/nginx/zammad.access.log;
    error_log  /var/log/nginx/zammad.error.log;

    client_max_body_size 50M;

    location ~ ^/(assets/|robots.txt|humans.txt|favicon.ico) {
        expires max;
    }

    location /ws {
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header CLIENT_IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_read_timeout 86400;
        proxy_pass http://zammad-websocket;
    }

    location / {
        proxy_set_header Host $http_host;
        proxy_set_header CLIENT_IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_read_timeout 180;
        proxy_pass http://zammad;

        gzip on;
        gzip_types text/plain text/xml text/css image/svg+xml application/javascript application/x-javascript application/json application/xml;
        gzip_proxied any;
    }
}

Save and exit.

Next, test Nginx configuration and make sure there is no error. Then restart the web server.

nginx -t
systemctl restart nginx

The zammad virtual host file is now using SSL. Check with the netstat command and make sure you have port 443 for HTTPS with the state 'LISTEN'.

netstat -plntu

Configure Nginx web server

Step 4 - Zammad Configuration

Zammad has been installed on CentOS 7 with Nginx as a web server and PostgreSQL as a database server, and it's running under HTTPS connection. In this step, we will do basic configuration of Zammad Ticketing System.

Open your web browser and type zammad address 'zammad.hakase-labs.co'. You will be redirected to the HTTPS connection. Click the 'Setup new system' button to continue.

Start zammad setup

Now fill all the admin configuration. Username, email address, and password, and then click 'Create'.

Set username and password

For organization name, type your company name and click 'Next'.

Set organization

For email notification, click 'Continue'.

We can do the Email Notification configuration from the settings page.

Email notifications

For channel configuration, click 'Skip'.

Channel configuration

And now you see the Zammad admin dashboard with beautiful UI.

Zammad UI

Zammad has been installed with HTTPS enabled, and the configuration has been completed.

Step 5 - Enable Zammad Services

Zammad comes with three components - a web application server, Zammad worker process, and websocket server. We can manage all the services with the systemcl command below.

systemctl start zammad
systemctl status zammad
systemctl restart zammad

If you want to configure the services one by one, you can use specific components as shown below.

systemctl status zammad-web
systemctl status zammad-worker
systemctl status zammad-websocket

Zammad Ticketing System installation on CentOS 7 has been completed.

Reference

Share this page:

Suggested articles

0 Comment(s)

Add comment