Home / How To / How to install Monica Personal Relationship Manager on Debian 10

How to install Monica Personal Relationship Manager on Debian 10

Monica is an open source Personal Relationship Management (PRM) web application designed to organize interactions with your loved ones. Think of it as a CRM (a popular tool used by sales teams in the corporate world) for your friends or family. Monica allows people to keep track of everything that is important about their friends and family. Like the activities with them. When you last called someone. What you talked about. It helps you remember the child's name and age. It can also remind you to call someone you haven't talked to in a while.


  • Adding and managing contacts
  • Defining relationships between contacts
  • Reminders
  • Auto birthday reminders
  • Stay in touch with the contact by sending reminders at a certain interval [1
    965900419659004] Ability to add notes to a contact
  • Ability to indicate how you met someone
  • Handling activities done with a contact
  • Handling of data
  • Handling of gifts
  • Handling of addresses and all the different ways to contact someone
  • Contact field management
  • Contact animal management
  • Basic journal
  • Ability to specify how the day went
  • Upload documents and photos
  • Export and import data [19659004] Export Contact as vCard
  • Ability to Specify Custom Gender
  • Ability to Define Custom Activity Types
  • favorite contacts [1 9659004] Track conversations on social media or SMS
  • Multi-user
  • Labels for organizing contacts
  • Ability to define which section to display on the contact sheet
  • Multiple currencies
  • Multilingual ]] An API that covers most data


  • Debian 10.x (Buster)
  • Git
  • NPM (Node Package Manager)
  • PHP version 7.1 or later
  • MySQL [19659004] HTTP server with PHP support (eg: Apache, Nginx, Caddy …)
  • Composer
  • Optional: Redis or Beanstalk


  • Operating system Debian 10 (buster).
  • A non-root user with sudo privileges.

Initial steps

Check your Debian version:

  lsb_release -ds 
# Debian GNU / Linux 10 (buster)

Set the time zone:

  sudo dpkg-reconfigure tzdata 

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

  sudo apt update && sudo apt upgrade -y 

Install some important packages necessary for basic administration of Debian operating system :

  sudo apt install -y curl wget vim git unzip socat bash-finishing apt-transport-https libpng-dev 

Step 1 – Install PHP

Install PHP, as well as the necessary PHP extensions :

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

To view PHP compiled in modules you can run:

   php -m 

. . .
. . .

Check PHP version:

  php --version 

# PHP 7.3.11-1 ~ deb10u1 (cli) (built: October 26, 2019 2:14:18 PM) (NTS )
# Copyright (c) 1997-2018 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

PHP-FPM service is automatically started and activated upon restarting the Debian 10 system, so there is no need to start and activate it manually. We can move on to the next step.

Step 2 – Install the acme.sh client and obtain Let & # 39; s Encrypt Certificate (optional)

Securing your website with HTTPS is not necessary, but it is a good practice to secure your site's traffic. To get a TLS certificate from Let & # 39; s Encrypt, we will use the acme.sh client. Acme.sh is a simple UNIX shell software to obtain TLS certificates from Let & # 39; s Encrypt with zero dependencies.

Download and install acme.sh:ebrit19659046??sudo su – root
git clone https://github.com/ Neilpang / acme.sh.git
cd acme.sh
./ acme.sh Рinstall Рaccountmail [email protected] source ~ / .bashrc
cd ~

Check acme.sh version:

  acme.sh - version 
# v2.8.2

Obtain RSA and ECC / ECDSA certificate for your domain / host name:

  # RSA 2048 
acme.sh - emission - standalone -d example.com --keylength 2048
acme.sh --issue - standalone -d example .com - key length ec-256

If you want fake certificates for testing, you can add - staging flag for the commands above.

After running the above commands, certificate and keys will be in:

  • For [1 9459024] RSA : / home / username / example.com directory.
  • For ECC / ECDSA : /home/usname/example.com_ecc directory.

To list your issued certificates you can run:

  acme.sh --list 

Create a directory to store your certificates. We will use the directory / etc / letsencrypt .

  mkdir -p /etc/letsecnrypt/example.com Chapter19659078vardsudo mkdir -p /etc/letsencrypt/example.com_eccebrit19659047 ch an19459028] Install / copy certificate to    / etc / letsencrypt     .        

  # RSA 
acme.sh --install-cert -d example.com --cert-file / etc / letsencrypt / example.com / cert.pem --key-file /etc/letsencrypt/example.com/private.key --fullchain-file /etc/letsencrypt/example.com/fullchain.pem --reloadcmd "sudo systemctl reload nginx.service "
acme.sh --install-cert -d example. com --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 are automatically renewed every 60 days.

