 [ ← blog / 24for2019 ](/) Dec 03, 2019  ·  \#24for2019  ·  2 min read 

# Local development with GatsbyJS and Drupal



As I have begun working with GatsbyJS once again, I am trying to find a way to work with GatsbyJS and Drupal locally in a somewhat streamlined fashion. Honestly, serving Drupal over PHP's built-in server and using the ***gatsby develop*** and ***gatsby serve*** command work just fine. But, I love tooling. And I want to test out using GatsbyJS custom environment setups to build variants of the GatsbyJS site. These variants would then map to Drupal Commerce stores, allowing a demonstration of the multisite and multilingual capabilities of Drupal Commerce.

I use DDEV on a daily basis, so that was my first stop. Kevin Bridges of DRUD Technology, who makes DDEV, gave a session at BADCamp. [The Decoupled Drupal on DDEV with GatsbyJS](https://2019.badcamp.org/session/decoupled-drupal-ddev-gatsbyjs) session was less about serving both GatsbyJS and Drupal from DDEV through fancy Docker networks, and more about just using DDEV to serve Drupal locally. I really like DDEV's multiple domain support. I plan on trying to hack something together.

Next, I went to review J.D. Flynn's [Docksal Decoupled](https://github.com/JDDoesDev/docksal-decoupled) setup. [Docksal](https://docksal.io/) is a local Docker tool. I have not personally used it, but I am considering giving it a go-to test out J.D.'s setup. It is a monorepo setup that is based on ContentaCMS and GatsbyJS. The power is behind Docksal commands and some custom Apache vhost setup. I feel it is getting closer to what I am looking for!

Finally, I was pointed to Benji Fisher's [Lando Gatsby Drupal](https://gitlab.com/benjifisher/lando-gatsby-drupal) setup. Lando runs all of the commands within its CLI containers. It resembles my goals a bit more. When you bring up the environment it will run the build on GatsbyJS and serve those files.

The problem that *might* bite me: trying to run multiple builds of off the same GatsbyJS app. I'll need to add [additional environment types](https://www.gatsbyjs.org/docs/environment-variables/#additional-environments-staging-test-etc), which map to production or development as well, so that appropriate ***.env*** files are loaded.

 

  ![](/themes/custom/mglaman/images/headshot.webp)Thanks for reading

I write about Drupal, PHP, and the quiet infrastructure behind large sites — caching, config, and testing. New posts land every week or two.

 [Subscribe via RSS →](/rss.xml) [About me →](/about-me) 

 



 

  [← Older

Improving the handling of Drupal JSON:API hyperlinks in GatsbyJS

 ](/blog/improving-handling-drupal-jsonapi-hyperlinks-gatsbyjs) [Newer →

Supporting multiple build outputs from one GatsbyJS setup 

 ](/blog/supporting-multiple-build-outputs-one-gatsbyjs-setup)