UbuntuUbuntu Based

How To Install EspoCRM on Ubuntu 24.04 LTS

Install EspoCRM on Ubuntu 24.04

EspoCRM stands as a powerful open-source customer relationship management solution that offers businesses comprehensive tools for managing customer interactions, sales pipelines, and marketing campaigns efficiently. This detailed guide provides systematic instructions for installing EspoCRM on Ubuntu 24.04 LTS, covering everything from initial server preparation to post-installation optimization. By following these steps, administrators will successfully deploy a fully functional EspoCRM system capable of streamlining business operations, enhancing customer engagement, and providing valuable analytics for data-driven decision making.

Understanding EspoCRM and Its Benefits

EspoCRM represents a comprehensive open-source Customer Relationship Management platform designed to help businesses organize and track customer interactions effectively. Unlike many proprietary solutions, EspoCRM provides a flexible, customizable framework that can be tailored to specific business requirements without excessive costs. The system operates through a clean, intuitive web interface that makes managing customer relationships accessible to organizations of all sizes.

The platform excels in several key functional areas that directly impact business operations. Contact management capabilities allow comprehensive organization of customer information, including communication history, personal details, and relationship tracking. Sales automation features streamline pipeline management with lead tracking, opportunity management, and conversion optimization tools that help sales teams prioritize efforts effectively. Workflow automation enables businesses to define custom processes for routine tasks, ensuring consistency while reducing manual intervention. Additionally, email marketing integration provides powerful campaign management tools for targeted customer outreach and engagement tracking.

EspoCRM offers significant advantages over proprietary CRM solutions, particularly for budget-conscious organizations or those requiring extensive customization. The open-source nature eliminates licensing fees while providing complete access to the codebase for custom modifications. Self-hosting capabilities give organizations full control over their data security and privacy implementations, addressing concerns about third-party access to sensitive customer information. The platform’s modular design allows businesses to implement only the features they need, creating a streamlined system without unnecessary complexity. This combination of flexibility, control, and cost-effectiveness makes EspoCRM particularly attractive for small to medium businesses seeking enterprise-grade CRM functionality without prohibitive costs.

System Requirements and Prerequisites

Ensuring optimal EspoCRM performance begins with appropriate hardware specifications tailored to anticipated usage patterns. For small businesses with limited users, a server with 2 CPU cores provides sufficient processing capacity, while medium to large implementations benefit from 4+ cores to handle concurrent operations smoothly. Memory requirements start at a minimum of 2GB RAM, though 4GB or more is strongly recommended for production environments to prevent performance bottlenecks during intensive operations like report generation or data imports. Storage considerations should include at least 20GB of available space for the application and database, with additional capacity planned for document attachments, email archives, and database growth over time.

Software prerequisites center around a properly configured Ubuntu 24.04 LTS server environment with specific components. The installation requires administrative access through either root credentials or a user account with sudo privileges for executing system-level commands. Familiarity with command-line operations proves essential, as many configuration steps require terminal access for precise implementation. The server should have the Ubuntu 24.04 LTS operating system freshly installed with current updates applied to ensure security compliance and component compatibility. Additional required software components include Apache web server (version 2.4+), MariaDB or MySQL database server (version 10.3+ or 8.0+ respectively), and PHP (version 7.4+ with 8.1/8.2 recommended for optimal performance).

Network configuration requirements impact both system accessibility and security posture. The server benefits from a static IP address configuration to ensure consistent access for both internal users and external integrations. While optional, a registered domain name significantly improves system usability by providing memorable access points instead of IP addresses. Network accessibility requires specific ports open for service access, primarily HTTP (80) and HTTPS (443) for web interface connectivity. Organizations implementing email integration need additional ports configured, including SMTP (25/587), IMAP (143/993), and POP3 (110/995) depending on email server specifications. Proper firewall configuration should restrict access to these services based on organizational security policies while ensuring legitimate traffic flows unimpeded.

Step 1: Preparing Your Ubuntu 24.04 LTS Environment

