Using Chassis For WordPress Development

Imran Sayed
2 min readNov 19, 2021

In this blog, we will learn about how to set up chassis for WordPress development.

  1. Install the prerequiste software.
  2. Install Vagrant Hostsupdater plugin vagrant plugin install vagrant-hostsupdater.
  3. Clone Chassis into a new directory git clone --recursive https://github.com/Chassis/Chassis project-name.
  4. cd project-name.
  5. cp local-config-sample.php local-config.php - This file is used for local environment constants.
  6. touch config.local.yaml.
  7. Copy and paste the following into config.local.yaml:
hosts:
- project-name.local
ip: 192.168.33.10
hostsupdater: yes

# Should we use multisite?
# (Set to Yes for subdirectories)
# Values: No, Yes, subdomains
multisite: subdomains

extensions:
- chassis/sequelpro
- chassis/xdebug
- chassis/mailhog
- chassis/phpmyadmin
  1. git clone git@xyz.git content
  2. vagrant up
  3. Open http://project-name.local/wp/wp-admin/ in a browser.
  4. Login using Username: admin and Password: password.

Note:
In case your themes and plugins are not inside the root of`content`, but inside content/wp-content, then be sure to add that path in `local-config-db.php` like so :

defined( 'WP_CONTENT_DIR' ) or define( 'WP_CONTENT_DIR', '/vagrant/content/wp-content' );

and also in the root file wp-config.php like so:

defined('WP_CONTENT_URL') or define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/content/wp-content' );

Migrating Database.

  • Assuming that you have the MySQL database dump and uploads folder.
  1. Copy the database file ( e.g. wordpress-2021–07–05-bb823aa.sql ) into your content folder.
  2. vagrant ssh
  3. cd /vagrant/content
  4. wp db reset
  5. wp db import wordpress-2021-07-05-bb823aa.sql
  6. wp user create yourusername youremail --role=administrator # will generate a password
  7. Replace your uploads folder from content with new one.

PHPMyadmin

--

--

Imran Sayed

👤 Full Stack Developer at rtCamp, Speaker, Blogger, YouTuber, Wordpress, React, Node, Laravel Developer http://youtube.com/ImranSayedDev