• Get In Touch
February 11, 2017

How to Install Zammad on CentOS 7

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Zammad is free and open source web-based customer support system. It uses PostgreSQL or MySQL to store its data. It provides various features to manage customer support via many different channels like telephone, chat, facebook, twitter and email. You can manage and organize your support team for personalized and quick answers for effective customer support. Zammad also provides external authentication with facebook, twitter, and LinkedIn for quick login.

In this tutorial, we will install Zammad on CentOS 7.

Requirements

Zammad recommends at least 2GB RAM for installation. If you want to run elasticsearch on the same server then you will need at least 4GB RAM on your server. All the required dependencies will be installed throughout the tutorial. You will need a minimal installation of CentOS 7 with root access on it. If you are logged in as a non-root user, you can run sudo -i to switch to root user.

Installing Zammad

Before installing any package it is recommended that you update the packages and repository using the following command.

yum -y update

Now you will need to install EPEL repository as we will need to install few packages which are not available in the default yum repository. Run the following command to install EPEL repository.

yum -y install epel-release
yum -y update

Zammad can be installed directly using YUM, but before that, you will need to add the Zammad repository to your server. Run the following commands to add Zammad repository in your system.

echo "[zammad]
name=Repository for zammad/zammad application.
baseurl=https://rpm.packager.io/gh/zammad/zammad/centos7/stable
enabled=1" | tee /etc/yum.repos.d/zammad.repo

Once the repository is added, add Zammad public key using the following command.

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

You can install Zammad using following command.

yum -y install zammad

The above command will install Zammad on your system. During the installation it will install nginx and PostgreSQL. It will automatically initialize the database and will setup everything for you. Once the installation finishes, you can access Zammad using the following URL in your browser.

http://YourServerIP:3000

Zammad also creates a server block or virtual host file for nginx reverse proxy. For non-SSL proxy, you can use the same configuration file but you will need to make a small change in the configuration. Edit the Zammad nginx configuration file using the following command.

nano /etc/nginx/conf.d/zammad.conf

If you don’t have nano installed, you can run yum -y install nano command. Find the following line in the configuration.

 server_name localhost;

Change the above line to the following.

server_name yourdomain.com

Change yourdomain.com with your actual domain or subdomain. Once done save the file and exit from the editor and restart the nginx web server using the following command.

systemctl restart nginx

If you want your users to access the application using HTTPS, you can also use SSL with Zammad. In this tutorial, we will generate SSL certificates from Let’s Encrypt client. If you want to use commercial SSL certificates instead, you can purchase SSL certificates from HostPresto.

To install Let’s Encrypt client also called Certbot run the following command.

yum -y install certbot

Once the installation finishes, run the following command to obtain the SSL certificates from Let’s Encrypt. Make sure that your domain is pointed to the server, the Let’s Encrypt will check the domain authority before providing the certificates. Make sure that you do not have nginx running at this moment.

certbot certonly --standalone -d yourdomain.com -d www.yourdomain.com

This command will run Let’s Encrypt client to obtain the certificates only but will not install it. --standalone tells the client to use the standalone web server for authentication of domain authority. -d yourdomain.com tells the domain name for which the certificates needs to be obtained. Provide your email address and accept the terms and condition. Once the certificates are generated, they are likely to be stored in the following directory.

/etc/letsencrypt/live/yourdomain.com

Where yourdomain.com is your actual domain. In the directory, you will find cert.pem which is your domains certificate and privkey.pem which is your certificate’s private key.

Let’s Encrypt SSL expires in 90 days, so it is recommended to set an automatic renewal for your certificates. Run the following command to open your crontab file.

crontab -e
Enter the following line into the crontab file.

30 1 * * 1 /usr/bin/certbot renew >> /var/log/le-renew.log

The above cron job will automatically run every Monday at 1:30 AM and if your certificates are due for expiry, it will automatically renew them.

