How to Deploy from Local to Flywheel

By Sunjay Armstead |
April 1, 2022

We’ve come a really long way in this series. We set up a local development environment for WordPress, created a child theme, and took a deep dive into my Git workflow. Now it’s time to deploy from Local to Flywheel. Here’s how!

A Few Ways to Deploy from Local

Manually

Any time you launch a traditional WordPress site, you need to set up two things: (1) a MYSQL database and (2) a place for all of your uploads, themes, and plugins to live.

Local automates this process with Flywheel and WP Engine, the hosts it currently integrates with. If those won’t be your hosting providers, you can export the site and manually add the files to your own host.

  1. Start your site in Local.
  2. Right click on the site name in the sites list. Choose Export.
  3. Follow the prompts to save the exported site to a specific location on your computer.
  4. Important: If you did any version control with Git, unzip the file Local exported to your computer. In your terminal, navigate to the folder with your .git directory and delete it. It’s bad practice to store the .git directory in production environments.

Below is the folder structure when you unzip and open your site’s .zip file. Your directory may look different depending on your Local version.

├── YOUR-SITE
│   ├── app
│   │   ├── public            # All WordPress folders and files, including wp-content
│   │   ├── sql
│   │   │   └── local.sql     # Your database combined into one file
│   ├── conf
│   ├── logs
│   └── local-site.json

Given the wide variety of scenarios, I won’t cover how to do this with every host. From here, you can follow the instructions from your hosting provider to add your WordPress site.

Basically, you’ll use the local.sql file in the /app/sql directory of your exported site to populate the database on your host. You’ll also import the wp-content directory from /app/public/ to your host’s server.

For more on this, I recommend “How to MANUALLY Migrate Your WordPress Site” by Josh Hall and “Migrate a WordPress site to a new host and new domain manually” by WPLearning Lab. That’s how I learned!

Integrated Hosts

If you are planning to use WP Engine or Flywheel, the process is super simple! Here’s how I deploy from Local to Flywheel:

  1. In your Flywheel dashboard, click CREATE A NEW SITE or + NEW SITE.
  2. Follow the prompts to set up your owner and plan, as well as set up your new WordPress site. (Note: You will basically create a new WordPress site at this step to provision a space for your build to migrate to. It will be deleted once you push your site from Local to Flywheel).
  3. In Local, go to the Connect tab and select CONNECT TO A PLATFORM. Then select Flywheel to connect Local to your Flywheel account.
  4. Go to the Local Sites tab and start your site. At the bottom right of your screen, you’ll see Connected to no host selected. Click that button to connect your Local site to Flywheel.
  5. Click the Push to Flywheel button. Select a site under Push site to, choose an environment, select Include database, and PUSH TO FLYWHEEL. You should receive an email at the address in your Flywheel account saying that the site successfully pushed.

And just like that, you built and deployed a WordPress site with Local! Great job! You can now point your domain to the IP address listed in your Flywheel site dashboard. You can also manage caching, SSH access, run backups and a lot more all from your Flywheel dashboard.

I hope you enjoy your deployed site! 🚀