πDeploy a Magento App to Clouddley Triggr
Learn how to deploy a Magento app to Triggr.
In this article, weβll learn how to deploy a Magento Application on Triggr. Prior to that, let's delve into what Clouddley Triggr is. Clouddley Triggr is a zero downtime application deployment tool that auto-detects your runtime and deploys your application to your server, virtual machines, and bare metal. Letβs get started!
Prerequisites
A Clouddley account.
A Magento application.
A virtual machine in a Cloud platform or bare metal server.
Deploy the Magento application
Optimize your Codebase for deployment
Managing Magento infrastructure requires a lot of configurations and to do this on Triggr, there are certain requirements that needs to be met. Magento requires an Opensearch cluster and a database during the initial setup. For this application, we used a digital ocean MySQL database and a running OpenSearch docker container.
PHP Settings
To set the specific PHP configuration for your Magento application, you need to;
Create a
.php.ini.d
folder in the applicationβs root directoryCreate a custom
.ini
file in the.php.ini.d
folder.
For this application, we created a config.ini
file with the necessary PHP settings and extensions for the Magento Application to run.
This enables the extensions and also sets the host server's PHP configuration.
FastCGI Process Management
To execute the PHP scripts that power the Magento application and also, for proper communication between the PHP-FPM process manager and the nginx web server, create a FASTCGI_PARAMS file that contains the required FastCGI-specific parameters.
Web Server
Choose web server
To define the configuration setting (server) that can be accessed during the build process, we will be creating a Toml file project.toml
in the applicationβs root directory.
TOML is a configuration file format language that is intended to be minimal and easy to read. TOML stands for βTomβs Obvious, Minimal Language,β which refers to the creator Tom Preston-Werner.
From the Toml Website
Web server configuration
The nginx_conf_sample
file sets the server block configuration for your application. Based on how Triggr is designed, you need to make some changes to the fastcgi_pass
value in this file.
From;
To;
To configure a custom setup for nginx configuration files specific to the Magento application hosted on the server;
Create a
.nginx.conf.d
folder in the root directory
When configuring FastCGI for the nginx server, it is important to control how nginx buffers incoming data during the communication between FastCGI and PHP-FPM (FastCGI Process Manager). To do this on Triggr, create a magento-http.conf
file in the .nginx.conf.d
folder with the following contents;
This optimizes FastCGI response handling and balances memory usage with performance.
Also, in the
.nginx.conf.d
folder, create amagento-server.conf
file.
This sets; the server name for the nginx virtual host (which can be a domain name or an IP Address), the application root directory which is called workspace
on Triggr, and includes the content of the nginx.conf.sample
located in the workspace directory.
Accessing Clouddley Triggr
Open your web browser, log in to your Clouddley account
Navigate to Triggr and click on Add App.
Step 1: Configure Git
Choose the version control platform your code is hosted on, either GitHub or Bitbucket. For this tutorial, we will be using Github.
Click on the Select username/organization dropdown and click on Add username/organization to connect your GitHub user or organization account.
Select your repository and the branch.
Click on NEXT
Step 2: Configure VM
To configure your VM, insert your VM username, its hostname or IP address, and the VM port for ssh access.
Download the public key to your local machine.
Run the command provided on your local machine, allowing Triggr to connect to your virtual machine.
ssh-copy-id -f -i ~/path/to/downloaded/Publickey username@ipaddress
Click on Verify. This verifies the connection
Click on NEXT
Step 3: Configure app settings
Insert the name of the application and its port.
The firewall of the virtual machine should allow access to the application port, OpenSearch port and Database port
You can add environment variables by adding the key-value pair in the environment variable section and clicking on save or adding it by clicking on the + button.
Ensure you add the environment variable PORT on Triggr. For this application, the port value is 80.
To use a different port number when deploying the magento app, during setup the base URL should be http://IP_Address:port_number
To configure the notification settings of the application, switch the disabled button in the notification section and select which event(failed, timeout, or success) you want to be notified of.
Input your Email address.
Click on Create App
Step 4: Test and Verify the app
Upon app creation, your app appears on the Triggr dashboard.
After the app deployment is complete, the app status changes from
deploying
torunning
Click on the application's URL, which opens the deployed application in your browser.
You can test the application functionalities.
You have successfully deployed your Magento application on Triggr.
You can navigate to deployments, click on the icon in the actions column to view logs, download your logs, and restart the build if needed.
Conclusion
Last updated