Let’s Encrypt is the leading free SSL certificates issuing authority backed by Google, Mozilla and other Internet giants. ServerPilot.io is an online and remote control panel to run mainly PHP-based websites on an Ubuntu server. Although now ServerPilot has fully gone paid, but a lot of users still use their free grandfathered plan at ServerPilot that lacks the automated SSL feature for web apps.

Several months ago, I wrote a Python package to automate SSL install installation on ServerPilot free plan. In addition to the free plan, the package supports paid plan as well. So if you are using the grandfathered plan of ServerPilot or if you are a CLI lover, this package is for you.

Installation

Sign in as root using your terminal and install the package via PIP or from GitHub repo:

pip install rwssl

If PIP is not installed on your system, you can either install it first by running apt-get install python-pip or install rwssl from GitHub repo:

git clone https://github.com/rehmatworks/serverpilot-letsencrypt.git
python setup.py install

Once successfully installed, the package will register a command rwssl in your terminal. To list all available sub-commands, type rwssl --help in your terminal and hit enter. Here are the most-common commands that you will have to use on a frequent basis:

Install SSL on All Available Apps

rwssl --all

Above command will look for all non-SSL apps and will attempt to install SSL on each of the app. You can pass --ignore flag with comma-separated app names to ignore some apps during SSL installation. For example:

rwssl --all --ignore app1,app2,app3

Above action will attempt to install SSL on all apps except app1, app2 and app3.

Install SSL on a Single App

rwssl --name appname

Clean and Re-install SSL on All Apps

Be careful with this command as this command will delete all SSL vhosts from your server and will attempt to reinstall SSL on apps. You may need this command only if previous SSLs are all expired or if SSL vhosts are messed up.

rwssl --refresh

Force SSL or Remove SSL Redirect

To force SSL on a single app:

rwssl --redirect appname

And to force SSL on all apps:

rwssl --redirect all

To remove the SSL force redirect on a single app:

rwssl --noredirect appname

And to remove the SSL force redirect from all apps:

rwssl --noredirect all

These were the most-common commands. There are some more commands available as well. To list all commands, type and enter rwssl --help in your terminal or visit the GitHub repository URL. If you have any questions regarding rwssl package or Let’s Encrypt, you can leave a comment below.