The foundation for a successful EspoCRM deployment begins with a properly prepared Ubuntu server environment. Start by updating the package repository information and upgrading existing packages to their latest versions, ensuring all security patches and bug fixes are applied. Execute the following commands in sequence to perform this operation:

sudo apt update
sudo apt upgrade -y

This process may take several minutes depending on connection speed and existing package states. After completion, a system reboot may be necessary if kernel updates were applied, which can be accomplished with the sudo reboot command.

Proper hostname configuration establishes server identity within the network and prevents potential communication issues. Set an appropriate fully-qualified domain name (FQDN) using the hostnamectl command, replacing “crm.yourdomain.com” with your actual server name:

sudo hostnamectl set-hostname crm.yourdomain.com

Next, update the hosts file to ensure the system can properly resolve its own hostname by editing the configuration file:

sudo nano /etc/hosts

Add or modify the appropriate line to include the server’s IP address, hostname, and FQDN:

192.168.1.100   crm   crm.yourdomain.com

Save the file and exit the editor. Verify correct hostname resolution by using the hostname and hostname -f commands, which should display the short hostname and FQDN respectively.

Initial security measures provide baseline protection for the server environment. If the server was set up with only a root account, create a non-root user with administrative privileges to follow security best practices:

sudo adduser espo_admin
sudo usermod -aG sudo espo_admin

Configure the Uncomplicated Firewall (UFW) to provide network access control while allowing necessary services:

sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw enable

Verify firewall status with sudo ufw status to ensure rules have been properly applied and the firewall is active. These foundational steps create a stable, updated, and minimally secured Ubuntu environment ready for EspoCRM component installation.

Step 2: Installing and Configuring Apache Web Server

Apache serves as the web server component in the EspoCRM stack, handling HTTP requests and serving the application interface to users. Install Apache using the package manager with the following command:

sudo apt install apache2 -y

After installation completes, verify the service is running properly with:

sudo systemctl status apache2

The output should indicate an “active (running)” state. If not, start the service with sudo systemctl start apache2 and enable it to launch automatically at system boot:

sudo systemctl enable apache2

Essential Apache modules must be activated to support EspoCRM functionality. The rewrite module enables clean URL structures, while additional modules provide security features and processing capabilities:

sudo a2enmod rewrite
sudo a2enmod headers
sudo a2enmod ssl
sudo a2enmod expires
sudo systemctl restart apache2

Create an Apache configuration file specifically for the EspoCRM application that implements necessary settings and security features:

sudo nano /etc/apache2/sites-available/espocrm.conf

Insert the following configuration, modifying the server name and document root path as needed:

<VirtualHost *:80>
    ServerName crm.yourdomain.com
    ServerAdmin webmaster@yourdomain.com
    DocumentRoot /var/www/html/espocrm

    <Directory /var/www/html/espocrm/>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/espocrm_error.log
    CustomLog ${APACHE_LOG_DIR}/espocrm_access.log combined
</VirtualHost>

Enable the new site configuration and disable the default site to prevent potential conflicts:

sudo a2ensite espocrm.conf
sudo a2dissite 000-default.conf
sudo systemctl reload apache2

Implement Apache security best practices by modifying the main configuration file:

sudo nano /etc/apache2/conf-enabled/security.conf

Update or add the following directives to enhance security:

ServerTokens Prod
ServerSignature Off
TraceEnable Off

These settings minimize information disclosure about the server’s software and version, reducing potential attack vectors. Restart Apache to apply all configuration changes:

sudo systemctl restart apache2

Test the configuration by accessing the server’s IP address or domain name in a web browser. A default Apache page or directory listing should appear, indicating the web server is operational and properly responding to requests.

Step 3: Setting Up MariaDB Database Server

MariaDB provides the database foundation for EspoCRM, storing all application data including contacts, accounts, opportunities, and system configurations. Install MariaDB server using the package manager:

sudo apt install mariadb-server -y

Verify the service is running correctly and enable it to start automatically on system boot:

sudo systemctl status mariadb
sudo systemctl enable mariadb

