# Video Tutorial for Setting Up Trellis and Deploying to Production

**URL:** https://discourse.roots.io/t/video-tutorial-for-setting-up-trellis-and-deploying-to-production/7939
**Category:** trellis
**Created:** 2016-10-20T01:33:59Z
**Posts:** 36

## Post 1 by @jlengstorf — 2016-10-20T01:33:59Z

I recently created a video tutorial (with written counterpart) on setting up a new WordPress site from scratch and deploying it to a production server.

I wanted to post it here to try and help out anyone trying to get started with Trellis.

> **[Automatic WordPress Deployment + Free SSL: Trellis How-To](https://code.lengstorf.com/learn-trellis-wordpress-roots/)**
>
> A step-by-step video tutorial on setting up a local WordPress development environment in minutes using Trellis, plus how to deploy FAST with free SSL.

If you have questions, let me know. Thanks!

---

## Post 2 by @growdigital — 2016-10-20T10:45:38Z

Thank you for the video, and the walkthrough notes on your site are invaluable too :slight_smile:

---

## Post 3 by @jlengstorf — 2016-10-20T21:48:21Z

I’m glad you found it useful. Thanks for watching!

---

## Post 4 by @tiagogomes — 2016-10-21T08:57:49Z

Thanks for your effort and for your time working on this video. A very good resource for wordpress developement.

---

## Post 5 by @jlengstorf — 2016-10-21T19:24:30Z

Thanks so much! I’m glad you found it useful.

---

## Post 6 by @Joe_Thomas — 2016-10-22T01:05:29Z

Would love a similar video on addding Sage to a Trellis and Bedrock configuration.

---

## Post 7 by @Joe_Thomas — 2016-10-22T14:35:53Z

The password I set in the vault.yml file is not working when I try to log into my .dev site. Any idea why that would be?

---

## Post 8 by @jlengstorf — 2016-10-23T15:01:34Z

You’re setting it in the same environment you’re deploying (e.g. development, production)?

If it has special characters, quote it. Otherwise, you may want to open your own topic on here for help.

Thanks!

---

## Post 9 by @mchildress — 2016-10-24T22:32:27Z

Jason, this was invaluable to this newbie! Much thanks for taking the time to create it. Absolutely stellar.

---

## Post 10 by @jlengstorf — 2016-10-24T23:14:36Z

Thanks so much, @mchildress! I’m glad to hear it’s helpful.

---

## Post 11 by @MWDelaney — 2016-10-25T04:27:48Z

Is there a compelling reason to set the dev `vault.yml` passwords to something other than the defaults? I usually just leave them since it’s only local. Love to hear your thoughts on why you recommend changing them.

---

## Post 12 by @jlengstorf — 2016-10-25T04:59:17Z

The only reason would be if I plan to use WP Sync DB to push my local DB live. What I didn’t do in the video — that I should have done, given the loca-to-production push — was use ansible-vault to encrypt the development vault.yml.

If that’s not your workflow, however, then I don’t think there’s any need to change them from defaults.

---

## Post 13 by @nathobson — 2016-11-03T16:30:39Z

@jlengstorf After using Sage for a long while now, I finally decided to make the jump and give Trellis and Bedrock a go. Your video was a great help in getting started, I seriously appreciate the time you took recording it and writing the post to go with it.

---

## Post 14 by @jlengstorf — 2016-11-04T19:42:23Z

Glad to hear it! Trellis has been great for me, but I definitely struggled a bit when I first started; I figured this could be a way to give back to the Trellis community for saving me the huge amount of time it would have taken to figure out my own solution.

---

## Post 15 by @xu123 — 2016-11-07T21:50:15Z

@jlengstorf Thank you so much for the tutorial it is by far the best out there. I hit a snag when doing the git push. I get a syntax error in the vault.yml file such as :slight_smile:

The offending line appears to be:

# Documentation: [https://roots.io/trellis/docs/security/](https://roots.io/trellis/docs/security/)

vault\_users:  
^ here  
Any idea what this could be?

---

## Post 16 by @jlengstorf — 2016-11-07T23:58:17Z

Glad you enjoyed it! I’m not sure I understand the error, though — what command are you running when you get an error? Can you paste the full error message?

(Honestly, if you search the error message, I’m willing to bet the answer is already on this forum; the Trellis community is _super_ helpful.)

---

## Post 17 by @fullyint — 2016-11-08T00:19:28Z

@xu123 I can reproduce your issue if I mistakenly indent [this line with `vault_users`](https://github.com/roots/trellis/blob/b690d5a3e50c8712db60eb9220c166764c1c0478/group_vars/production/vault.yml#L5) (i.e., so its indentation level is the same as `- name:`). Please double check that your indentation matches the [official repo](https://github.com/roots/trellis/blob/b690d5a3e50c8712db60eb9220c166764c1c0478/group_vars/production/vault.yml#L5-L8). If this doesn’t resolve the issue, please start a new thread instead of responding here.

---

## Post 18 by @fullyint — 2016-11-08T00:20:15Z

Many thanks are in order for @jlengstorf

**To All:**

- This thread is a great place to thank @jlengstorf or maybe to ask a question specific to his video.
- **Please put general support requests in a new thread.**  
@jlengstorf’s decision to generously offer the video doesn’t sign him up for supporting Trellis and Roots generally.

Thanks @jlengstorf!

---

## Post 19 by @xu123 — 2016-11-08T00:53:34Z

Thanks fullyint I solved it :slight_smile: now Im just receiving an error that I cannot access the host via ssh …mmmmm but I have all the keys set up…

Jason it is a very good tutorial…:slight_smile:

---

## Post 20 by @xu123 — 2016-11-08T00:54:08Z

Yes I will put them up on support…sorry for the overlook…:slight_smile:

---

## Post 21 by @masoninthesis — 2017-01-26T05:22:26Z

Hey @Joe_Thomas

This video series should help, but do note that this is for Sage 8, not Sage 9 (which is the current master branch for Sage):

[https://www.youtube.com/watch?v=\_a\_QIWZWZcw&t=9s](https://www.youtube.com/watch?v=_a_QIWZWZcw&t=9s)

---

## Post 22 by @masoninthesis — 2017-01-27T17:59:12Z

Hey @jlengstorf, just watched your tut. Loved it! It’s funny how I’ve done tons of Roots installs over the years, but I always learn something new from other people’s processes.

I mainly watched it for the WP Sync DB because I’d never messed with that before. I watched it on 2x speed. So your 20 minute tutorial will probably end up saving me days worth of time!

A couple notes:

• You asked for tutorial requests– personally I’d love to see you configure the smtp stuff. I’ve never done that either.  
• My workflow is a little different. I use Github’s desktop app because I figured it’d have a lower barrier of entry for anyone I’m working with who’s never used Git before. To my surprise, I think it way less steps than running Git/Github through command line. (see here: [https://youtu.be/17Zg\_Rh38ug?t=4m33s](https://youtu.be/17Zg_Rh38ug?t=4m33s))

Keep up the great work man!

---

## Post 24 by @jlengstorf — 2017-01-27T21:03:49Z

That WP Sync DB workflow is no joke. :slight_smile:

SMTP could be a good add-on to this tutorial; I’m collecting tutorial ideas over at [GitHub](https://github.com/jlengstorf/code.lengstorf.com/issues) if you don’t mind opening an issue for that.

I’ve seen the GitHub app before, but I found that it’s excellent _until_ you need to do something other than commit (such as unstaging a change). I watched a beginner irrevocably destroy an entire repo because the UI didn’t make it clear if she was about to remove the commits or remove the files. (It removed the files, which hadn’t been committed.) So I’m wary. :slight_smile:

Thanks for the feedback! I appreciate it.

---

## Post 25 by @masoninthesis — 2017-01-27T21:09:22Z

Yeah it’s actually shameful I haven’t done much DB syncing until now. I was planning out my morning thinking of adding a bunch of woocommerce products to a staging env, which will be pushed to production in the next week or two. I was thinking… either I can spend an hour duplicating it all manually, or I can just spend an hour getting DB syncing setup. DRY methodology FTW.

Will do, I’ll add that request to the github repo.

Re: The Github app, exactly. I’ve learned the hard way, if you’re doing anything other than committing, don’t do it in the app! :slight_smile:

---

## Post 26 by @wjcotter — 2017-02-18T07:00:20Z

Yes, this is great thank you! One question… does it matter how you install Ansible on your Mac? I noticed that you used Brew. The official doc recommends “pip” [http://docs.ansible.com/ansible/intro\_installation.html#latest-releases-on-mac-osx](http://docs.ansible.com/ansible/intro_installation.html#latest-releases-on-mac-osx).

Also here is another tutorial I found ( actually 3 parts) which is also excellent… much thanks to Jimmy Smutek

> **[Shared hosting to Roots stack: Part 1 | smutek.net](https://smutek.net/migrating-to-trellis-1/)**
>
> Pt. 1 – Setting up Trellis & Bedrock locally This is the first in a series of screencasts that will document the process of moving a WordPress website (this website) from a shared hosting provider…

Much thanks for these tutorials! I’d love to see something on trellis with multiple sites. e.g. [Best practice for Trellis with multiple sites](https://discourse.roots.io/t/best-practice-for-trellis-with-multiple-sites/3981)

---

## Post 27 by @Sergio — 2017-03-10T00:25:55Z

@masoninthesis & @jlengstorf : First, thank you both for the videos. They really cleared up a whole lot of questions I had and helped set up for the first time. I still go back and reference them.

Have you heard of, or used, [VesrionPress](https://github.com/versionpress/versionpress/) before? I just stumbled upon it and it looks very promising.

---

## Post 28 by @masoninthesis — 2017-03-10T06:16:09Z

@Sergio My pleasure.

VP looks interesting. Haven’t used it, but would definitely like to hear opinions if some has.

---

## Post 29 by @masoninthesis — 2017-03-10T06:22:20Z

@jlengstorf Ever used WP Migrate/Sync from the command line? If you have, I’d love to see how that’s done, potentially even automated in the build/deploy process. :slight_smile:

---

## Post 30 by @jlengstorf — 2017-03-22T23:43:20Z

I haven’t tried it in the command line yet. It’s on my (ever-growing) list of things to experiment with. :slight_smile:

---

## Post 31 by @nathobson — 2017-03-23T09:22:14Z

> [@masoninthesis](#):
>
> @jlengstorf Ever used WP Migrate/Sync from the command line? If you have, I’d love to see how that’s done, potentially even automated in the build/deploy process. :slight_smile:

I’d recommend reading [this blog post](https://roots.io/leveraging-wp-cli-aliases-in-your-wordpress-development-workflow/) and the comments that go with it :slight_smile:

Lots of good stuff for syncing environments via the command line.

---

## Post 32 by @solray — 2017-03-29T16:41:09Z

As a designer, this video tutorial by @jlengstorf helped me tremendously to make the leap from a shared hosting setup to a VPS.

Had my down moments in he process as described [here](https://discourse.roots.io/t/trellis-bin-deploy-sh-deploy-error/9213/8). Fortunately, @fullyint came to the rescue with quick fixes.

For anyone else going through this tutorial, wp-sync-db needed a lower composer installer in order to be installed, so I’ve updated “composer/installers”: “~1.0.6” in composer.json and composer.lock. (If there’s a better workaround please share but this seems to work okay).

Additionaly, wp-sync-db admin panel become unresponsive once activated in local environment. I’ve tracked the solution to [Commit #120](https://github.com/wp-sync-db/wp-sync-db/pull/120/commits/22a5f31407bcaba34194da5607ab5dd45fda1bfe).

Very happy with current setup.

Thanks again @fullyint and @jlengstorf and the rest of the Roots team.

---

## Post 33 by @smutek — 2017-03-29T17:20:40Z

As an aside, I think it’s worth mentioning [the origin of](https://github.com/wp-sync-db/wp-sync-db#is-this-illegal), and [the history behind](https://wptavern.com/dmca-takedown-notice-issued-against-fork-of-wp-migrate-db-pro) “wp-sync-db”, which is just a fork some dude made of the premium version of [WP Migrate DB Pro](https://deliciousbrains.com/wp-migrate-db-pro/).

---

## Post 34 by @boothwise — 2018-12-21T16:59:08Z

This rookie had a heck of a time all week with your tutorial, but it made it possible! The biggest difference for any other newbie is to make sure the DO Droplet has the updated Ubuntu…

My biggest headache and the only thing keeping me from being successful is the “wp-sync-db” process… I have tried everything to make this work, but to no success… I’ve also manually added these to the app/plugins folder, and git won’t see these within the git add -A…

Any ideas? Here is my composer file.

```
> {
> "name": "boothwise",
> "type": "project",
> "license": "MIT",
> "description": "WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure",
> "homepage": "https://roots.io/bedrock/",
> "authors": [
> {
> "name": "Scott Walkinshaw",
> "email": "scott.walkinshaw@gmail.com",
> "homepage": "https://github.com/swalkinshaw"
> },
> {
> "name": "Ben Word",
> "email": "ben@benword.com",
> "homepage": "https://github.com/retlehs"
> }
> ],
> "keywords": [
> "bedrock", "composer", "roots", "wordpress", "wp", "wp-config"
> ],
> "support": {
> "issues": "https://github.com/roots/bedrock/issues",
> "forum": "https://discourse.roots.io/category/bedrock"
> },
> "config": {
> "preferred-install": "dist"
> },
> "repositories": [
> {
> "type": "composer",
> "url": "https://wpackagist.org"
> }
> ],
> "require": {
> "php": ">=7.1",
> "composer/installers": "^1.4",
> "vlucas/phpdotenv": "^2.0.1",
> "oscarotero/env": "^1.1.0",
> "roots/wordpress": "5.0.2",
> "roots/wp-config": "1.0.0",
> "roots/wp-password-bcrypt": "1.0.0"
> },
> "require-dev": {
> "squizlabs/php_codesniffer": "^3.0.2",
> "roave/security-advisories": "dev-master"
> },
> "extra": {
> "installer-paths": {
> "web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
> "web/app/plugins/{$name}/": ["type:wordpress-plugin"],
> "web/app/themes/{$name}/": ["type:wordpress-theme"]
> },
> "wordpress-install-dir": "web/wp"
> },
> "scripts": {
> "post-root-package-install": [
> "php -r \"copy('.env.example', '.env');\""
> ],
> "test": [
> "phpcs"
> ]
> }
> }
```

composer require wp-sync-db/wp-sync-db:dev-master@dev

shows this error…

Problem 1  
- Installation request for wp-sync-db/wp-sync-db dev-master@dev -\> satisfiable by wp-sync-db/wp-sync-db[dev-master].  
- wp-sync-db/wp-sync-db dev-master requires composer/installers ~1.0.6 -\> satisfiable by composer/installers[1.0.x-dev, v1.0.10, v1.0.11, v1.0.12, v1.0.13, v1.0.14, v1.0.15, v1.0.16, v1.0.17, v1.0.18, v1.0.19, v1.0.20, v1.0.21, v1.0.22, v1.0.23, v1.0.24, v1.0.25, v1.0.6, v1.0.7, v1.0.8, v1.0.9] but these conflict with your requirements or minimum-stability.

So I changed the composer number to ~1.0.6… no success…

Has anyone recently had luck?? I’ll send beer money if you can help! \<3

---

## Post 35 by @ben — 2018-12-21T17:01:24Z

Locking this thread as it’s 2 years old and wp-sync-db is an unethical version of a paid product (WP Migrate DB Pro) that we don’t recommend using and will not support here

---

## Post 36 by @ben — 2018-12-21T17:01:27Z


