How to Install SuiteCRM on a CentOS 8 Cloud Server

Updated on November 21, 2023
How to Install SuiteCRM on a CentOS 8 Cloud Server header image

Introduction

SuiteCRM is a free open-source Customer Relationship Management (CRM) application that helps you speed up business operations by providing better customer experiences with an overview of company sales, marketing, and other services. This article guides you on how to install SuiteCRM on CentOS 8.

Prerequisites

1. Setup the SuiteCRM Database

  1. Install the MySQL database server.

      $ sudo dnf install mysql-server
  2. Start MySQL.

      $ sudo systemctl start mysqld
  3. Set the MySQL root user password and clear unused defaults.

      mysql_secure_installation
  4. Log in to MySQL.

      $ sudo mysql -u root 
  5. Create a new SuiteCRM database.

      CREATE DATABASE suitecrm;
  6. Create a database user and assign a secure password.

      CREATE USER 'suite'@'localhost' IDENTIFIED BY 'secure-password';
  7. Grant the user full permissions to the SuiteCRM database.

      GRANT ALL ON suitecrm.* TO 'suite'@'localhost';
  8. Flush the MySQL privileges table.

      FLUSH PRIVILEGES;
  9. Exit the MySQL shell.

      EXIT

2. Setup PHP

  1. Enable the PowerTools repository

      $ sudo dnf config-manager --set-enabled powertools
  2. Install the Extra Packages for Enterprise Linux (EPEL) repository.

      $ sudo dnf install epel-release
  3. Install the Remi repository.

      $ sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm -y
  4. Install PHP Version 7.4.

      $ sudo dnf module install php:remi-7.4
  5. Install required PHP modules.

      $ sudo dnf install php php-fpm php-mysqlnd php-cgi php-bcmath php-json php-xml php-gettext php-common php-curl php-intl php-zip php-imap php-pear php-mbstring php-gd  -y
  6. Edit the main PHP configuration file.

      $ sudo vim /etc/php.ini
  7. Locate the upload_max_filesize = 2M directive near line 846, and change its value to 20MB or above as required by SuiteCRM.

      upload_max_filesize = 20M

    Save and close the file.

  8. Restart PHP-FPM to load changes.

      $ sudo systemctl restart php-fpm

3. Install SuiteCRM

  1. Create the SuiteCRM web root directory in /var/www/.

      $ sudo mkdir /var/www/suitecrm
  2. Download the latest SuiteCRM stable version.

      $ wget https://suitecrm.com/files/147/SuiteCRM-7.12/614/SuiteCRM-7.12.5.zip

    This article uses version 7.12.5. Be sure to download the latest stable version from the SuiteCRM website.

  3. Unzip the downloaded release file.

      $ unzip SuiteCRM-7.12.5.zip 
  4. Move extracted files to the SuiteCRM webroot directory.

      $ sudo mv SuiteCRM-7.12.5/*  /var/www/suitecrm
  5. Grant Nginx ownership permissions on the SuiteCRM directory.

      $ sudo chown -R nginx:nginx /var/www/suitecrm
  6. Set the directory permissions mode temporarily to 777 for SuiteCRM to write new files.

      $ sudo chmod -R 777 /var/www/suitecrm
  7. Restart Nginx.

      $ sudo systemctl restart nginx

4. Configure Nginx

  1. Create and edit the SuiteCRM Nginx configuration file using a text editor.

      $ sudo vim /etc/nginx/conf.d/suitecrm.example.com.conf
  2. Add the following configurations to the file. Replace suitecrm.example.com with your actual domain name.

      server {
         listen 80;
         listen [::]:80;
         server_name suitecrm.example.com;
         root /var/www/suitecrm;
         client_max_body_size 20M;
    
         error_log /var/log/nginx/suitecrm.error;
         access_log /var/log/nginx/suitecrm.access;
    
    
         index index.php index.html index.htm;
    
         location / {
             try_files $uri /index.php$is_args$args;
         }
    
        location ~ \.php$ {
         try_files $uri =404;
         fastcgi_pass unix:/var/run/php-fpm/www.sock;
         fastcgi_index index.php;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         include fastcgi_params;
       }
    
    
        location = /favicon.ico {
            log_not_found off;
            access_log off;
        }
    
        location ~ /\. {
         deny all;
       }
      }

    Save and close the file.

  3. Test the Nginx configuration.

      $ sudo nginx -t
  4. Restart Nginx for changes to take effect.

      $ sudo systemctl restart nginx

5. Security

  1. Configure SELinux to allow Nginx write actions on the SuiteCRM directory.

      $ sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/suitecrm(/.*)?"
    
      $ sudo restorecon -Rv /var/www/suitecrm/
  2. Configure the Firewall to allow HTTP and HTTPS through the firewall.

      $ sudo firewall-cmd --zone=public --permanent --add-service=http
    
      $ sudo firewall-cmd --zone=public --permanent --add-service=https
  3. Restart the Firewall for changes to take effect.

      $ sudo firewall-cmd --reload

6. Enable HTTPS

  1. Install Snap.

      $ sudo dnf install snapd -y
  2. Enable the snap communication socket.

      $ sudo systemctl enable --now snapd.socket
  3. Enable classic snap support.

      $ sudo ln -s /var/lib/snapd/snap /snap

    Close your SSH connection and Login again as a non-root user with sudo access.

  4. Install Certbot

      $ sudo snap install --classic certbot
  5. Get a free SSL certificate from Let’s Encrypt. Replace suitecrm.example.com with your actual domain.

      $ sudo certbot --nginx -d suitecrm.example.com -m admin@example.com --agree-tos
  6. Restart Nginx for changes to take effect.

      $ sudo systemctl restart nginx

7. Access SuiteCRM

  1. Open your web browser, and visit your subdomain.

      https://suitecrm.example.com
  2. Accept the SuiteCRM GNU license and click Next.

  3. Check the System Environment if all is OK, and click Next.

  4. Enter your Database name, localhost as the Hostname, User, and Password created earlier.

  5. Under Site Configuration, enter the SuiteCRM administrator username, a strong password, email address, and click Next to start the database setup process.

  6. After installation is complete, access your SSH console and set the SuiteCRM directory permissions mode to 755 for CRM functions and CSS to work well.

      $ sudo chmod -R 755 /var/www/suitecrm/
  7. Restart Nginx for changes to take effect.

      $ sudo systemctl restart nginx
  8. Re-visit your domain name and log in with the administrator account to start using SuiteCRM.

      https://suitecrm.example.com

Conclusion

You have successfully installed SuiteCRM on CentOS 8. Steps in this article also work for other RHEL distributions such as Rocky Linux 8 and Alma Linux 8. For more information, refer to the official SuiteCRM documentation.