How to Install EspoCRM on Debian Latest

EspoCRM is an open-source customer relationship management (CRM) platform that is designed to help businesses to better manage their sales and customer data. In this tutorial, we will show you how to install EspoCRM on Debian latest.

Prerequisites

Before you begin with the installation process, ensure that the following prerequisites are met:

Step 1: Update System Packages

Log in to your Debian system with a non-root user with sudo privilege and ensure that the system packages are updated to the latest versions by running the following command:

sudo apt-get update -y && sudo apt-get upgrade -y

Step 2: Install MariaDB Server

EspoCRM requires a database server to store the data. We will use MariaDB as our database server. To install MariaDB, run the following command:

sudo apt-get install mariadb-server -y

After the installation, start the MariaDB service and enable it to start at system boot with the following commands:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Run the following command to secure your MariaDB installation:

sudo mysql_secure_installation

Follow the prompts to set the root password, remove anonymous users, disallow root login remotely, remove test database, and reload the privilege tables.

Step 3: Install PHP and Other Required Modules

Next, we need to install PHP and other required modules to run EspoCRM. To install PHP and the required modules, run the following command:

sudo apt-get install php php-common php-fpm php-cli php-mysql php-json php-curl php-zip php-gd php-ldap php-mbstring php-intl -y

After the installation, restart the PHP-FPM service to apply the changes:

sudo systemctl restart php7.3-fpm

Step 4: Install Nginx Web Server

EspoCRM requires a web server to serve the application. We will use Nginx as our web server. To install Nginx, run the following command:

sudo apt-get install nginx -y

After the installation, start the Nginx service and enable it to start at system boot with the following commands:

sudo systemctl start nginx
sudo systemctl enable nginx

Step 5: Create a Database for EspoCRM

Log in to the MariaDB server console as a root user with the following command:

mysql -u root -p

Enter your MariaDB root password when prompted and create a new database and user for EspoCRM with the following command:

CREATE DATABASE espocrmdb;
CREATE USER 'espocrmuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON espocrmdb.* TO 'espocrmuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Replace password in the above command with a strong password.

Step 6: Download EspoCRM

Navigate to the EspoCRM download page and download the latest version of EspoCRM with the following command:

wget https://www.espocrm.com/downloads/EspoCRM-latest.zip

Extract the downloaded archive with the following command:

sudo unzip EspoCRM-latest.zip -d /var/www/html/

After the extraction is completed, navigate to the EspoCRM installation directory with the following command:

cd /var/www/html/EspoCRM/

Step 7: Configure Nginx for EspoCRM

We need to configure Nginx to serve EspoCRM on a web browser. To do this, create a new virtual host configuration file named espocrm.conf in the Nginx sites-available directory with the following command:

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

and paste the following lines in the file:

server {
    listen 80;
    server_name your_domain.com; # Replace with your domain name
    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/php7.3-fpm.sock; # Replace with your PHP version
    }
}

Save and close the file. Then, enable the EspoCRM virtual host with the following command:

sudo ln -s /etc/nginx/sites-available/espocrm.conf /etc/nginx/sites-enabled/

Test the Nginx configuration with the following command:

sudo nginx -t

If there are no errors, restart the Nginx service to apply the changes:

sudo systemctl restart nginx

Step 8: Complete EspoCRM Installation

Open a web browser and navigate to the following URL:

http://your_domain.com

Replace your_domain.com with your actual domain name or IP address.

You will be presented with the EspoCRM installation wizard. Follow the prompts and provide the required information such as database name, database user, and password.

Once the installation is completed, you will be redirected to the EspoCRM login page. Use your administrator account to log in and start using EspoCRM.

Conclusion

That’s it. You have successfully installed EspoCRM on your Debian latest system. You can now start managing your sales and customer data with EspoCRM.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!