# Having trouble deploying local Bedrock site and Sage Theme to Digitalocean Droplet

**URL:** https://discourse.roots.io/t/having-trouble-deploying-local-bedrock-site-and-sage-theme-to-digitalocean-droplet/17873
**Category:** sage
**Tags:** trellis
**Created:** 2020-03-23T20:17:50Z
**Posts:** 8

## Post 1 by @gracemonahan — 2020-03-23T20:17:50Z

Hey everyone ! I have only been developing using the Roots stack for a few months so I appreciate all answers, no matter how obvious they may seem to a more experienced developer :slight_smile:

I successfully developed 2 separate wordpress sites (each with their own custom Sage theme) using trellis and bedrock on my local mac machine.

My file structure is a little different from the roots example project, it follows this recommendation: [Multiple sites: trellis/ subfolder](https://discourse.roots.io/t/multiple-sites-trellis-subfolder/8923) - meaning that i have one trellis install in the same parent directory as the two site directories. I have a separate github repository for each site directory, which does not include the trellis file.

To deploy one of the sites to production I provisioned a DigitalOcean droplet and successfully deployed using this command from my trellis folder:

`> ansible-playbook deploy.yml -e "site=<domain> env=production"`

I then arrived at the droplet expecting everything to look the same as my local site, but it was a fresh install of wordpress which totally freaked me out, until I read the docs more closely and realized that this was normal ! ([https://roots.io/docs/trellis/master/deployments/#configuration](https://roots.io/docs/trellis/master/deployments/#configuration))

Okay so then I followed [this suggestion](https://discourse.roots.io/t/provisioning-a-new-digital-ocean-droplet/7871/7) for exporting my database using `wp db export` from inside my vagrant box and uploading the .sql file & my /uploads folder to my Droplet using FileZilla. This all worked perfectly and now my admin panel of the fresh wordpress install on the droplet looked exactly like my local install, and my custom sage theme was showing up in the Themes dashboard. Yay!

HERE IS WHERE THE PROBLEM BEGINS: I activated my theme and now the site is completely white (white page of doom :face_vomiting:)

So I read some more discourse topics, and reviewed the docs for deploying a sage theme correctly, SURPRISE, I did it wrong, so this time:

I first deleted my sage theme from the DO Droplet. Then I went back into the theme’s folder on my local machine, ran `yarn:production` , then committed the site’s repo to github again (this time there is a /dist folder in my theme folder).  
Based on [this reply](https://discourse.roots.io/t/how-do-you-actually-deploy-the-sage-theme-to-a-wordpress-site/10447/7) I decided to use FileZilla to simply send over my theme directory (WITHOUT the node\_modules, and WITH the new /dist folder) to my digital ocean droplet’s themes folder. It sounded so simple and seemed to work perfectly! Except for the fact that the exact same white screen is appearing when I activate the theme ! again !

Some more information : I did uncomment all of the lines in the`build-before.yml` file and replace “sage” with my theme name before i ran `yarn:production` from inside the theme folder. I also SSH’d into my DO Droplet’s sage theme folder and ran comoser install, as per [these docs](https://roots.io/docs/sage/9.x/deployment/#deploying-sage-with-trellis).

At this point I am quite frustrated because I feel like the answer might be quite simple and I would really just love to be able to click “activate theme” and for it to appear like it does on my local machine, so ANY HELP is appreciated.

Thanks for being such an awesome community guys, I have already learned so much from you all \<3

---

## Post 2 by @strarsis — 2020-03-23T20:26:37Z

As a first step you should check the server logs. There should be the actual PHP errors logged.

---

## Post 3 by @gracemonahan — 2020-03-23T20:45:48Z

great idea ! Here is what I found:  
`failed to open stream: Permission denied in /srv/www/<site url>/releases/20200323200212/web/app/themes/<theme name>/vendor/illuminate/filesystem/Filesystem.php`

and

```
122PHP message: PHP Warning: include(/srv/www/<site>/releases/20200323200212/web/app/uploads/cache/35704efb8e1ca5ddebddb2cfb68db6923013e633.php): failed to open stream: No such file or directory in /srv/www/<site>/releases/20200323200212/web/app/themes/<theme name>/vendor/illuminate/view/Engines/PhpEngine.php on line 43PHP message:
```

Like I said I am a beginner so I really do not understand these errors :frowning: will keep googling while I wait for more help here! Thanks for the quick reply

---

## Post 4 by @gracemonahan — 2020-03-23T20:58:21Z

from my research I gather that my site is attempting to open some files, which it cannot find. I have checked both the /cache folders (the one on my local site and the one on my DO Droplet), and neither of them seem to contain the files that illuminate is searching for… I’m still not sure how to fix this

---

## Post 5 by @strarsis — 2020-03-23T22:19:53Z

Have you provisioned the server before (`ansible-playbook`), also after adding this new site to trellis config?  
(The playbook can be ran as often as one likes as it is (should be) idempotent, it will only change what has to be change.)

---

## Post 6 by @gracemonahan — 2020-03-26T12:49:07Z

Okay so I’ve solved this with a lot of tinkering. First of all my Sage theme has a lot of code that references the function the\_field() because I use the Advanced Custom Fields plugin. And of course when trellis installed wordpress on my droplet, it did not install any plugins. So my template kept calling the\_field() and without the ACF plugin it returned errors like crazy ! So I tried to install the plugin but I could not add any plugins from my wp admin ! Which drove me nuts until I realized that I need to install them using composer (`composer require wpackagist-plugin/advanced-custom-fileds`) which worked like a charm ! So now my site is working, and I’ve learnt so much about bedrock and trellis :slight_smile: Hopefully my errors and comments can help someone in the future !

---

## Post 7 by @strarsis — 2020-03-26T15:20:26Z

Hm, the WordPress plugins in the `composer.json` of bedrock site should be automatically installed on server during `deploy`.

---

## Post 8 by @system — 2020-05-04T20:17:52Z

This topic was automatically closed after 42 days. New replies are no longer allowed.
