How to Install and Set Up Monica

Prerequisites

  1. You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get a free account in your Alibaba Cloud account. If you don’t know about how to setup your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 1.5GB RAM and 1 Core processor.
  2. A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.
  3. Domain name must be pointed to your Alibaba Cloud ECS’s IP address
  4. Access to VNC console in your Alibaba Cloud or SSH client installed in your PC
  5. Set up your server’s hostname and create user with root privileges.

Update Your Ubuntu System

# sudo apt update && sudo apt upgrade

Install build-essential

# sudo apt-get install build-essential

Install Git

# sudo apt-get install git
# git config --global user.name "Aareez"
# git config --global user.email "xyz@example.com"

Install libpng-dev

# sudo apt-get install libpng-dev

Install PHP

# sudo apt-get install software-properties-common python-software-properties
# sudo add-apt-repository ppa:ondrej/php
# sudo apt update
# sudo apt install -y php7.2

Install Required PHP Extensions

  1. php7.2-cli
  2. php7.2-fpm
  3. php7.2-mbstring
  4. php7.2-common
  5. php7.2-xml
  6. php7.2-mysql
  7. php7.2-curl
  8. php7.2-zip
  9. php7.2-intl
# sudo apt install -y php7.2-cli php7.2-fpm php7.2-common php7.2-mbstring php7.2-xml php7.2-mysql php7.2-curl php7.2-zip php7.2-intl
# php --version

Install MySQL

# sudo apt install -y mysql-server
# sudo mysql_secure_installation
# sudo mysql -u root -pCREATE DATABASE monicadb;
CREATE USER 'monica'@'localhost' IDENTIFIED BY '654321Ab';
GRANT ALL PRIVILEGES ON monicadb.* TO monica@localhost;
FLUSH PRIVILEGES;
EXIT;

Install Nginx Server

# sudo systemctl stop apache2
# sudo apt-get install nginx
# sudo systemctl start nginx
# sudo nginx -v
# sudo nano /etc/nginx/sites-available/monica.conf
server {
listen 80;
listen [::]:80;
server_name softpedia.xyz;
root /var/www/monica/public;
index index.php; location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
}
# sudo ln -s /etc/nginx/sites-available/monica.conf /etc/nginx/sites-enabled/
# sudo nginx -t
# sudo systemctl reload nginx
# curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
# sudo apt-get install nodejs
# node -v && npm -v

Install Composer

# php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
# php composer-setup.php
# php -r "unlink('composer-setup.php');"
# sudo mv composer.phar /usr/local/bin/composer
# composer --version

Install and Configure Monica

# cd /var/www
# sudo git clone https://github.com/monicahq/monica.git
# cd monica
# sudo git checkout tags/v2.1.1
# sudo chown -R aareez:aareez /var/www/monica
# cp .env.example .env
# sudo nano .env
# composer install --no-interaction --no-suggest --no-dev --ignore-platform-reqs
# npm run production
# php artisan key:generate
# php artisan setup:production
# sudo chown -R www-data:www-data /var/www/monica

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Two Sum | Leetcode | Easy | # 1

Your GraphQL starter kit

A Unified Solution for Observability — Make SLS Compatible with OpenTelemetry

How to Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu 16.04

CORS in Easy Words -- How to deal with CORS?

The Many Senses of Software Engineering

Research and Practice of Alibaba Code Fault Detection

Cloud Native Revolution

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

LockAjar — A dive into embedded linux IoT Part 1.5

Connecting Mumps to Apache through CGI

From Passwords to Cloud SSO

Configure Emails in Wazuh Docker (Docker compose + Outlook SMTP)