Install on LEMP
How To Install MailCarry on Linux, Nginx, MariaDB, PHP (LEMP stack) on Debian 10
Step 1: Install Nginx Web Server
sudo apt update
sudo apt install nginx
Step 2: Install PHP 7.3 and Related Modules
To install PHP and related modules run the commands below
sudo apt install php-fpm php-mysql
sudo apt install php7.3-cli php7.3-common php7.3-curl php7.3-gd php7.3-json php7.3-mbstring php7.3-mysql php7.3-xml php7.3-imap php7.3-zip
Step 3: Install MariaDB
sudo apt install mariadb-server
sudo mysql_secure_installation
sudo mariadb
Create MySQL user
CREATE USER 'mailcarry'@'localhost' IDENTIFIED BY 'M@ilC@rry123';
where “mailcarry” is the username and “M@ilc@arry123” is the password
GRANT ALL ON mailcarry.* TO 'mailcarry'@'localhost';
FLUSH PRIVILEGES;
exit;
Step 4: Upload MailCarry files on the server
Upload all the extracted files from MailCarry.[VERSION-NUMBER].zip to the location, eg:
/var/www/html
Step 5: Set Permissions
Set the permission for the following file and folders
- chmod 777 -R /var/www/html/.env
- chmod 777 -R /var/www/html/storage/
- chmod 777 -R /var/www/html/bootstrap/cache/
Step 6: Nginx Configuration
sudo nano /etc/nginx/sites-available/default
server {
listen 80 default_server;
listen [::]:80 default_server;root /var/www/html;
index index.php index.html index.htm;
server_name _;
autoindex off;
location / {
try_files $uri $uri/ /index.php?$query_string;
}location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}location ~ ^.env {
deny all;
}
}
Then, restart Nginx for the changes to take effect:
sudo systemctl reload nginx
Step 7: Now Access the Install URL
[YOUR-INSTALLED-URL]/install/
eg: If https://mailcarry.com is the domian then https://mailcarry.com/install/
- Fill the data as per your requirement
- Click Install
Install cron
sudo apt install cron
Set the required cron
* * * * * /usr/bin/php /var/www/html/artisan schedule:run >/dev/null 2>&1
Cron command may vary according to the php path and files path.
After succcessfull installation MailCarry will show you the required command.