As the SSL certificates are now generated, we can proceed further to configure nginx configuration file. Backup the existing Zammad proxy configuration using the following command.

mv /etc/nginx/conf.d/zammad.conf /etc/nginx/conf.d/zammad.conf.bak

Now create a new server block for Zammad nginx configuration file using the following command.

nano /etc/nginx/conf.d/ssl-zammad.conf

Now copy and paste the following lines into the file.

#
# this is the SSL nginx config for zammad
#

upstream zammad {
    server localhost:3000;
}

upstream zammad-websocket {
    server localhost:6042;
}

server {
    listen 80;
    return 301 https://$host$request_uri;
}

server {
    listen 443 http2 ssl;

    server_name yourdomain.com www.yourdomain.com;

    root /opt/zammad/public;

    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/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;

    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$
        gzip_proxied any;
    }
}

In the above configuration change yourdomain.com to your actual domain. Also, make sure that the path to your SSL certificate and private key are correct. Once done save the file and exit from the editor and restart the nginx web server using the following command.

systemctl restart nginx

Now you will need to disable your SELinux because reverse proxy does not work with SELinux policies. To temporary disable SELinux without restarting the server, run the following command.

setenforce 0

To completely disable the SELinux you will need to edit /etc/selinux/config file.

nano /etc/selinux/config

If you don’t have nano installed, you can install it using yum -y install nano Find the following line:

SELINUX=enforcing

Change it to:

SELINUX=disabled

Now you will need to reboot your server so that the new configuration can take effect. Once the server is up again you can access your application at the following URL.

For non-SSL:
http://yourdomain.com

For SSL:
https://yourdomain.com

You will see the following interface.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/1646697940.png” alt=”” />

Click on Setup new system button and you will be taken to a new interface in which you will need to create the initial administrator account. Fill the details as asked and click on Create button.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/1032388416.png” alt=”” />

In next step, you will need to provide your organization details. Provide the name of your organization and upload the logo. The system will automatically detect the URL of your system.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/1687458500.png” alt=”” />

Click Next to go to the next interface. Choose how emails will be sent from your application. You can choose the local MTA, or SMTP. Choose according and provide the details of your mail server. It is recommended to use SMTP for sending emails.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/1836857824.png” alt=”” />

Once done you will be taken to your administrative dashboard, which will look like shown below.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/1097247969.png” alt=”” />

Conclusion

In this tutorial, we have learned how to install Zammad ticketing system on CentOS 7 server. You can now easily create a support desk for your organization.

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Share this Article!

Related Posts

Node.js Authentication – A Complete Guide with Passport and JWT

Node.js Authentication – A Complete Guide with Passport and JWT

Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will be avoided or at least […]

Node.js and MongoDB: How to Connect MongoDB With Node

Node.js and MongoDB: How to Connect MongoDB With Node

MongoDB is a document-oriented NoSQL database, which was born in 2007 in California as a service to be used within a larger project, but which soon became an independent and open-source product. It stores documents in JSON, a format based on JavaScript and simpler than XML, but still with good expressiveness. It is the dominant […]

Using MySQL with Node.js: A Complete Tutorial

Using MySQL with Node.js: A Complete Tutorial

Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you need to scale an application, […]

Node.Js Vs Django: Which Is the Best for Your Project

Node.Js Vs Django: Which Is the Best for Your Project

Django and NodeJs are two powerful technologies for web development, both have great functionality, versatile applications, and a great user interface. Both are open source and can be used for free. But which one fits your project best? NodeJs is based on JavaScript, while Django is written in Python. These are two equally popular technologies […]

Nodejs Vs PHP:  Which Works Best?

Nodejs Vs PHP: Which Works Best?

Before getting into the “battle” between Node.js and PHP we need to understand why the issue is still ongoing. It all started with the increased demand for smartphone applications, their success forcing developers to adapt to new back-end technologies that could handle a multitude of simultaneous requests. JavaScript has always been identified as a client-side […]