Clouddley Documentation
  • 👋Welcome to Clouddley Documentation.
  • ⚡CLOUDDLEY TRIGGR
    • Triggr Apps
      • 🛠️How-to Guides
        • 📗Deploy a Ruby on Rails App on Clouddley Triggr
        • 📔Deploy a Flask Application on Clouddley Triggr
        • 📙Deploy a .NET Core Application on Clouddley Triggr
        • 📔Deploy a FastAPI App on Clouddley Triggr
        • 📕Deploy a NestJs App on Clouddley Triggr
        • 📙Deploy a Go Application on Clouddley Triggr
        • 📗Deploy a Laravel App on Clouddley Triggr
        • 📓Deploy a Next.js App on Clouddley Triggr
        • 📘Deploy an Express.js Application on Clouddley Triggr
      • 🛠️Extras
        • 🔔Notifications
        • ⚙️Environment Variables
        • 🌐Custom Domain
        • How to Rollback an Application
        • ⏯️How to Pause and Resume Applications
        • Scale applications on Clouddley Triggr
        • 📕Deploy an Application with a Dockerfile on Clouddley Triggr
  • Triggr Databases
    • 🛠️How-to Guides
      • Deploy a MongoDB Database on Clouddley Triggr
      • Deploy a MariaDB Database on Clouddley Triggr
      • Deploy a PostgreSQL Database on Clouddley Triggr
      • Deploy a Redis Database on Clouddley Triggr
      • Deploy a MySQL Database on Clouddley Triggr
    • 🛠️Extras
      • Database Networking on Clouddley Triggr
      • 🔁How to Reset Database Password on Clouddley Triggr
Powered by GitBook
On this page
  • Prerequisites
  • Deploy the Laravel Application
  • Conclusion

Was this helpful?

  1. CLOUDDLEY TRIGGR
  2. Triggr Apps
  3. How-to Guides

Deploy a Laravel App on Clouddley Triggr

Learn how to deploy a Laravel app on Triggr.

PreviousDeploy a Go Application on Clouddley TriggrNextDeploy a Next.js App on Clouddley Triggr

Last updated 1 month ago

Was this helpful?

In this guide, we'll learn how to deploy a application on Triggr. Before that, let’s talk about 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 or Account.

  • A account.

  • A application.

  • A Virtual machine on a Cloud platform or bare metal server.

Deploy the Laravel Application

Optimize your Codebase for Deployment

Before the Laravel application deployment, with the way Triggr is designed, you would need to set up specific requirements, which include specifying the required PHP extensions and web server for your application.

  • PHP Extensions

In Laravel, PHP extensions add extra functionalities and improve performance. Laravel handles most extensions automatically to ensure the required ones are installed on your host server for optimal application performance. To set this up on Triggr, you need to;

  • Create a .php.ini.d folder in the application’s root directory.

  • Create a custom .ini file in the .php.ini.d folder.

For this application, we created a file custom.ini with the necessary extensions needed for the application to run smoothly.

custom.ini
extension=fileinfo.so
extension=curl.so
extension=openssl.so
  • Web server

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.

project.toml
[[build.env]]
name='BP_PHP_SERVER'
value='nginx'
[[build.env]]
name='BP_PHP_WEB_DIR'
value='public'

This defines the configuration settings that can be assessed during the build process. Once you are done, you are ready to deploy your application on Triggr.

Accessing Clouddley Triggr Apps

  • Open your web browser, log in to your Clouddley account

Step 1: Configure Service

  • Choose your Git hosting service; either GitHub or Bitbucket. For this tutorial, we will be using GitHub.

  • Click on Continue with GitHub

Step 2: Configure Git

  • To connect your GitHub user or organization account, click the Select username/organization dropdown and Add GitHub account.

  • Select your repository and the branch from the dropdown list or quickly search.

  • Click on NEXT

Step 3: Configure your Virtual Machine

  • To configure your VM, insert your VM hostname or IP address, VM user, and the VM port for SSH access.

  • Use the Clouddley CLI (recommended) or connect via SSH to verify.

