How to install Monica Personal Relationship Manager on CentOS 8

How to install Monica Personal Relationship Manager on CentOS 8

Monica is an open source personal relationship management (PRM) web application designed to organize interactions with loved ones. Think of it as a CRM (CRM) for your friends or family (a popular tool used by corporate sales teams). Monica allows people to track all important information about their friends and family. Like activities done with them. When you last called someone. What you are talking about will help you remember your child’s name and age. It can also remind you to call someone you haven’t chatted with for a while. This tutorial will show you how to install Monica on CentOS 8.


  • Add and manage contacts
  • Define relationships between contacts
  • reminders
  • Automatic birthday reminder
  • Keep in touch with contacts by sending reminders at given intervals
  • Debt management
  • Ability to add comments to contacts
  • Be able to show how you know someone
  • Event management with contacts
  • Task management
  • Gift management
  • Address management and all the different ways to connect with others
  • Management of contact field types
  • Pet Contact Management
  • Basic journal
  • Able to indicate the passing of the day
  • Upload files and photos
  • Data import and export
  • Export contacts as vCard
  • Ability to set custom gender
  • Ability to define custom activity types
  • Ability to love contacts
  • Track conversations on social media or SMS
  • Multi-user
  • Tags to organize contacts
  • Ability to define what should be displayed on the contact form
  • Multiple currencies
  • multilingual
  • API covering most data


  • CentOS 8
  • Git
  • NPM (Node Package Manager)
  • PHP 7.1 or higher
  • MySQL
  • HTTP server with PHP support (eg: Apache, Nginx, Caddy …)
  • composer
  • Optional: Redis or Beanstalk


  • A CentOS 8 operating system.
  • Non-root user with the following permissions sudo privilege.

Preliminary steps

Check your CentOS version:

cat /etc/centos-release# CentOS Linux release 8.0.1905 (Core)

Set time zone:

timedatectl list-timezonessudo timedatectl set-timezone 'Region/City'

Update your operating system package (software). This is an important first step because it ensures that you have the latest updates and security fixes for the operating system’s default packages:

sudo yum update -y

Install some basic packages that are required for basic management of CentOS operating system:

sudo yum install -y curl wget vim git unzip socat bash-completion epel-release gcc-c++ make libpng-devel

Step 1-install PHP

Install PHP and required PHP extensions:

sudo yum install -y php php-cli php-fpm php-common php-mbstring php-xml php-mysqlnd php-curl php-zip php-intl php-bcmath php-gd php-json php-gmp

To display PHP compiled in the module, run:

php -mctypecurlexiffileinfo. . .. . .

Check PHP version:

php --version# PHP 7.2.11-1-(cli) (built: Oct 26 2019 14:14:18) ( NTS )# Copyright (c) 1997-2018 The PHP Group# Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies# with Zend OPcache v7.3.11-1~deb10u1, Copyright (c) 1999-2018, by Zend Technologies

Start and enable the PHP-FPM service:

sudo systemctl start php-fpm.servicesudo systemctl enable php-fpm.service

Step 2-Install the client and obtain the “Let’s Encrypt” certificate (optional)

There is no need to protect your website using HTTPS, but it is a good practice to secure your website traffic. In order to obtain a TLS certificate from Let’s Encrypt, we will use the client. is a simple UNIX shell software for obtaining TLS certificates from Let’s Encrypt with zero dependencies.

Download and install

sudo su - rootgit clone ./ --install --accountemail [email protected]source ~/.bashrccd ~

Check the version: --version# v2.8.2

Gain RSA with ECC / ECDSA Your domain / hostname certificate:

# RSA --issue --standalone -d --keylength 2048# --issue --standalone -d --keylength ec-256

If you want to test with a fake certificate, you can add --staging Mark the above command.

After running the above command, your certificate and key will be located at:

  • For RSA: /home/username/ table of Contents.
  • For ECC / ECDSA: /home/username/example.com_ecc table of Contents.

To list the certificates you issued, you can run: --list

Create a directory to store your certificates. We will use /etc/letsencrypt table of Contents.

mkdir -p /etc/letsecnrypt/example.comsudo mkdir -p /etc/letsencrypt/example.com_ecc

Install / copy the certificate to the / etc / letsencrypt directory.

# --install-cert -d --cert-file /etc/letsencrypt/ --key-file /etc/letsencrypt/ --fullchain-file /etc/letsencrypt/ --reloadcmd "sudo systemctl reload nginx.service"# ECC/ --install-cert -d --ecc --cert-file /etc/letsencrypt/example.com_ecc/cert.pem --key-file /etc/letsencrypt/example.com_ecc/private.key --fullchain-file /etc/letsencrypt/example.com_ecc/fullchain.pem --reloadcmd "sudo systemctl reload nginx.service"

