Monica is a popular open-source personal relationship management tool that allows you to keep track of your relationships with friends, family, and loved ones. In this tutorial, we will show you how to install Monica on Rocky Linux.
Before we begin, make sure you have a fresh installation of Rocky Linux and that you have a user account with sudo privileges.
First, update the package index on your Rocky Linux system by running the following command:
sudo dnf update
Next, install the Apache web server, MariaDB database server, and PHP with the following command:
sudo dnf install httpd mariadb-server php php-common php-pdo php-gd php-mysqlnd
After installing the required packages, start the Apache and MariaDB services and enable them to start on boot by running the following command:
sudo systemctl start httpd mariadb && sudo systemctl enable httpd mariadb
With the Apache and MariaDB services started, secure your MariaDB installation by running the following command:
sudo mysql_secure_installation
This will launch the MariaDB security script. Follow the prompts to set a password for the MariaDB root user, disable remote root login, and remove anonymous users.
Next, log in to the MariaDB shell as the root user with the password you set in the previous step:
mysql -u root -p
Once you are logged in to the MariaDB shell, create a new database and user for Monica by running the following commands:
CREATE DATABASE monica;
GRANT ALL PRIVILEGES ON monica.* TO 'monica'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT;
Replace password
in the above commands with a strong password for the monica
user.
With the MariaDB database and user created, download the Monica installation package with the following command:
wget <https://github.com/monicahq/monica/archive/v2.19.0.tar.gz>
After downloading the installation package, extract the contents of the tarball to the /var/www/html
directory with the following command:
sudo tar xvf v2.19.0.tar.gz -C /var/www/html
This will extract the Monica files to a directory named monica-2.19.0
inside the /var/www/html
directory. Rename this directory to monica
by running the following command:
sudo mv /var/www/html/monica-2.19.0 /var/www/html/monica
With the Monica files extracted and renamed, change the ownership of the monica
directory to the apache
user by running the following command:
sudo chown -R apache:apache /var/www/html/monica
Next, open the Apache configuration file with your favorite text editor and add the following line to the end of the file:
IncludeOptional /var/www/html/monica/public/.htaccess
This will enable the Apache web server to read the .htaccess
file for Monica. Save and close the file.
Now, restart the Apache web server to apply the changes:
sudo systemctl restart httpd
You have now successfully installed Monica on Rocky Linux. You can now access the Monica installation wizard by opening a web browser and navigating to http://your-server-ip/monica. Follow the on-screen instructions to complete the installation. After the installation is complete, you can log in to the Monica dashboard with the username and password you set during the installation process.