The Clouddley CLI is a command-line tool that allows you to interact with the Clouddley Platform from your terminal.

  • Open the command line of the remote VM you want to configure to Clouddley and install Clouddley CLI by running the command:

curl -L https://raw.githubusercontent.com/clouddley/cli/main/install.sh | sh
  • To install Triggr, run the command:

clouddley triggr install

Using the CLI, you can deploy resources, manage configurations, and automate tasks efficiently.

  • Download the public key to your local machine.

  • Run the provided command in your local machine allowing Triggr to connect to your virtual machine.

ssh-copy-id -f -i ~/path/to/downloaded/Publickey username@ipaddress

Replace ~/path/to/downloaded/Publickey ,username and ipaddress with your actual values.

  • Click on Verify. This verifies the connection

  • Click on NEXT

Step 4: 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.

Step 5: Configure Environment Variables

  • Add the key-value pairs and Click on Save

  • Click on NEXT

Triggr deploys your application as a container; therefore, ensure you specify the environment variables.

Step 6: Setup Notifications (optional)

  • Select the Alert type. For this tutorial, we will set up Email alerts.

  • Toggle on the buttons of the deployment event (failed, timed out, or success) you want to be notified of.

  • Enter the Email address where you want to receive alerts. (You can add multiple email addresses)

  • Click on Save

  • Click on Deploy

Step 7: Test and Verify the app

  • Click on Go to Dashboard. Your app will be visible on the Triggr apps dashboard.

  • After the app deployment is complete, the app status changes from deploying to running

  • You can test the application functionalities.

You have successfully deployed a Laravel application on Triggr. You can manage it directly from the app dashboard by clicking the three dots (...) at the top-right corner to access Edit, Instant Rollback, Scale, Pause, and Delete options.

Furthermore, you can switch to different tabs on the application dashboard to perform the following actions; view your deployment history, view or download logs, add a custom domain, and view the environment variables.

Conclusion

This enables the required extensions for this application. You can read more about enabling extensions .

We will be deploying this application with Nginx, a popular choice for deploying Laravel applications due to its speed, security features, ease of configuration, and compatibility with PHP-FPM. To configure this, we will be creating a file project.toml in the application root directory.

From the

Navigate to and click on Deploy App

To add environment variables, click on Add Variable

Choose an ENV mode: either a single variable or import variables. Learn more .

To configure the notification settings of the application, click on Add Alert

Click on Website at the top right corner of the page, this opens the URL of the deployed application in your browser.

Congratulations on successfully deploying a Laravel application on Clouddley Triggr. You can find the source code for this application You can also check out how different frameworks can be deployed on Clouddley Triggr in our .

➕
➕
🌐
Laravel
GitHub
Bitbucket
Clouddley
Laravel
here
Toml
Toml Website
Triggr Apps
here
🎉
here.
how-to guides
⚡
🛠️
📗
Accessing Triggr Apps
Choose your Git hosting service
Setup the Laravel application repository on Triggr
Configuration of virtual machine on Triggr
Configure the App name and port
Single variable ENV mode
Import variables ENV mode
Adding environment variables
Notifications set up and creation of Laravel application on Triggr
Laravel application dashboard overview
Laravel application running from Triggr on a cloud virtual machine
Image of Triggr Apps dashboard.
Configuring Git hosting service during app deployment on Triggr Apps.
Configuring the Git repository during app deployment on Triggr Apps.
Configuring the virtual machine during app deployment on Triggr Apps.
Configuring App settings (name and port) during app deployment on Triggr Apps.
Image showing the single variable ENV mode on Triggr Apps
Image showing the Import Variables ENV mode on Triggr Apps.
Image showing environment variables added during app deployment on Triggr Apps.
A gif showing how to set up notifications on Triggr Apps.
An image of the overview of a successfully deployed Laravel application on Triggr Apps.
An image of the Laravel application running on Triggr on the web.
Page cover image