The Craft 6 beta is out. Learn what's new and how Craft 6 works on Laravel. Explore Craft 6

How to Run Craft CMS on Laravel Cloud

Can you run Craft CMS on Laravel Cloud? Yes, but you probably shouldn't.

You can deploy a Craft CMS 5 site to Lar­avel Cloud, but it takes a few workarounds and isn’t some­thing to run in pro­duc­tion yet. Ryan Ire­lan and Andrew Welch deploy the TrailQuest project from the Real World Craft CMS course, cov­er­ing every change need­ed to get it run­ning: requir­ing the Lar­avel frame­work, renam­ing the web root, fix­ing deploy com­mands, set­ting data­base vari­ables, and adding a cus­tom domain to fix con­trol pan­el logins. Per­sis­tent asset stor­age was the one piece still unsolved at the end. For Craft devel­op­ers curi­ous about Lar­avel Cloud and how it com­pares with Craft Cloud and Servd.

Top­ics cov­ered #

  • Set­ting up a Lar­avel Cloud appli­ca­tion: region, Git branch, envi­ron­ments, app serv­er, cache, buck­et, and a Post­gres data­base (MySQL was only a devel­op­er pre­view at the time)
  • Pass­ing Lar­avel Cloud’s frame­work check by requir­ing laravel/framework in composer.lock, and why Lar­avel 10 was need­ed to avoid a con­flict with Craft’s illuminate/collections
  • Renam­ing web to public (or sym­link­ing it) to match Lar­avel Cloud’s expect­ed pub­lic directory
  • Replac­ing the default php artisan deploy com­mand, with craft up as the Craft equivalent
  • Debug­ging a gener­ic 500 error caused by miss­ing data­base envi­ron­ment variables
  • A con­trol pan­el login that posts to an inse­cure HTTP URL on the tem­po­rary domain, fixed by adding a cus­tom domain
  • Lar­avel Cloud buck­ets using Cloud­flare R2, why the AWS S3 plu­g­in didn’t work, and a live attempt with a Cloud­flare R2 plugin
  • How Servd, Craft Cloud, and Lar­avel Cloud dif­fer archi­tec­tural­ly (Dock­er, server­less, and EC2 with server­less Postgres)

Chap­ters #

  • 0:00 Why try Craft on Lar­avel Cloud
  • 3:10 Cre­at­ing the appli­ca­tion and environment
  • 5:21 Data­base, cache, and buck­et resources
  • 7:59 Requir­ing the Lar­avel framework
  • 11:48 Renam­ing the web direc­to­ry to public
  • 12:54 Fix­ing the deploy commands
  • 15:13 Inter­nal serv­er error and envi­ron­ment variables
  • 17:50 Login fails over HTTP, fixed with a cus­tom domain
  • 21:24 Per­sis­tent stor­age, buck­ets, and Cloud­flare R2
  • 28:48 Servd vs. Craft Cloud vs. Lar­avel Cloud architecture
  • 32:39 Try­ing a Cloud­flare R2 plu­g­in live
  • 40:56 Wrap-up and where Lar­avel Cloud sup­port may go

Transcript

Premium

Follow along with the full transcript

Search every word, click any line to jump to that moment, and read along as you watch. A CraftQuest Premium feature.

Sign up for Premium