Database security configuration represents a critical step for protecting sensitive business data. Run the mysql_secure_installation script to implement baseline security measures:

sudo mysql_secure_installation

When prompted, respond to the security questions as follows:

  • Enter current password for root: Press Enter (no password set by default)
  • Set root password? [Y/n]: Y (create a strong password and note it securely)
  • Remove anonymous users? [Y/n]: Y
  • Disallow root login remotely? [Y/n]: Y
  • Remove test database and access to it? [Y/n]: Y
  • Reload privilege tables now? [Y/n]: Y

Create a dedicated database and user account specifically for EspoCRM to follow security best practices of privilege separation. Log into the MariaDB console:

sudo mysql -u root -p

Enter the root password when prompted, then execute the following SQL commands, replacing placeholder values with secure alternatives:

CREATE DATABASE espocrm CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'espocrm_user'@'localhost' IDENTIFIED BY 'strong_password_here';
GRANT ALL PRIVILEGES ON espocrm.* TO 'espocrm_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Verify database creation and user privileges by attempting to connect with the new credentials:

mysql -u espocrm_user -p

After entering the password, ensure you can access the EspoCRM database:

SHOW DATABASES;
USE espocrm;
EXIT;

Successful execution of these commands confirms proper database setup and user permissions, establishing the data storage component required for EspoCRM operation.

Step 4: Installing PHP and Required Extensions

PHP serves as the programming language that powers EspoCRM’s functionality, with specific version and extension requirements. Install PHP and core extensions using the following command:

sudo apt install php php-cli php-common php-curl php-xml php-zip php-gd php-mysql php-mbstring php-json php-imap php-bcmath php-intl php-opcache -y

Verify the PHP installation and version with:

php -v

Ubuntu 24.04 includes PHP 8.3 by default, which offers optimal performance and security for EspoCRM. The installation process requires several PHP extensions to support various functionalities:

Confirm that all required extensions are properly installed and enabled with:

php -m | grep -E 'curl|zip|gd|mysql|mbstring|json|imap|xml|bcmath|intl|opcache'

Optimize PHP performance by adjusting configuration parameters to accommodate EspoCRM’s requirements. Create a custom PHP configuration file for Apache:

sudo nano /etc/php/8.3/apache2/conf.d/99-espocrm.ini

Add the following configuration parameters, adjusting values based on server resources:

memory_limit = 256M
max_execution_time = 180
max_input_time = 180
post_max_size = 50M
upload_max_filesize = 50M
date.timezone = "UTC"

Create a matching configuration for PHP CLI which is used for scheduled tasks:

sudo nano /etc/php/8.3/cli/conf.d/99-espocrm.ini

Add the same parameters as the Apache configuration. Restart Apache to apply the PHP configuration changes:

sudo systemctl restart apache2

Create a simple PHP information file to verify all settings and extensions:

echo "" | sudo tee /var/www/html/info.php

