• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Debian

How to Install Monica on Debian 9

How VPS by How VPS
November 1, 2019
in Debian
0
0
SHARES
101
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Using a Different System?
  2. Requirements
  3. Install PHP
  4. Install MySQL and setup database
  5. Install and configure Nginx
  6. Install Node.js and NPM
  7. Install Composer
  8. Install and configure Monica
  9. Want to contribute?

Using a Different System?

  • How to Install Monica on Ubuntu 18.04 LTS

  • How to Install Monica on CentOS 7

  • How to Install Monica on Fedora 28

  • How to Install Monica on FreeBSD 12

Are we missing a guide for your target system? Request one, or submit your own!


Monica is an open source personal relationship management system. Think of it as a CRM (a popular tool used by sales teams in the corporate world) for your friends or family. Its source code is publicly hosted on GitHub. In this guide, we will go over the installation process of a Monica application.

Requirements

  • Debian 9.x (Stretch)
  • Git
  • NPM (Node Package Manager)
  • PHP 7.1+ or newer
  • MySQL
  • Nginx
  • Composer

Check the Debian version.

lsb_release -ds
# Debian GNU/Linux 9.4 (stretch)

Create a new non-root user account with sudo access and switch to it.

adduser johndoe --gecos "John Doe"
usermod -aG sudo johndoe
su - johndoe

NOTE: Replace johndoe with your username.

Set up the timezone.

sudo dpkg-reconfigure tzdata

Ensure that your system is up to date.

sudo apt update && sudo apt upgrade -y

Install the build-essential, curl, git, apt-transport-https, libpng-dev packages.

sudo apt install -y build-essential curl git apt-transport-https libpng-dev

Install PHP

Add the repository for newer versions of PHP.

sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
sudo apt update

Install PHP 7.2 and required PHP extensions.

sudo apt install -y php7.2 php7.2-cli php7.2-fpm php7.2-common php7.2-mbstring php7.2-xml php7.2-mysql php7.2-curl php7.2-zip php7.2-intl php7.2-bcmath php7.2-gd

Check the version.

php --version

# PHP 7.2.5-1+0~20180505045740.21+stretch~1.gbpca2fa6 (cli) (built: May  5 2018 04:57:44) ( NTS )
# Copyright (c) 1997-2018 The PHP Group
# Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
#     with Zend OPcache v7.2.5-1+0~20180505045740.21+stretch~1.gbpca2fa6, Copyright (c) 1999-2018, by Zend Technologies

Install MySQL and setup database

Install MySQL.

cd /tmp
wget https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb
rm mysql-apt-config_0.8.10-1_all.deb
sudo apt update
sudo apt install -y mysql-server

Check the version.

mysql --version
# mysql  Ver 8.0.11 for Linux on x86_64 (MySQL Community Server - GPL)

Run the mysql_secure installation script to improve MySQL security and set the password for the MySQL root user.

sudo mysql_secure_installation

Connect to the MySQL shell as the root user.

sudo mysql -u root -p
# Enter password

Create an empty MySQL database and user for Monica, and remember the credentials.

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

Install and configure Nginx

Install Nginx.

sudo apt install -y nginx

Check the version.

sudo nginx -v
# nginx version: nginx/1.10.3

Run sudo vim /etc/nginx/sites-available/monica.conf and configure Nginx for Monica.

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

    server_name example.com;
    root /var/www/monica/public;

    index index.php;

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

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

Save the file and exit.

Activate the new monica.conf configuration by linking the file to the sites-enabled directory.

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

Test the configuration.

sudo nginx -t

Reload Nginx.

sudo systemctl reload nginx.service

Install Node.js and NPM

Install Node.js.

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

Check the Node.js and NPM versions.

node -v && npm -v
# v10.2.1
# 5.6.0

Install Composer

Install Composer.

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer

Check the version.

composer --version
# Composer version 1.6.5 2018-05-04 11:44:59

Install and configure Monica

Create an empty document root folder where Monica should be installed.

sudo mkdir -p /var/www/monica

Navigate to the document root folder.

cd /var/www/monica

Change ownership of the /var/www/monica folder to user johndoe.

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

Clone the Monica repository to it.

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

NOTE: Find the latest official version on the releases page on GitHub and update the above version number to the latest release.

Create your own file containing the environment variables required by Monica.

cp .env.example .env

Update the .env file to your specific needs. Don’t forget to set DB_USERNAME and DB_PASSWORD with the settings used previously.

Install all packages.

composer install --no-interaction --no-suggest --no-dev --ignore-platform-reqs

Install all the front-end dependencies and tools needed to compile assets.

npm install

Compile the JS and CSS assets.

npm run production

Generate an application key. This will set APP_KEY to the correct value automatically.

php artisan key:generate

Run the migrations and seed the database and symlink folders.

php artisan setup:production

Change ownership of the /var/www/monica directory to www-data.

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

The installation is complete. Open your domain in your web browser and follow the instructions shown on screen.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

Installing Fuel CMS on Debian 9

Next Post

How to Install Flarum Forum on Debian 10

Next Post

How to Install Flarum Forum on Debian 10

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet