Setup Centos for Laravel production server

  • by

ssh root@remote_server_ip
dnf clean all
dnf update
dnf install vim wget
sudo dnf install httpd
sudo dnf install @mysql
sudo systemctl start mysqld.service
sudo systemctl status mysqld
sudo systemctl enable mysqld
mysqladmin -u root -p password
sudo mysql_secure_installation

ensure site is setup on symlinked:
sudo ln -s /etc/httpd/sites-available/ /etc/httpd/sites-enabled/
sudo systemctl restart httpd

– ensure firewalld is disabled
sudo yum install epel-release
sudo yum -y install ufw
sudo ufw status
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw allow https
sudo ufw status numbered
sudo ufw enable

sudo dnf install php php-curl php-bcmath php-dom php-xml php-mbstring php-json
sudo dnf install epel-release -y
sudo dnf install -y
sudo dnf module list php
sudo dnf module enable php:remi-7.4
sudo dnf module reset php:remi-7.2
sudo dnf module enable php:remi-7.4
sudo dnf install php php-cli php-common
php -v
sudo systemctl start php-fpm
sudo systemctl enable php-fpm

ensure tar is installed on Centos OS:
sudo yum install tar

check on firewalled or ufw is setup correclty in case of difficulty to connect
– make sure firewalld is disabled so doesnt boot up on restart
– ensure ufw boots up on restart

cd /var/www/’application’
cp .env.example .env
php artisan key:generate

check files have the right permissions:

Using Deployer for deployment – issue with needing to install addtional php library:

install globally:
composer global require deployer/deployer

in appp directory:
dep init -t Laravel

additional package for error:
dnf install php-process

Issues with npm – requires v12, not v10 but doesnt say anything…:

Main ref:

mysql on centos 8:

no sudo groups:

updates sudo user password:

update user to be part of sudo:

setup firewal UFW:

check ports in use.

disable firewalld:

ports to use:

ssh setup:

Install Lamp:
not using the firewall updates in this
keeping with mysql
issues with root password for mysql

setup laravel:


ssl – esnure the domian is already set to the ip of server:

Deployer deployment:

Issues with PDO driver whilst using Laravel Jetstream:

php 7.4

Leave a Reply