Access this file in a web browser (http://your_server_ip/info.php) to review the PHP configuration. After verification, remove this file to prevent information disclosure:

sudo rm /var/www/html/info.php

This comprehensive PHP installation provides the necessary runtime environment with appropriate extensions and optimized configuration for EspoCRM’s operational requirements.

Step 5: Downloading and Preparing EspoCRM Files

Obtaining the latest EspoCRM release ensures access to current features, security patches, and compatibility improvements. Navigate to the temporary directory and download the latest stable version:

cd /tmp
wget https://www.espocrm.com/downloads/latest.zip

Verify the downloaded file’s integrity before proceeding with the installation. While EspoCRM doesn’t currently provide checksum verification, check the file size to ensure complete download:

ls -lh latest.zip

The file should be approximately 30-35MB in size, though exact values may vary with newer releases. Install the unzip utility if not already present:

sudo apt install unzip -y

Extract the EspoCRM files from the archive:

unzip latest.zip

The extraction creates a directory named “EspoCRM-x.y.z” where x.y.z represents the version number. Move these files to the web server’s document root:

sudo mv EspoCRM-* /var/www/html/espocrm

Set appropriate file ownership to ensure the web server can properly access and modify files as needed:

sudo chown -R www-data:www-data /var/www/html/espocrm

Configure proper directory and file permissions to balance security with functionality:

sudo find /var/www/html/espocrm -type d -exec chmod 755 {} \;
sudo find /var/www/html/espocrm -type f -exec chmod 644 {} \;

Create dedicated directories for EspoCRM data storage with appropriate permissions:

sudo mkdir -p /var/www/html/espocrm/data
sudo mkdir -p /var/www/html/espocrm/custom
sudo chmod -R 775 /var/www/html/espocrm/data
sudo chmod -R 775 /var/www/html/espocrm/custom

The data directory stores dynamic content including attachments, cache files, and temporary data, while the custom directory contains system customizations such as extensions, custom views, and modules. These directories require write permissions to function properly.

Verify directory structure and permissions with:

ls -la /var/www/html/espocrm

This preparation process ensures all EspoCRM files are properly placed with correct ownership and permissions before proceeding to the web-based installation wizard.

Step 6: Configuring Web Server for EspoCRM

Proper Apache configuration enables secure, efficient access to the EspoCRM application. Start by creating a comprehensive virtual host configuration file if not already completed:

sudo nano /etc/apache2/sites-available/espocrm.conf

Implement a detailed configuration that includes both HTTP and HTTPS settings (assuming SSL will be configured):

<VirtualHost *:80>
    ServerName crm.yourdomain.com
    ServerAdmin webmaster@yourdomain.com
    DocumentRoot /var/www/html/espocrm

    <Directory /var/www/html/espocrm/>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/espocrm_error.log
    CustomLog ${APACHE_LOG_DIR}/espocrm_access.log combined

    # Redirect to HTTPS
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</VirtualHost>

Implementing SSL/TLS significantly enhances security for EspoCRM deployments, protecting sensitive customer and business data. Install Certbot for Let’s Encrypt certificate management:

sudo apt install certbot python3-certbot-apache -y

Obtain and configure an SSL certificate:

sudo certbot --apache -d crm.yourdomain.com

Follow the interactive prompts to complete the certificate setup. Certbot automatically configures Apache for HTTPS access and creates a renewal schedule. Verify the SSL configuration using online tools or browsers to ensure proper implementation.

URL rewriting setup ensures clean, user-friendly URLs within EspoCRM. The platform includes a default .htaccess file with necessary rewrite rules. Verify the file exists in the EspoCRM root directory:

cat /var/www/html/espocrm/.htaccess

If missing or incomplete, create or update the file with standard EspoCRM rewrite rules:

sudo nano /var/www/html/espocrm/.htaccess

Insert the following content:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Set appropriate ownership and permissions for the .htaccess file:

sudo chown www-data:www-data /var/www/html/espocrm/.htaccess
sudo chmod 644 /var/www/html/espocrm/.htaccess

Finalize the configuration by restarting Apache to apply all changes:

sudo systemctl restart apache2

Test the configuration by accessing the domain in a web browser (https://crm.yourdomain.com), which should redirect to the EspoCRM installer if properly configured. These server configurations establish a secure, optimized environment for EspoCRM operation with proper URL handling and transport encryption.

Step 7: Running the EspoCRM Web Installer

The EspoCRM web installer provides a user-friendly interface for finalizing the installation process. Access the installation wizard by navigating to your server’s domain or IP address in a web browser:

https://crm.yourdomain.com/

The system automatically redirects to the installation page on first access. If using an IP address rather than domain name, use:

http://your_server_ip/espocrm/

The installation wizard presents a welcome screen with language selection options. Choose the preferred language and click “Start” to begin the process.

System requirements verification represents the first installation phase, where the wizard automatically checks for required PHP extensions, file permissions, and other dependencies. The interface displays a comprehensive list of checks with corresponding status indicators. Green checkmarks indicate passed requirements, while red X markers highlight issues requiring resolution. Common issues include missing PHP extensions, insufficient file permissions, or incomplete server configurations. Address any identified problems before proceeding:

  1. For missing PHP extensions: Install the required modules using apt
  2. For permission issues: Adjust directory permissions as noted in previous steps
  3. For configuration problems: Modify PHP settings in configuration files

After resolving all requirements issues, click “Next” to proceed to database configuration.

Database connection configuration links EspoCRM with the MariaDB database created earlier. Enter the following information in the provided fields:

  • Host Name: localhost (or database server address if using a remote database)
  • Database Name: espocrm (as created earlier)
  • User Name: espocrm_user (the database user created previously)
  • Password: (the password set for the database user)
  • Database Type: MySQL (compatible with MariaDB)

Click “Test Connection” to verify database credentials before proceeding. A successful connection enables the “Next” button to continue installation.

Administrator account creation establishes the primary system management user. Enter details for this account with particular attention to security:

  • Username: Choose a non-standard admin username (avoid “admin” or “administrator”)
  • Password: Create a strong password with mixed case, numbers, and special characters
  • Confirm Password: Re-enter the password for verification
  • Name: Enter the administrator’s full name
  • Email: Provide a valid email address for notifications and recovery

System settings configuration defines fundamental operational parameters:

  • System Name: Enter your organization’s name or preferred CRM system title
  • Language: Select the default system language
  • Date Format: Choose your preferred date display format
  • Time Format: Select 12-hour or 24-hour time display
  • Currency: Set the primary currency for financial data
  • Time Zone: Choose your organization’s time zone

After completing all fields, click “Next” to initiate the installation process. The wizard creates database tables, installs default data, and configures the system based on provided information. This process may take several minutes depending on server performance. Upon completion, a success message appears with a link to access the newly installed system. Click the link to log in using the administrator credentials created during installation.

Step 8: Post-Installation Configuration

Security hardening measures provide additional protection for your EspoCRM deployment beyond standard installation settings. Implement file access restrictions for sensitive configuration files:

sudo chmod 644 /var/www/html/espocrm/data/config.php

Consider implementing IP-based access restrictions for administrative functions by adding location directives to the Apache configuration:

sudo nano /etc/apache2/sites-available/espocrm.conf

Add the following within the VirtualHost block, adjusting IP addresses as appropriate:

<Location /admin>
    Order deny,allow
    Deny from all
    Allow from 192.168.1.0/24
</Location>

Reload Apache to apply these changes:

sudo systemctl reload apache2

Cron job setup ensures EspoCRM background processes operate properly, handling scheduled tasks, email fetching, and notifications. Create a dedicated crontab entry for the web server user:

sudo crontab -u www-data -e

Add the following line to run the EspoCRM scheduler every minute:

* * * * * /usr/bin/php -f /var/www/html/espocrm/cron.php > /dev/null 2>&1

Alternatively, for more detailed logging of cron operations:

* * * * * /usr/bin/php -f /var/www/html/espocrm/cron.php >> /var/log/espocrm-cron.log 2>&1

Verify the cron job is properly installed:

sudo crontab -u www-data -l

Backup strategy implementation provides data protection and disaster recovery capabilities. Create a comprehensive backup script:

sudo nano /usr/local/bin/backup-espocrm.sh

Add the following script content:

#!/bin/bash
# EspoCRM backup script

# Set variables
BACKUP_DIR="/var/backups/espocrm"
DATE=$(date +"%Y-%m-%d_%H-%M")
DB_USER="espocrm_user"
DB_PASS="your_password_here"
DB_NAME="espocrm"
ESPO_DIR="/var/www/html/espocrm"

# Create backup directory if it doesn't exist
mkdir -p $BACKUP_DIR

# Backup database
mysqldump -u$DB_USER -p$DB_PASS $DB_NAME | gzip > $BACKUP_DIR/espocrm_db_$DATE.sql.gz

# Backup files
tar -czf $BACKUP_DIR/espocrm_files_$DATE.tar.gz $ESPO_DIR

# Remove backups older than 7 days
find $BACKUP_DIR -type f -name "espocrm_*" -mtime +7 -delete

# Log backup completion
echo "Backup completed on $DATE" >> $BACKUP_DIR/backup_log.txt

Make the script executable and secure it from unauthorized access:

sudo chmod 700 /usr/local/bin/backup-espocrm.sh

Create a scheduled task to run this backup daily:

sudo crontab -e

Add the following line:

0 2 * * * /usr/local/bin/backup-espocrm.sh

These post-installation configurations enhance security, ensure proper system maintenance, and protect against data loss, establishing a robust operational environment for EspoCRM.

Alternative Installation Methods

Using EspoCRM’s installation script provides a streamlined approach for experienced administrators. This method automates most installation steps through a single command-line utility. Begin by downloading the script directly to your server:

wget https://raw.githubusercontent.com/espocrm/espocrm-installer/master/install.sh

Make the script executable and run it with sudo privileges:

chmod +x install.sh
sudo ./install.sh

The script interactively prompts for installation details including server path, database credentials, and initial administrator information. After providing the requested information, the script automatically installs dependencies, configures the web server, and sets up the database. While convenient, this method provides less granular control over individual components compared to manual installation.

Docker-based deployment offers excellent isolation and portability for EspoCRM installations. This approach encapsulates the application and its dependencies in containers, simplifying deployment across different environments. Create a directory for the Docker configuration:

mkdir -p ~/espocrm-docker
cd ~/espocrm-docker

Create a docker-compose.yml file:

nano docker-compose.yml

Add the following configuration:

version: '3'
services:
  espocrm:
    image: espocrm/espocrm
    ports:
      - "8080:80"
    volumes:
      - ./data:/var/www/html/data
      - ./custom:/var/www/html/custom
      - ./extensions:/var/www/html/extension
    environment:
      - ESPOCRM_DATABASE_HOST=db
      - ESPOCRM_DATABASE_NAME=espocrm
      - ESPOCRM_DATABASE_USER=espocrm
      - ESPOCRM_DATABASE_PASSWORD=espocrm_password
    depends_on:
      - db

  db:
    image: mariadb:10.6
    environment:
      - MYSQL_ROOT_PASSWORD=root_password
      - MYSQL_DATABASE=espocrm
      - MYSQL_USER=espocrm
      - MYSQL_PASSWORD=espocrm_password
    volumes:
      - ./mysql-data:/var/lib/mysql

Launch the containers using Docker Compose:

docker-compose up -d

Access the EspoCRM installer through http://your_server_ip:8080 and follow the web-based setup process. This containerized approach simplifies upgrades and migrations while providing consistent environments across development and production systems.

Nginx represents a popular alternative web server for EspoCRM deployments, offering potential performance benefits for high-traffic implementations. Install Nginx instead of Apache:

sudo apt install nginx -y

Create an Nginx configuration file for EspoCRM:

sudo nano /etc/nginx/sites-available/espocrm

Add this configuration template:

server {
    listen 80;
    server_name crm.yourdomain.com;
    root /var/www/html/espocrm;
    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}

Enable the site and restart Nginx:

sudo ln -s /etc/nginx/sites-available/espocrm /etc/nginx/sites-enabled/
sudo systemctl restart nginx

Nginx configuration differs primarily in URL rewriting syntax and PHP processing methods, using PHP-FPM rather than Apache’s mod_php. This configuration can provide improved performance for concurrent connections and static file serving.

Troubleshooting Common Installation Issues

Permission-related problems frequently occur during EspoCRM installation and operation. Common error messages include “Permission denied” or “Error creating file” notifications in the installation wizard or application logs. These issues typically stem from incorrect ownership or insufficient access rights on system directories. Resolve these problems by verifying and correcting permissions:

sudo chown -R www-data:www-data /var/www/html/espocrm
sudo chmod -R 755 /var/www/html/espocrm
sudo chmod -R 775 /var/www/html/espocrm/data
sudo chmod -R 775 /var/www/html/espocrm/custom

For persistent permission issues, check Apache’s running user with ps aux | grep apache and adjust ownership accordingly.

Database connection failures manifest as “Could not connect to database” errors during installation or “Database error” messages during operation. These problems typically result from incorrect credentials, network configuration issues, or database server problems. Begin troubleshooting by verifying connection parameters:

mysql -u espocrm_user -p -h localhost

If manual connection succeeds but EspoCRM cannot connect, check the database configuration file for errors:

sudo cat /var/www/html/espocrm/data/config.php

Verify the database service is running with sudo systemctl status mariadb and restart if necessary with sudo systemctl restart mariadb.

PHP configuration issues typically present as blank pages, incomplete functionality, or specific error messages referencing PHP functions or memory limits. Check PHP error logs for detailed information:

sudo tail -f /var/log/apache2/error.log

Common PHP issues include insufficient memory allocation, missing extensions, or incorrect PHP version. Verify PHP configuration with:

php -i | grep memory_limit
php -m
php -v

Modify PHP settings in the appropriate configuration files:

sudo nano /etc/php/8.3/apache2/conf.d/99-espocrm.ini

Web server errors generally appear as HTTP status codes (403, 404, 500) or blank pages when accessing EspoCRM. Analyze Apache error logs to identify specific issues:

sudo tail -f /var/log/apache2/error.log
sudo tail -f /var/log/apache2/espocrm_error.log

Common server issues include misconfigured virtual hosts, incorrect rewrite rules, or insufficient module activation. Verify Apache configuration syntax:

sudo apache2ctl configtest

Enable detailed error reporting temporarily by editing the .htaccess file:

php_flag display_errors on
php_value error_reporting E_ALL

Remember to remove these settings in production environments after resolving issues.

Maintaining and Upgrading EspoCRM

Routine maintenance procedures ensure optimal EspoCRM performance and reliability. Implement regular cache clearing to prevent performance degradation:

sudo -u www-data php /var/www/html/espocrm/clear_cache.php

Schedule this operation weekly using cron:

0 1 * * 0 sudo -u www-data php /var/www/html/espocrm/clear_cache.php

Database optimization maintains performance as data volume increases. Execute periodic optimization commands:

mysql -u root -p -e "OPTIMIZE TABLE espocrm.account, espocrm.contact, espocrm.email, espocrm.opportunity;"

Monitor log files regularly to identify potential issues before they impact operations:

sudo tail -f /var/log/apache2/espocrm_error.log
tail -f /var/www/html/espocrm/data/logs/*

The upgrade process requires careful planning to prevent data loss or system disruption. Begin by creating comprehensive backups of both database and files:

# Database backup
mysqldump -u root -p espocrm > espocrm_backup.sql

# Files backup
tar -czf espocrm_files_backup.tar.gz /var/www/html/espocrm

Download the latest EspoCRM version from the official website and extract it to a temporary location:

cd /tmp
wget https://www.espocrm.com/downloads/latest.zip
unzip latest.zip

Place the system in maintenance mode by creating a maintenance file:

sudo touch /var/www/html/espocrm/data/maintenance.php

Copy custom files and data to the new version:

sudo cp -r /var/www/html/espocrm/data /tmp/EspoCRM-*/
sudo cp -r /var/www/html/espocrm/custom /tmp/EspoCRM-*/
sudo cp /var/www/html/espocrm/data/config.php /tmp/EspoCRM-*/data/

Replace the current installation with the updated version:

sudo rm -rf /var/www/html/espocrm
sudo mv /tmp/EspoCRM-* /var/www/html/espocrm
sudo chown -R www-data:www-data /var/www/html/espocrm

Run the upgrade script through the web interface by accessing:

https://crm.yourdomain.com/upgrade

After successfuly upgrade, remove the maintenance mode file:

sudo rm /var/www/html/espocrm/data/maintenance.php

Clear the system cache to apply all changes:

sudo -u www-data php /var/www/html/espocrm/clear_cache.php

These maintenance and upgrade procedures ensure continuous operation with current features and security updates.

Congratulations! You have successfully installed EspoCRM. Thanks for using this tutorial for installing Zurmo EspoCRM on Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the official EspoCRM website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button