<commit_before># Installing Monica (cPanel Shared Hosting) <!-- omit in toc -->

- [Prerequisites](#prerequisites)
- [Installation steps](#installation-steps)
  - [1. Download the repository](#1-download-the-repository)
  - [2. Setup the database](#2-setup-the-database)
  - [3. Configure Monica](#3-configure-monica)
  - [4. Configure cron job](#4-configure-cron-job)
  - [5. Configure cPanel webserver](#5-configure-cpanel-webserver)
  - [Final step](#final-step)

## Prerequisites

Monica can be configured in shared hosting environments with a little differences that we can remedy easily. In this scenario, Monica depends on the following:

-   A shared cPanel Server
-   PHP 8.1+
-   [Composer](https://getcomposer.org/)
-   [MySQL](https://www.mysql.com/)
-   SSH Access for an accont on the cPanel server

**Git:** Git should come pre-installed with your server. If it doesn't - use the installation instructions in the link.

**PHP:** Install php8.1 minimum. Generally cPanel will have a PHP 7 version installed, verify under the 'PHP Version' section from the cPanel section. Make sure these extensions are enabled:

-   bcmath
-   curl
-   dom
-   gd
-   gmp
-   iconv
-   intl
-   json
-   mbstring
-   mysqli
-   opcache
-   pdo_mysql
-   redis
-   sodium
-   xml
-   zip

In most cases, this will be under the section called 'PHP Version' in cPanel where you can enable and disable modules. 

**Composer:** After you're done installing PHP, you'll need the Composer dependency manager. Generally on most capable shared hosts, this is already installed. If it is not, please reference the below:

```sh
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --install-dir=/usr/local/bin/ --filename=composer
php -r "unlink('composer-setup.php');"
```

**MySQL:** Almost every cPanel environment includes this by default, and this will be our desired DB


## Installation steps

Once the softwares above are installed:

### 1. Download the repository

You may install Monica by simply downloading the repository. You can download it by using the download button at the main repo page for Monica. Some people may want to use Git, and when you have properly logged into the cPanel server, issue the following commands:

```sh
cd /public_html/[subdomain you wish to install monica on]
git clone https://github.com/monicahq/monica.git
```

You should check out a tagged version of Monica since `main` branch may not always be stable. Find the latest official version on the [release page](https://github.com/monicahq/monica/releases).

```sh
cd /var/www/monica
# Get latest tags from GitHub
git fetch
# Clone the desired version
git checkout tags/v2.18.0
```

### 2. Setup the database

Use the cPanel database wizard to create a new database. 
<ol>
<li>Search for 'Database Wizard' in the cPanel GUI. Click on that item. </li>
<li>Create a database name and click next. </li>
<li>Create a user name and password for the user to access the database. Click Next</li>
<li>Assign All Permissions to the user account.</li>
<li>Save the password to be referenced later</li>


### 3. Configure Monica

Open the cPanel file manager and navigate to the directory in which you want to install Monica. Then run these steps:
<commit_msg>docs: update to most recent release (#6283)<commit_after># Installing Monica (cPanel Shared Hosting) <!-- omit in toc -->

- [Prerequisites](#prerequisites)
- [Installation steps](#installation-steps)
  - [1. Download the repository](#1-download-the-repository)
  - [2. Setup the database](#2-setup-the-database)
  - [3. Configure Monica](#3-configure-monica)
  - [4. Configure cron job](#4-configure-cron-job)
  - [5. Configure cPanel webserver](#5-configure-cpanel-webserver)
  - [Final step](#final-step)

## Prerequisites

Monica can be configured in shared hosting environments with a little differences that we can remedy easily. In this scenario, Monica depends on the following:

-   A shared cPanel Server
-   PHP 8.1+
-   [Composer](https://getcomposer.org/)
-   [MySQL](https://www.mysql.com/)
-   SSH Access for an accont on the cPanel server

**Git:** Git should come pre-installed with your server. If it doesn't - use the installation instructions in the link.

**PHP:** Install php8.1 minimum. Generally cPanel will have a PHP 7 version installed, verify under the 'PHP Version' section from the cPanel section. Make sure these extensions are enabled:

-   bcmath
-   curl
-   dom
-   gd
-   gmp
-   iconv
-   intl
-   json
-   mbstring
-   mysqli
-   opcache
-   pdo_mysql
-   redis
-   sodium
-   xml
-   zip

In most cases, this will be under the section called 'PHP Version' in cPanel where you can enable and disable modules. 

**Composer:** After you're done installing PHP, you'll need the Composer dependency manager. Generally on most capable shared hosts, this is already installed. If it is not, please reference the below:

```sh
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --install-dir=/usr/local/bin/ --filename=composer
php -r "unlink('composer-setup.php');"
```

**MySQL:** Almost every cPanel environment includes this by default, and this will be our desired DB


## Installation steps

Once the softwares above are installed:

### 1. Download the repository

You may install Monica by simply downloading the repository. You can download it by using the download button at the main repo page for Monica. Some people may want to use Git, and when you have properly logged into the cPanel server, issue the following commands:

```sh
cd /public_html/[subdomain you wish to install monica on]
git clone https://github.com/monicahq/monica.git
```

You should check out a tagged version of Monica since `main` branch may not always be stable. Find the latest official version on the [release page](https://github.com/monicahq/monica/releases).

```sh
cd /var/www/monica
# Get latest tags from GitHub
git fetch
# Clone the desired version
git checkout tags/v3.7.0
```

### 2. Setup the database

Use the cPanel database wizard to create a new database. 
<ol>
<li>Search for 'Database Wizard' in the cPanel GUI. Click on that item. </li>
<li>Create a database name and click next. </li>
<li>Create a user name and password for the user to access the database. Click Next</li>
<li>Assign All Permissions to the user account.</li>
<li>Save the password to be referenced later</li>


### 3. Configure Monica

Open the cPanel file manager and navigate to the directory in which you want to install Monica. Then run these steps:

{'fraction_non_alphanumeric': 0.09907308919617079, 'fraction_numerical': 0.007141771767208631, 'mean_word_length': 3.8361498897869213, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 10, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7232869', 'n_tokens_mistral': 2007, 'n_tokens_neox': 1883, 'n_words': 846}