I’m done with LocalWP
Published: 2022-08-09 15:44:34

---
title: I’m done with LocalWP
published: true
date: 2022-06-28 00:00:00 UTC
tags: 
canonical_url: https://timothymiller.dev/posts/2022/done-with-local/
---

I hate to say it, but I am abandoning [Local WP](https://localwp.com/) (formerly by Flywheel). I used it the last couple of years, but I can’t do it anymore. I’m done.

## Why?

One big reason: databases. It is a _huge_ pain in the neck importing databases into Local. I don’t have to do it very often, but every time I do it drives me nuts. Database imports have required nasty hacks for [at least four years](https://cameronjonesweb.com.au/blog/how-to-restore-the-database-of-a-site-on-local-by-flywheel/), so I don’t expect it to be fixed anytime soon.

It also seems like the focus of the app has changed. It _used_ to be a great tool for developing WordPress sites locally, now it seems more like a great _integration_ for its parent company, WPEngine. I love WPEngine as a platform, but many of my clients use other WordPress hosts, and Local simply isn’t the best option for sites that _aren’t_ using WPEngine. Even for WPEngine sites, the connector utility is sketchy at best. It’s great when it works, awful when it doesn’t.

## What do you use instead?

I’m back to my old [Docker Compose](https://docs.docker.com/compose/) setup, which I made [a video about several years ago](https://www.youtube.com/watch?v=ksD-w9dtBTE). I have a boilerplate docker-compose template that I use in every WordPress site, and this allows me to create and destroy my local servers with very simple commands:

```bash
# firing up the server
docker-compose up

# shutting down the server
docker-compose stop

# destroying the server
docker-compose rm
```

In case you’re curious, here’s what my typical docker compose file looks like:

```yml
version: '2'

services:
   mysql:
     image: mysql:5.6
     volumes:
  # this line automatically imports .sql files
  # all I do is drop them into a /db folder
  # and Docker does the rest!
       - ./db:/docker-entrypoint-initdb.d
       - ./db/conf:/etc/mysql/conf.d
     restart: always
     ports:
         - "3306:3306"
     environment:
       MYSQL_ROOT_PASSWORD: wordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress

   # I usually leave PHP MyAdmin disabled unless I need it
   # myadmin:
   #    image: phpmyadmin/phpmyadmin
   #    ports:
   #       - "8888:80"
   #    depends_on:
   #       - mysql
   #    restart: always
   #    links:
   #       - mysql:db
   #    environment:
   #       MYSQL_USERNAME: wordpress
   #       MYSQL_PASSWORD: wordpress
   #       MYSQL_ROOT_PASSWORD: wordpress

   wordpress:
     depends_on:
       - mysql
     image: wordpress:php7.3
     links:
       - mysql:mysql
     volumes:
       - ./:/var/www/html
     ports:
     # I use a unique port number for each client
     # (you only change the first number, "8000")
       - 8000:80
     restart: always
     environment:
       WORDPRESS_DB_PASSWORD: wordpress


```

As long as you have Docker installed and running, you can place this file inside your root directory (name it `docker-compose.yml`), run `docker-compose up` and Docker will do the rest. It will automatically spin up a new server and database, and import any SQL files that it finds in the /db folder. It works like magic, no more frustrations with Local.

## If Docker is so great, why did I stop using Docker?

Partially because Local was new and shiny, and everyone else was using it. It’s a pretty app, and I like to use pretty apps.

I also tried it because Docker _can_ be slow on Macs. Locals wasn’t really much better—they probably use similar tech behind the hood—but I hoped Locals would be better on Macs.

[Now I use a Linux computer full time](https://timothymiller.dev/posts/2022/big-updates-to-my-uses-page/), and Docker works like a dream on Linux, so there’s really no downside to switching back to Docker.