facebook youtube pinterest twitter reddit whatsapp instagram

(Bash Script) Automate Multiple Classicpress & Wordpress Installation + [Caching and SSL]

If you are tired of using control panels (I am because they are mostly not secure, and most comes loaded with bundles of useless stacks), and want to do everything on the server level, I wrote a menu-driven bash program that handles the installation of ClassicPress or WordPress using Nginx (+ Caching), PHP and mariadb.

It also provides the ability to secure your website using Let's Encrypt, and Certbot for the auto-config. I made this optional because I might just want to do some local development, so, I won't need an SSL in that regard.

As of the time of writing this, it took only 1min.34s (proof in the video below) to configure a website on a fresh server instance, it shouldn't take more than 30s to add other sites.

I might add new features like support for SFTP, this way you can use whatever SFTP client as a (file manager), I might also add PHPMyAdmin, and the ability to manage Name Servers (This is on my to-do list), and other enhancement, for now, this is okay for my use cases.

I have implemented all the feature I mentioned above, you can now:

  • Install and Configure Multiple Classicpress or WordPress Sites
  • Restore an Existing Classicpress or Wordpress Website
  • Secure Sites Using Free Let's Encrypt Certificate
  • You Can Create More Than one SFTP Users (This Way, You Can Access Through SFTP Client, e,g Filezilla, Winscp, etc)
  • Manage Your Own Custom DNS (You can also Add New DNS Zone, Edit Zone, and Even Delete DNS Zone)
  • Install PHPMyAdmin (You can also secure it with Let's Encrypt)
  • More Features in The Works

►Key Requirements

  • Operating system: Ubuntu LTS
  • Memory: At least 512MB GB RAM
  • The installation must be performed on a clean system, free of installed/configured software, especially anything related to web servers.
  • The installation must be done as a root user, it won't even allow you to pass through even if you want to.
  • If you want to use the Let's Encrypt Feature, make sure you have an A record for the website

How To Install The Program

The installation is easy:

Connect to your server as root via SSH

ssh root@yourserver

Download The Program, and Change Your Diretory To The Program Directory

git clone https://github.com/devsrealm/commandline_controlpanel.git && cd commandline_controlpanel

Give It an Executable Permission

chmod +x cp

Run The Program, and Configure Away

./cp yourwebsite.com

Note: Make Sure You Always Add a Top Level Domain, i.e .com, .net, etc

Whenever you want to install a new website, make sure you have switched to the commandline_controlpanel directory, and add a run the program again, e.g

cd commandline_controlpanel


./cp anotherwebsite.com

Video WalkThrough


Related Post(s)

  • sed (Stream Editor) In Bash Scripting

    Another powerful filter in GNU/Linux is sed (stream editor), which is a program for performing basic editing tasks on the output of another program or on a file. sed or stream editor can be used to p

  • awk In Bash Scripting

    Up until now, we have covered a couple of text processing, from sed to grep to sort, and now we have the big daddy, which is awk. awk (which stands for Aho, Weinberger, and Kernighan - its creators)

  • Returning Values From Functions in (Bash)

    In the guide function in bash, we dive deep in bash functions and we also pass some information into the functions to carry out a certain operation. In this guide, I'll show you how to get informatio

  • Functions in Bash

    Functions are modular building blocks for creating powerful and modular scripts, using function makes it easy to isolate a code since it would be in a single building block, which would be isolated f

  • Understanding The Four (4) Ways Command-Line Runs Shell Script

    Sometimes we need to think like the command line shell in order to understand how things are done in the background, this would make debugging a breeze. In this guide, you would learn all the variou

  • grep (Regular Expression) In Bash Scripting

    We recently discussed filters in bash scripting, in this guide we would look more into the practical usage of using a filter program, and an example of such a program is grep. grep, in its simplest f