Fork me on GitHub

Example configuration of config.yml

###
# Configuration for Vagrant
###

# This is used for domain mapping
name: wordpress

# These are used for migrating database and uploads back and forth with production
# Comment these out if you don't want this integration
production:
  domain: example.seravo.com
  ssh_port: 12345

staging:
  domain: example.seravo.com
  ssh_port: 23456

# Domains are automatically mapped to Vagrant with /etc/hosts modifications
development:
  domains:
    - wordpress.local
    - example.dev
    - www.example.dev

Changing config.yml

name

Change name in config.yml to change your site name. This is used in quite a few places in the development environment.

For example, with the above config.yml mailcatcher is set up in the address: mailcatcher.example.local.

production

Add domain and ssh_port to sync with your production instance.

staging

Optional: Add domain and ssh_port to sync with your staging (shadow) instance.

development

Add new domains under domains before you run vagrant up to use extra domains.

See config-sample.yml for more.

Using dotenv

The wp-config.php file uses Dotenv by default which enables you to create a file called .env in the root of your project to override default environment variables.

Example:

$ cat .env.development
# Run 'ln -s .env.development .env' in project root to activate this
WP_TEST_URL=https://example.dev
DOMAIN_CURRENT_SITE=example.dev
NOBLOGREDIRECT=https://example.dev
COOKIE_DOMAIN=.example.dev

$ ll .env
lrwxrwxrwx 1 otto otto .env -> .env.development

You can have template files like .env.development tracked in version control, and then make a location-specific symbolic link from .env to the correct file. By default the .env file is and should be ignored by git via gitignore.