Skip to content
Follow
CMS Ubuntu Linux

How to Install Monica CRM on Ubuntu with Nginx

Richard
Written by
Richard
Oct 17, 2022 Updated Aug 13, 2026 2 min read
How to Enable or Disable Microsoft Defender Cloud Protection
How to Enable or Disable Microsoft Defender Cloud Protection

Monica CRM is a free web program that runs on your own server to help you keep track of friends, family, and important dates. Ubuntu 24.04 and newer versions make a great home for this setup when paired with the Nginx web server.

You can run this personal contact manager privately on your own hardware instead of paying for a cloud service. This setup puts you in total control of your data without needing any advanced tech skills.

⚡ Quick Answer

Install Nginx, MariaDB, and PHP-FPM using apt commands. Then, download Composer and Node.js. Create a database for Monica, download Monica from GitHub to /var/www/monica, and configure the .env file. Finally, install dependencies with composer and yarn, and run artisan commands.

Install Nginx

Nginx acts as the web server that delivers Monica CRM to your browser.

Grab the detailed setup steps from the guide on how to install Nginx on Ubuntu Linux before moving forward.

Install MariaDB

Monica CRM stores your data in a database, and MariaDB is the recommended database choice for the CRM. Install MariaDB on Ubuntu using the sudo apt install mariadb-server command.

🐧Bash / Shell
sudo apt update
sudo apt install mariadb-server

Find additional database help here How to install MariaDB on Ubuntu Linux.

Install PHP-FPM

PHP-FPM processes the dynamic code that Monica CRM relies on. Follow the guide on how to install PHP or PHP-FPM on Ubuntu Linux to get the right packages installed.

Install Composer

Next, install Composer, a vital tool for managing Monica CRM's software packages. This step ensures all necessary components are ready for your Monica CRM installation.

Composer manages the underlying software packages that Monica CRM requires to function properly.

Your Monica CRM installation on Ubuntu needs a dedicated database and user. A new database and a specific user will be created for Monica CRM's data storage. This pairing ensures Monica CRM has a secure, separate location for all its important information.

🐧Bash / Shell
sudo mysql -u root -p
⚠️Warning
Run these commands to set up the database and user:
💻Code
CREATE DATABASE monicadb;
CREATE USER 'monicadbuser'@'localhost';
ALTER USER 'monicadbuser'@'localhost' IDENTIFIED BY 'your_strong_password';
GRANT ALL ON monicadb.* TO 'monicadbuser'@'localhost';
FLUSH PRIVILEGES;
exit

Install Monica

Finally, install Monica CRM on your Ubuntu server by downloading the latest version and configuring it. This step brings Monica CRM to your system, ready for setup.

🐧Bash / Shell
sudo -u www-data composer install --no-interaction --no-dev
sudo -u www-data yarn install
sudo -u www-data yarn run production

🐧Bash / Shell
sudo -u www-data php artisan key:generate
sudo -u www-data php artisan setup:production -v

Configure Nginx

Create a server block file in /etc/nginx/sites-available/monicacrm. Ensure the fastcgi_pass directive points to the correct PHP socket version:

🐘PHP
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;

Enable the site, test the configuration, and restart Nginx to apply the changes.

Access Monica Portal

Navigate to your domain in your web browser. You can now register your account and begin using your CRM. For security, consider setting up SSL using Let's Encrypt How to install and use Let's Encrypt SSL with Nginx on Ubuntu Linux.

[signed-by=/usr/share/keyrings/yarnkey.gpg]

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Install PHP on Ubuntu Linux
Ubuntu Linux How to Install PHP on Ubuntu Linux
How to Install Nginx on Ubuntu Linux
Ubuntu Linux How to Install Nginx on Ubuntu Linux
Install MySQL and MariaDB on Ubuntu: A Step-by-Step Guide
Ubuntu Linux Install MySQL and MariaDB on Ubuntu: A Step-by-Step Guide
How to Install PHP Composer on Ubuntu Linux
Ubuntu Linux How to Install PHP Composer on Ubuntu Linux

No comments yet — be the first to share your thoughts!

Leave a Comment

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