How to Install SuiteCRM on a CentOS 8 Cloud Server
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 Vultr.
- Setup a domain name, for example,
suitecrm.example.com
pointed 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-server
Start MySQL.
$ sudo systemctl start mysqld
Set the MySQL root user password and clear unused defaults.
mysql_secure_installation
Log in to MySQL.
$ sudo mysql -u root
Create 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 powertools
Install the Extra Packages for Enterprise Linux (EPEL) repository.
$ sudo dnf install epel-release
Install the Remi repository.
$ sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm -y
Install PHP Version 7.4.
$ sudo dnf module install php:remi-7.4
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
Edit the main PHP configuration file.
$ sudo vim /etc/php.ini
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.
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/suitecrm
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.Unzip the downloaded release file.
$ unzip SuiteCRM-7.12.5.zip
Move extracted files to the SuiteCRM webroot directory.
$ sudo mv SuiteCRM-7.12.5/* /var/www/suitecrm
Grant Nginx ownership permissions on the SuiteCRM directory.
$ sudo chown -R nginx:nginx /var/www/suitecrm
Set the directory permissions mode temporarily to
777
for SuiteCRM to write new files.$ sudo chmod -R 777 /var/www/suitecrm
Restart 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.conf
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.
Test the Nginx configuration.
$ sudo nginx -t
Restart 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=https
Restart the Firewall for changes to take effect.
$ sudo firewall-cmd --reload
6. Enable HTTPS
Install Snap.
$ sudo dnf install snapd -y
Enable the snap communication socket.
$ sudo systemctl enable --now snapd.socket
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.
Install Certbot
$ sudo snap install --classic certbot
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
Restart Nginx for changes to take effect.
$ sudo systemctl restart nginx
7. Access SuiteCRM
Open your web browser, and visit your subdomain.
https://suitecrm.example.com
Accept the SuiteCRM GNU license and click Next.
Check the System Environment if all is OK, and click Next.
Enter your Database name,
localhost
as 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
755
for CRM functions and CSS to work well.$ sudo chmod -R 755 /var/www/suitecrm/
Restart Nginx for changes to take effect.
$ sudo systemctl restart nginx
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.