How to Install CiviCRM on ENGINYRING Virtual Private Servers
Running CiviCRM as a standalone application offers enhanced performance and simplified maintenance compared to CMS-integrated installations. In this comprehensive guide, we'll walk through the process of setting up standalone CiviCRM on an ENGINYRING Virtual Private Server, covering both Debian and RHEL-based systems.
Understanding Standalone CiviCRM
The standalone version of CiviCRM provides direct access to CRM functionality without the overhead of a content management system. This approach is ideal for organizations that primarily need constituent relationship management features and prefer a lightweight, focused installation.
Server Requirements
Your ENGINYRING VPS should meet or exceed these specifications for optimal performance:
- 4GB RAM minimum (8GB recommended)
- 2 CPU cores
- 40GB SSD storage
- Either Debian/Ubuntu or RHEL/CentOS/Rocky Linux
- Clean server installation
Debian-Based Installation Process
The installation process on Debian and Ubuntu systems follows a straightforward path, beginning with system preparation and proceeding through database configuration and application setup.
First, we'll update the system and install required packages:
# Update system packages
sudo apt update && sudo apt upgrade -y
# Install required dependencies
sudo apt install apache2 mariadb-server php php-cli php-curl php-gd \
php-imap php-json php-intl php-ldap php-mbstring php-mysql php-soap \
php-xml php-zip unzip wget composer git -y
Next, we'll secure the database server and create necessary databases:
# Secure MariaDB
sudo mysql_secure_installation
# Create CiviCRM database
sudo mysql -u root -p
CREATE DATABASE civicrm DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'civicrm'@'localhost' IDENTIFIED BY 'your_secure_password';
GRANT ALL PRIVILEGES ON civicrm.* TO 'civicrm'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Now we'll install CiviCRM using Composer:
# Create installation directory
sudo mkdir -p /var/www/civicrm
cd /var/www/civicrm
# Install CiviCRM via Composer
sudo composer create-project civicrm/standalone-dev:dev-master .
sudo chown -R www-data:www-data .
RHEL-Based Installation Process
For RHEL, CentOS, or Rocky Linux systems, we begin by enabling the necessary repositories and installing required packages:
# Enable repositories
sudo dnf install epel-release -y
sudo dnf module enable php:7.4 -y
# Install required packages
sudo dnf install httpd mariadb-server php php-cli php-curl php-gd \
php-imap php-json php-intl php-ldap php-mbstring php-mysqlnd \
php-soap php-xml php-zip unzip wget composer git -y
Configure services and firewall:
# Start and enable services
sudo systemctl start httpd mariadb
sudo systemctl enable httpd mariadb
# Configure firewall
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
Database setup follows the same pattern as Debian systems:
# Secure MariaDB and create database
sudo mysql_secure_installation
mysql -u root -p
CREATE DATABASE civicrm DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'civicrm'@'localhost' IDENTIFIED BY 'your_secure_password';
GRANT ALL PRIVILEGES ON civicrm.* TO 'civicrm'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Web Server Configuration
Regardless of the operating system, proper web server configuration is crucial. For Apache:
# Create Apache configuration
sudo nano /etc/apache2/sites-available/civicrm.conf # Debian
sudo nano /etc/httpd/conf.d/civicrm.conf # RHEL
Add the following configuration:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/civicrm
ServerName crm.yourdomain.com
<Directory /var/www/civicrm>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/civicrm_error.log
CustomLog ${APACHE_LOG_DIR}/civicrm_access.log combined
</VirtualHost>
Initial Setup and Configuration
After installation, access the CiviCRM installer through your web browser:
http://your_server_ip/setup
The setup wizard will guide you through:
- Database connection configuration
- Administrator account creation
- Initial system settings
- Base currency selection
- Location and language preferences
Performance Optimization
For optimal performance on your ENGINYRING VPS, implement these configurations:
PHP optimization:
sudo nano /etc/php/7.4/apache2/php.ini # Debian
sudo nano /etc/php.ini # RHEL
# Add or modify these values:
memory_limit = 256M
max_execution_time = 120
post_max_size = 64M
upload_max_filesize = 64M
Enable caching:
# Create cache directories
sudo mkdir -p /var/www/civicrm/cache
sudo chown -R www-data:www-data /var/www/civicrm/cache
Backup Configuration
Implement a robust backup strategy:
# Create backup script
sudo nano /usr/local/bin/backup-civicrm.sh
#!/bin/bash
BACKUP_DIR="/var/backups/civicrm"
MYSQL_USER="civicrm"
MYSQL_PASS="your_secure_password"
DATE=$(date +%Y%m%d)
# Create backup directory
mkdir -p $BACKUP_DIR
# Backup database
mysqldump -u$MYSQL_USER -p$MYSQL_PASS civicrm > $BACKUP_DIR/civicrm_db_$DATE.sql
# Backup files
tar -czf $BACKUP_DIR/civicrm_files_$DATE.tar.gz /var/www/civicrm
# Remove backups older than 7 days
find $BACKUP_DIR -type f -mtime +7 -delete
Security Considerations
Post-installation security measures should include:
- SSL certificate implementation
- Regular security updates
- System monitoring setup
- Firewall configuration
- Regular security audits
Conclusion
A standalone CiviCRM installation on an ENGINYRING VPS provides a robust, efficient platform for constituent relationship management. While the installation process requires attention to detail, the result is a streamlined, high-performance CRM system that can be customized to meet your organization's specific needs.
Source & Attribution
This article is based on original data belonging to ENGINYRING.COM blog. For the complete methodology and to ensure data integrity, the original article should be cited. The canonical source is available at: How to Install CiviCRM on ENGINYRING Virtual Private Servers.