How to Install and Uninstall Astra Website Protection for sites using Git (Version Control)

How to Install and Uninstall Astra Website Protection for sites using Git (Version Control)

Pradheep BS
Written by Pradheep BSLast update 4 months ago

You can install Astra Website Protection on websites using version control software such as Git. We recommend installing the plugin in your local development environment first, before deploying it to production. If you have any questions around the installation, please create a support request from your Astra Dashboard.

How to Install

Step 1 - Preparing Production Environment

  1. Before we being the installation, please ensure that your productions server meets the General System Requirements.

  2. If you are using a load balancer, and multiple nodes - please follow the instructions for load balanced environments.

Step 2 - Configure Storage Engine


By default the plugin uses the Filesystem storage engine, which creates the getastra-premium/astraStorage folder in runtime. This folder stores the plugin configuration and should not be erased across deployments.

Option 1 - Use MySQL storage engine (recommended)

You can configure the Astra Website Protection plugin to use the MySQL storage engine, and set the environment variables for all the servers

Option 2 - Update CI/CD script

Depending on how your CI/CD deployment script is written, you can update it so that the astraStorage folder is not erased across deployments

Option 3 - Custom Storage Path

We can alternatively configure a custom storage path which will be used to store the plugin configuration .is

  1. Create a folder called astraStorage which is outside the main application folder so that it is not erased across deployments

  2. Now we need to set the ASTRA_STORAGE_ROOT server environment variable with the absolute path of this folder. You can see the steps to add the server environment variable.

    Example code (the path will change as per your server):

ASTRA_STORAGE_ROOT=/var/www/astraStorage



Please verify that the server environment variable has been set via the phpinfo() contents. Otherwise the astraStorage folder will get created, and may lead to un-staged changes on the server. Depending on your CI/CD configuration it may cause errors.

Step 3 - Adding Plugin files to Version Control

  1. From our Getting Started guides, find installation steps for your CMS or Framework

  2. Create a new Git branch for the plugin installation & checkout in your terminal application (you can use any branch name)


    git checkout -b install-getastra

  3. Once you have switched to the new branch, install the plugin in your local development environment by following the steps in the instructions

  4. Once you have switched to the new branch, install the plugin in your local development environment by following the steps in the instructions

  5. We do not need the .zip file, so you can delete it

    rm getastra-v*.zip

  6. Now stage the files in the getastra-premium folder to your repository.

git add getastra-premium/


7. Once you have verified the changes, commit the changes with the following command

git commit -m "Adds Astra Security plugin"


8. Push your changes to origin & deploy the code to production

git push origin install-getastra


Now enter the Activation Code in the plugin activation page as shown in the installation guides

How to Uninstall

  1. From our Getting Started guides, find uninstallation steps for your CMS or Framework

  2. Create a new branch in your repository, delete the getastra-premium folder, commit the changes, merge your code and deploy it

  3. Delete the astraStorage which you may have created created during installation

    If you have any questions about the installation, or have a different server setup - please feel free to create a support request from the widget on the bottom right - we'd be happy to help.

Did this answer your question?