How to Install Monica on Fedora Server Latest

Monica is an open-source Personal Relationship Management (PRM) software that helps you keep track of your friends and family by storing contact details, conversations, notes, and reminders. In this tutorial, we will guide you through the process of installing Monica on your Fedora Server Latest.

Prerequisites

Before you start, you will need the following:

Step 1: Update the System

Log in to your Fedora instance using SSH or a terminal app, then update the packages by running the following command:

sudo dnf update

This command will update all the installed packages to their latest version.

Step 2: Install Required Dependencies

Monica requires certain dependencies to work correctly. Install them by running the following command:

sudo dnf install git wget mariadb mariadb-server nginx npm php-cli php-fpm php-json php-mbstring php-mysqlnd php-xml php-zip

This command will install the necessary packages, including the MariaDB database, Nginx web server, and other PHP extensions.

Step 3: Install Composer

Composer is a dependency manager for PHP, which is required by Monica. Install Composer by running the following commands:

sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer 

This command will download and install Composer into the /usr/local/bin/ directory.

Step 4: Create a New MariaDB Database

Monica requires a database to store all your contacts and other information. Create a new database by running the following commands:

sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation
sudo mysql -u root -p

The last command will prompt you for the root password. Enter the password, and you will be logged in to the MariaDB command-line interface.

CREATE DATABASE monica_db;
CREATE USER 'monica_user'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT ALL PRIVILEGES ON monica_db.* TO 'monica_user'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;

Replace PASSWORD with a secure password of your choice.

Step 5: Download and Setup Monica

Create a new directory for Monica and download the latest stable release from the official GitHub repository.

sudo mkdir /var/www/monica
sudo git clone https://github.com/monicahq/monica.git /var/www/monica
sudo chown -R www-data:www-data /var/www/monica/

Replace www-data:www-data with the user and group that your web server runs as.

Step 6: Install and Configure Nginx

Monica requires a web server to work correctly. Install Nginx by running the following command:

sudo systemctl start nginx
sudo systemctl enable nginx

Then, create a new server block for your domain or subdomain by running the following commands:

sudo nano /etc/nginx/conf.d/monica.conf

Add the following configuration to the file:

server {
  listen 80;
  listen [::]:80;
  server_name example.com;

  # Uncomment the following lines if you're using SSL:
  # listen 443 ssl http2;
  # listen [::]:443 ssl http2;
  # ssl_certificate /path/to/cert;
  # ssl_certificate_key /path/to/key;

  root /var/www/monica/public;
  index index.php;

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

  location ~ \.php$ {
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass unix:/run/php-fpm/www.sock;
  }

  location ~ /\.ht {
     deny all;
  }
}

Replace example.com with your domain or subdomain.

Then, save and exit the file.

Step 7: Configure Monica

Copy the sample configuration file to its default filename, and edit it.

cd /var/www/monica
sudo cp .env.example .env
sudo nano .env

Update the following variables according to your environment:

DB_DATABASE=monica_db
DB_USERNAME=monica_user
DB_PASSWORD=PASSWORD
APP_URL=http://example.com

Save and exit the file.

Step 8: Install the dependencies and final configuration

Finally, go to the Monica directory and run the following commands to install the required dependencies, run the database migration, and generate the application key:

cd /var/www/monica
sudo composer install --no-dev
sudo php artisan migrate
sudo php artisan key:generate

Step 9: Access Monica

Restart the Nginx service by running the following command:

sudo systemctl restart nginx

Now, you can access Monica by visiting your domain or subdomain in your web browser. If everything is working correctly, you should see the Monica login page.

Conclusion

Congratulations! You have successfully installed Monica on your Fedora Server Latest. You can use this powerful PRM tool to manage your relationships with friends, relatives, and business partners. If you face any issues during the installation, please refer to the official Monica documentation.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!