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
- Deploy a CentOS 8 server on Rcs.
- Setup a domain name, for example,
suitecrm.example.compointed to the server. - Login as a non-root user with sudo access.
- Install Nginx on the server.
1. Setup the SuiteCRM Database
Install the MySQL database server.
$ sudo dnf install mysql-serverStart MySQL.
$ sudo systemctl start mysqldSet the MySQL root user password and clear unused defaults.
mysql_secure_installationLog in to MySQL.
$ sudo mysql -u rootCreate a new SuiteCRM database.
CREATE DATABASE suitecrm;Create a database user and assign a secure password.
CREATE USER 'suite'@'localhost' IDENTIFIED BY 'secure-password';Grant the user full permissions to the SuiteCRM database.
GRANT ALL ON suitecrm.* TO 'suite'@'localhost';Flush the MySQL privileges table.
FLUSH PRIVILEGES;Exit the MySQL shell.
EXIT
2. Setup PHP
Enable the PowerTools repository
$ sudo dnf config-manager --set-enabled powertoolsInstall the Extra Packages for Enterprise Linux (EPEL) repository.
$ sudo dnf install epel-releaseInstall the Remi repository.
$ sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm -yInstall PHP Version 7.4.
$ sudo dnf module install php:remi-7.4Install 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 -yEdit the main PHP configuration file.
$ sudo vim /etc/php.iniLocate the
upload_max_filesize = 2Mdirective near line 846, and change its value to 20MB or above as required by SuiteCRM.upload_max_filesize = 20MSave and close the file.
Restart PHP-FPM to load changes.
$ sudo systemctl restart php-fpm
3. Install SuiteCRM
Create the SuiteCRM web root directory in
/var/www/.$ sudo mkdir /var/www/suitecrmDownload the latest SuiteCRM stable version.
$ wget https://suitecrm.com/files/147/SuiteCRM-7.12/614/SuiteCRM-7.12.5.zipThis article uses version
7.12.5. Be sure to download the latest stable version from the SuiteCRM website.Unzip the downloaded release file.
$ unzip SuiteCRM-7.12.5.zipMove extracted files to the SuiteCRM webroot directory.
$ sudo mv SuiteCRM-7.12.5/* /var/www/suitecrmGrant Nginx ownership permissions on the SuiteCRM directory.
$ sudo chown -R nginx:nginx /var/www/suitecrmSet the directory permissions mode temporarily to
777for SuiteCRM to write new files.$ sudo chmod -R 777 /var/www/suitecrmRestart Nginx.
$ sudo systemctl restart nginx
4. Configure Nginx
Create and edit the SuiteCRM Nginx configuration file using a text editor.
$ sudo vim /etc/nginx/conf.d/suitecrm.example.com.confAdd the following configurations to the file. Replace
suitecrm.example.comwith 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.
Test the Nginx configuration.
$ sudo nginx -tRestart Nginx for changes to take effect.
$ sudo systemctl restart nginx
5. Security
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/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=httpsRestart the Firewall for changes to take effect.
$ sudo firewall-cmd --reload
6. Enable HTTPS
Install Snap.
$ sudo dnf install snapd -yEnable the snap communication socket.
$ sudo systemctl enable --now snapd.socketEnable classic snap support.
$ sudo ln -s /var/lib/snapd/snap /snapClose your SSH connection and Login again as a non-root user with sudo access.
Install Certbot
$ sudo snap install --classic certbotGet a free SSL certificate from Let’s Encrypt. Replace
suitecrm.example.comwith your actual domain.$ sudo certbot --nginx -d suitecrm.example.com -m admin@example.com --agree-tosRestart Nginx for changes to take effect.
$ sudo systemctl restart nginx
7. Access SuiteCRM
Open your web browser, and visit your subdomain.
https://suitecrm.example.comAccept the SuiteCRM GNU license and click Next.
- Check the System Environment if all is OK, and click Next.
- Enter your Database name,
localhostas the Hostname, User, and Password created earlier. - Under Site Configuration, enter the SuiteCRM administrator username, a strong password, email address, and click Next to start the database setup process.
After installation is complete, access your SSH console and set the SuiteCRM directory permissions mode to
755for CRM functions and CSS to work well.$ sudo chmod -R 755 /var/www/suitecrm/Restart Nginx for changes to take effect.
$ sudo systemctl restart nginxRe-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.