All certificates will be automatically renewed every 60 days.

After obtaining the certificate, exit from the root user and return to the regular sudo user:


Step 3-install MariaDB and create database for Monica

Install MariaDB database server:

sudo yum install -y mariadb-server

Check MariaDB version:

mysql --version# mysql  Ver 15.1 Distrib 10.3.17-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Start and enable MariaDB service:

sudo systemctl start mariadb.servicesudo systemctl enable mariadb.service

Run mysql_secure installation Script to improve MariaDB security and set MariaDB password root user:

sudo mysql_secure_installation

Answer each question:

Would you like to setup VALIDATE PASSWORD plugin? NNew password: your_secure_passwordRe-enter new password: your_secure_passwordRemove anonymous users? [Y/n] YDisallow root login remotely? [Y/n] YRemove test database and access to it? [Y/n] YReload privilege tables now? [Y/n] Y

Connect to MariaDB Shell as root user:

sudo mysql -u root -p# Enter password

Create an empty MariaDB database and user for Monica, and remember the credentials:

mariadb> CREATE DATABASE dbname;mariadb> GRANT ALL ON dbname.* TO 'username' IDENTIFIED BY 'password';mariadb> FLUSH PRIVILEGES;

Exit from MariaDB:

mariadb> exit

Replace dbname, username with password With your name.

Step 4-install and configure NGINX

Monica works on most major web server software that supports PHP, but in this guide we will use NGINX. If you like NGINX, feel free to use Apache.

Install NGINX:

sudo yum install -y nginx

Check NGINX version:

sudo nginx -v# nginx version: nginx/1.14.2

Run sudo vim /etc/nginx/conf.d/monica.conf Command and configure NGINX for Nonica.

server {
  listen 80;
  listen 443 ssl;

  root /var/www/monica/public/;
  # RSA  ssl_certificate /etc/letsencrypt/;  ssl_certificate_key /etc/letsencrypt/;  # ECC  ssl_certificate /etc/letsencrypt/example.com_ecc/fullchain.pem;  ssl_certificate_key /etc/letsencrypt/example.com_ecc/private.key;
  index index.php;
  charset utf-8;
  location ^~ /storage {
    deny all;  
  location / {
    try_files $uri $uri/ /index.php?$query_string;

  location ~* .php$ {
    fastcgi_split_path_info ^(.+.php)(/.+)$;
    include fastcgi_params;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_buffer_size 16k;
    fastcgi_buffers 4 16k;

Test the NGINX configuration:

sudo nginx -t

Reload NGINX:

sudo systemctl reload nginx.service

Step 5-install Node.js and npm

Install Node.js:

curl --silent --location | sudo bash -sudo yum install -y nodejs

Check Node.js and npm versions:

node -v && npm -v# v12.13.1# 6.12.1

Step 6-install Composer

Install Composer:

php -r "copy('', 'composer-setup.php');"php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"php composer-setup.phpphp -r "unlink('composer-setup.php');"sudo mv composer.phar /usr/local/bin/composer

Check Composer version:

composer --version# Composer version 1.9.1 2019-11-01 17:20:17

Step 7- install and configure Monica

Create an empty document root folder in which Monica should be installed:

sudo mkdir -p /var/www/monica

Navigate to the document root folder:

cd /var/www/monica

Change ownership /var/www/monica Folder for user johndoe:

Don’t forget to replace “johndoe” with your username.

sudo chown -R johndoe:johndoe /var/www/monica

Clone the Monica repository:

git clone .git checkout tags/v2.15.2

Note: Since the master branch may not always be stable, check out the tagged version of Monica. Find the latest official version on the Github release page and update it to the above version number as the latest version.

To create a version of all environment variables needed for the project to run:

cp .env.example .env

Updates .env Meet your specific needs. Don’t forget to set DB_USERNAME with DB_PASSWORD Settings used later. You need to configure the mail server and reminder for registration to work properly.

Run composer install --no-interaction --no-suggest --no-dev Install all packages.

Run php artisan key:generate Generate an application key. This will set APP_KEY Use the correct value automatically.

Run php artisan setup:production -v To run the migration, add seeds to the database and symlink folder.

Set proper ownership and permissions:

sudo chown -R nginx:nginx /var/www/monicasudo chmod -R 775 /var/www/monica/storage

Run sudo vim /etc/php-fpm.d/www.conf And set users and groups to nginx. Initially, it will be set up as users and groups apache.

sudo vim /etc/php-fpm.d/www.conf

Restart php-fpm.service:

sudo systemctl restart php-fpm.service

Step 8- complete Monica installation

Now, open a web browser and enter the URL You will be redirected to the following page:

Provide your email address, name and password. Then, click the register button. You should see the Monica dashboard on the following pages:

Monica PRM login