👋 Hello! I'm Dmitry
Full Stack Web-Developer
and Product Manager

Setting up 👨‍ Production Server on CentOs 8

Sunday, December 22, 2019
Setting up 👨‍ Production Server on CentOs 8

Lately I've experienced a very frustraiting problem with my VPS provider which I've been using for almost 7 years. They've shut down all the power and thousands of their clients got left with no way of accessing pre-payed servers. I was forced to restore backups and look for a new hosting company. Unfortunatelly I didn't have backup of system apps and configs. 🐏

I've had CentOs 7 running there. Always liked it for it's stability and figured out it would be a good opportunity to jump on a new major version of CentOs 8 and create a bash script with initial setup of production server.

Implemented Features

— Disable root access from Internet
— Create Superuser account with root access
— Change SSHd default port number
— www-data user for nginx

Apps Installed

— Nginx (latest)
— Php-fpm 7.3
— MariaDB
— Midnight Commander
— Htop
— Composer
— Nano (keybord friendly mode)
— Zsh (with default config for new users)
— Git
— NodeJS
— Yarn
— PM2
— Java 8 + ElasticSearch 6.7.2 (optional)

Creating keypair for Superuser on local PC

rem -------------------------------------------------------
rem Create keypair for Production_VPS
rem -------------------------------------------------------
mkdir %userprofile%\.ssh\keys\production_vps
ssh-keygen -N "" -f %userprofile%\.ssh\keys\production_vps\id_rsa
code %userprofile%\.ssh\keys\production_vps\id_rsa.pub

When keypair is created keep public key close. You'll need to paste it to VPS when prompted to enable Superuser login using ssh keypair.

SSH to your VPS

Run Kitty and connect to your VPS as root. You should have a fresh minimal CentOs 8 preinstalled. Just run bellow command and answer some questions 🧠

sh -c "$(curl -L bit.ly/centos8init)"

Installation source