Install Monica Personal Relationship Management On Ubuntu 20.04

We can install Monica CRM on ubuntu 20.04. Monica CRM helps you to organize the social interaction with people. Let’s see, how to install Monica on Ubuntu.

Prerequisite:

  1. Web Server (Apache or Nginx)
  2. Database (MySQL, MariaDB)
  3. PHP 7.3+ or newer
  4. Git

Check Out: How To Install Quod Libet On Ubuntu 20.04 / 19.10

Install Monica Personal Relationship Management On Ubuntu 20.04 

We’re going to install PHP and git using the following commands. you will also have to install a PHP composer. 

sudo apt update
sudo apt upgrade -y
sudo apt install -y git php php-intl php-json php-cli php-fpm php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-gmp php-redis

Install PHP Composer:

Use the below command to install a PHP Composer. 

sudo apt install composer

Check the version using composer -v command.

Check Out: How To Install Eclipse IDE On Ubuntu 20.04 / 19.10

Install MySQL database:

We can use any database server like MySQL or MariaDB on ubuntu. I will install the MySQL server using the below command and start the service. 

sudo apt install mysql-server
sudo systemctl start mysql && sudo systemctl enable mysql

Create a database and grant permission. 

mysql> create database monica;
Query OK, 1 row affected (0.03 sec)

mysql> create user 'monica'@'localhost' identified by 'password';
Query OK, 0 rows affected (0.03 sec)

mysql> GRANT ALL PRIVILEGES ON monica.* TO 'monica'@'localhost' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)

Install Monica and Download The Package:

We’ll start the installation of Monica and download the package from Github using the git command. 

cd /var/www/html
sudo git clone https://github.com/monicahq/monica.git

Check Out: How To Install Git Bash and Access AWS EC2 Instance

Rename the Environmental file and open the file to update the database. This is a hidden file with the name of .env.example

cd /var/www/html/monica
sudo mv .env.example .env
sudo vim .env

Change the below database credentials according to your DB and save the file. 

APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=monica
DB_USERNAME=monica
DB_PASSWORD=password

Install the required PHP packages using the composer command. It will take a few minutes to install. 

sudo composer install --no-interaction --no-suggest --no-dev

Once the packages installed, we need to generate the application key using the below command. 

sudo php artisan key:generate

We need to migrate the database using the following command and the Monica setup would be ready. 

ubuntu@ubuntu:/var/www/html/monica$ sudo php artisan setup:production

You are about to setup and configure Monica. Do you wish to continue? (yes/no) [no]:
> yes

✓ Maintenance mode: on
✓ Clear config cache
✓ Clear route cache
✓ Clear view cache
✓ Symlink the storage folder
✓ Performing migrations
✓ Check for encryption keys
✓ Ping for new version
✓ Maintenance mode: off

Monica v2.19.1 is set up, enjoy.

✓ Filling database
Seeding: FakeUserTableSeeder
Seeded: FakeUserTableSeeder (4.04 seconds)
Database seeding completed successfully.
-----------------------------
|
| Welcome to Monica v2.19.1
|
-----------------------------
| You can now log in to your account
| URL: http://localhost
-----------------------------
Setup is done. Have fun.

Check Out: How To Configure Simple Notification Service(SNS) On AWS Cloud

Suppose if you want to access the Monica API, you need to create the token. 

php artisan passport:install

Change the owner and group of the Monica directory. 

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

Configure Apache For Monica:

We will configure apache for Monica and Install Apache using the following command. Enable the rewrite module for the Apache webserver. 

sudo apt install libapache2-mod-php apache2
sudo a2enmod rewrite

Restart the Apache webserver. 

sudo systemctl restart apache2

Create a virtual host using the following command. 

 sudo vim /etc/apache2/sites-available/monica.conf

Check Out: Install PHP Composer and Use On Ubuntu 20.04 /19.10

Add these lines in the file and change the location according to yours. 

<VirtualHost *:80>
ServerName prm.examp.com

ServerAdmin web@localhost
DocumentRoot /var/www/html/monica/public

<Directory /var/www/html/monica/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

ErrorLog /var/log/apache2/monica_error.log
CustomLog /var/log/apache2/monica_access.log combined
</VirtualHost>

Enable the virtual host using the following commands.

cd/etc/apache2/sites-available/monica.conf
sudo a2ensite monica.conf
sudo systemctl restart apache2

Make a host entry in /etc/hosts

192.168.185.146 prm.examp.com

Check for any error in the syntax using sudo apache2ctl -t command. if you get the output like: 

Syntax OK

Change the permissions and restart the apache server. 

sudo chmod -R 775 /var/www/html/monica/storage/

Now access the Monica using the host address http://prm.examp.com and now we have to create an admin user account. 

After the registration, you will get the welcome screen.

monica ubuntu install

Now you can add a person as we did and click on “Add“.

monica crm

Here you can see the personal profile details.

install monica crm ubuntu

In a similar way, you can install Monica CRM on Ubuntu 18.04 as well as 16.04. 

That’s it.

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment