SuiteCRM is a powerful, open-source customer relationship management (CRM) solution designed for businesses that require customization, control over their data, and the ability to self-host. With its feature-rich functionality and flexibility, SuiteCRM is an excellent alternative to proprietary systems. In this guide, weβll cover everything from deploying SuiteCRM to configuring it for production, ensuring security, and leveraging its advanced features.
Installing SuiteCRM
π¦ Docker/Docker Compose Setup
Using Docker simplifies the deployment process by encapsulating SuiteCRM and its dependencies. Create a docker-compose.yml
file to set up SuiteCRM with ease.
version: '3.8'
services:
suitecrm:
image: salesagility/suitecrm
container_name: suitecrm
ports:
- "8080:80"
volumes:
- suitecrm-data:/var/www/html
environment:
- DB_HOST=db
- DB_PORT=3306
- DB_DATABASE=suitecrm
- DB_USERNAME=suitecrm_user
- DB_PASSWORD=suitecrm_password
depends_on:
- db
db:
image: mysql:5.7
container_name: suitecrm-db
volumes:
- db-data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=root_password
- MYSQL_DATABASE=suitecrm
- MYSQL_USER=suitecrm_user
- MYSQL_PASSWORD=suitecrm_password
volumes:
suitecrm-data:
db-data:
Run the following commands to deploy SuiteCRM:
docker-compose up -d
π Manual Installation
For a manual installation on a Linux server, follow these steps:
- Install dependencies:
sudo apt update
sudo apt install apache2 php libapache2-mod-php php-mysql mariadb-server unzip -y
- Download SuiteCRM:
wget https://suitecrm.com/files/159/SuiteCRM-8.3/752/SuiteCRM-8.3.0.zip
unzip SuiteCRM-8.3.0.zip -d /var/www/html/suitecrm
cd /var/www/html/suitecrm
- Set permissions:
sudo chown -R www-data:www-data /var/www/html/suitecrm
sudo chmod -R 775 /var/www/html/suitecrm
Configuring Nginx as a Reverse Proxy
π Nginx Configuration
Nginx acts as a reverse proxy to route traffic to SuiteCRM. Create a server block configuration file:
server {
listen 80;
server_name suitecrm.example.com;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_log /var/log/nginx/suitecrm_error.log;
access_log /var/log/nginx/suitecrm_access.log;
}
Save the file as /etc/nginx/sites-available/suitecrm
and enable it:
sudo ln -s /etc/nginx/sites-available/suitecrm /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
π SSL/TLS Setup
Secure your Nginx server with Let's Encrypt:
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d suitecrm.example.com
Automate certificate renewals:
sudo crontab -e
0 0 * * * /usr/bin/certbot renew --quiet
Logging and Debugging SuiteCRM
ποΈ Enabling Debug Logs
Enable debug logging by editing the config.php
file in SuiteCRM:
'logger' => [
'level' => 'debug',
],
π Viewing Logs
View logs depending on your setup:
- Docker:
docker logs suitecrm
- Manual installation:
tail -f /var/www/html/suitecrm/logs/suitecrm.log
π οΈ Troubleshooting Common Issues
Check for common issues like missing database connections:
grep -i "error" /var/www/html/suitecrm/logs/suitecrm.log
π€ Exporting Logs
Send SuiteCRM logs to an external ELK Stack using Filebeat:
- Install Filebeat:
sudo apt install filebeat -y
- Configure Filebeat to monitor log files:
filebeat.inputs:
- type: log
paths:
- /var/www/html/suitecrm/logs/*.log
output.elasticsearch:
hosts: ["localhost:9200"]
Backup and Restore
ποΈ File-Based Backups
Backup SuiteCRM files with the following command:
tar -czvf suitecrm-backup.tar.gz /var/www/html/suitecrm
π Database Backups
Export the database:
mysqldump -u suitecrm_user -p suitecrm > suitecrm_db_backup.sql
Restore the database:
mysql -u suitecrm_user -p suitecrm < suitecrm_db_backup.sql
π Automated Backup Scripts
Automate backups using a cron job:
crontab -e
## Add the following line:
0 2 * * * /usr/bin/mysqldump -u suitecrm_user -psuitecrm_password suitecrm > /backup/suitecrm_$(date +\%F).sql
Updating and Upgrading SuiteCRM
β¬οΈ Updating Docker Images
Update SuiteCRMβs Docker image:
docker-compose pull suitecrm
docker-compose up -d
π οΈ Manual Updates
- Download the latest version:
wget https://suitecrm.com/files/latest.zip
unzip latest.zip -d /var/www/html/suitecrm
- Set permissions:
sudo chown -R www-data:www-data /var/www/html/suitecrm
sudo chmod -R 775 /var/www/html/suitecrm
π Checking for Updates
Check for updates within SuiteCRM by navigating to the "Admin" panel and selecting "Upgrade Wizard."
Leveraging SuiteCRMβs Unique Features
π§ Enabling APIs
Enable SuiteCRMβs REST API by editing config.php
:
'api' => [
'enabled' => true,
],
Test the API with curl
:
curl -X GET https://suitecrm.example.com/api/v8/modules -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
π Advanced Configurations
Enable custom modules or workflows by using the "Module Builder" and "Workflow Management" tools in the admin dashboard.
Wrapping Up
This guide covered the end-to-end process of deploying, configuring, and managing SuiteCRM, along with leveraging its features for maximum impact. By following these steps, you can harness the full power of SuiteCRM while maintaining full control over your data. Start exploring SuiteCRM today and customize it to meet your organizationβs unique needs!