Accessing WP CLI
Using WP CLI can be very helpful for a variety of management tasks.
Sites in FlyWP reside in the home directory. You can verify this by using the pwd command; You will be in the /home/fly directory. By using ls command, you’ll find all the available sites on your server.
If my domain is domain.tld, then the change directory will look like the following command (change it as per your website’s name)
cd domain.tldFirst, we will get inside the containers own shell to run these commands.
Now if you have an NGINX site, you can run WP CLI like this:
docker compose exec php wpOr if you have an OpenLiteSpeed site;
docker compose exec --user=www-data openlitespeed wpFrom there for example, showing all post list in an NGINX site:
docker compose exec php wp post listFor OpenLiteSpeed,
docker compose exec --user=www-data openlitespeed wp post listAlternatively, if the docker compose command seems too long for your, you can go inside the container and run wp commands as usual.
For Nginx site,
docker compose exec php bashFor OpenLiteSpeed,
docker compose exec openlitespeed bash…and now as you’re inside the container. You will be able to run wp commands like you’re used to.
wp cli versionExample
Section titled “Example”# Display the version currently installed.$ wp cli versionWP-CLI 2.10.0Still stuck? How can we help?