After getting certificate exit from root user and returning to normal sudo user:


Step 3 - Install MariaDB and create a database for Monica

Install MariaDB database server:

  sudo apt install -y mariadb server 

Check version MariaDB :

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

Run mysql_secure installation script to improve MariaDB security and set the password for MariaDB root user:

  sudo mysql_secure_installation 

Answer all questions:

  Do you want to set up VALIDATED PASSWORD plugin?  N 
New password: your_secure_password
Enter new password: your_secure_password
Remove anonymous users? [Y/n] Y
Remove root login remotely? [Y/n] Y
Delete the test database and access it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Connect to MariaDB shell as root user: [19659000] sudo mysql -u root -p
# Enter password

Create an empty MariaDB database and users for Monica and remember references:

  mariadb> CREATE DATABASE dbname; 
mariadb> GRANT ALL ON dbname. * TO & # 39; username & # 39; IDENTIFIED BY & # 39; password & # 39 ;;

Exit from MariaDB :

  mariadb> exit [19659047] Replace  dbname,   username  and  password  with your names . 

Step 4 - Install and Configure NGINX

Monica works well with most large web server software with PHP support, but in this guide we will use NGINX. Use Apache if you prefer NGINX.

Install NGINX:

  sudo apt install -y nginx 

Check NGINX version:

  sudo nginx -v 
# nginx version: nginx / 1.14.2 Chapter19659047achteRun sudo vim / etc /nginx/sites-available/monica.confebrit19659125] command and configure NGINX for Monica.

  server {
listen 80;
listen [::]: 80;
listen 443 ssl; 
listen [::]: 443 ssl;

ssl_certificate /etc/letsencrypt/example.com/fullchain.pem;ebrit19459020vudssl_certificate_key /etc/letsencrypt/example.com/private.key;
ssl_certificate /etc/letsencrypt/example.com_ecc/fullchain.pem; Chapter19459020vardssl_certificate_key /etc/letsencrypt/example.com_ecc/private.key;ebrit19459020] server name example.com; root / var / www / monica / public; index index.php; location / { try_files $ uri $ uri //index.php?$args; } location ~ .php $ { include excerpt / fastcgi-php.conf; fastcgi_pass unix: /var/run/php/php7.3-fpm.sock; } }

Enable the new monica.conf configuration by linking the file to the site-enabled directory:

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

Test NGINX configuration:

  sudo nginx -t 

Reload NGINX:

  sudo systemctl reload nginx.service 

Step 5 - Install Node .js and npm

Install Node.js:

  curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - 
sudo apt install -y nodejs

Check Node.js and npm versions:

  node -v && npm -v 
# v12.13.0
# 6.12.0 [19659138] Step 6 - Install Composer

Install Composer:

  php -r "copy (& # 39; https: //getcomposer.org/installer&#39 ;, & # 39; composer-setup.php & # 39 ;); " 
php -r "if (hash_file (& # 39; SHA384 ;, & # 39 & # 39; Composer setup.php & # 39;) === & # 39; a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858caller;} echo PHP_EOL;"
php composer-setup.php
php -r "unlink (& # 39; composer-setup.php & # 39;);"
sudo mv composer.phar / usr / local / bin / composer

Check composite 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 where Monica is to be installed: [19659044] sudo mkdir -p / var / www / monica [19659047] Navigate to the document root directory:

  cd / var / www / monica 

Change the ownership of the / var / www / monica folder to the user johndoe: [19659063] Don't forget to replace "johndoe" with your username.

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

clone Monica archive to it:

  git clone https: // github. com / monicahq / monica.git. 
git checkout tags / v2.15.2

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

How to create your version of all environment variables needed for the project to work :

  cp .env.example .env 

Update .env [19659088] to your specific needs. Don't forget to set DB_USERNAME and DB_PASSWORD with the settings used behind. You must configure a email server for registration and reminders to function properly.

Run composite installation - no-interaction - no-suggest - no-dev to install all packages.

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

Run php artisan setup: production -v to run the migrations, seed database and symlink folders.

Set right ownership and permissions:

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

Step 8 - Complete the Monica installation

Now open your browser and type the URL http://example.com. You will be redirected to the following page:

  Create an account

Enter your e-mail address, name and password. Then click the Register button. You should see the Monica dashboard on the following page:

  Monica PRM login

Source link