A local WordPress site in one command.
devmagic makes the certificate, the Apache SSL vhost, the hosts line, the database and the WordPress install for a local domain, and can import a dump and clone your repos into it. A wizard asks the questions when you would rather not remember the flags.
curl -fsSL https://webtimeless.cloud/devmagic-cli.sh | bashDownloads the newest release, checks it against its checksum and runs its install.sh, which asks for sudo when it needs it. Run it as your own user.
devmagic CLI at a glance.
A local WordPress site from one command: certificate, Apache config, hosts line, database and WordPress.
Certificates from a local CA
Make a local certificate authority once with -ci, then a certificate for each site with -c.
Apache and hosts
-cf writes and enables the site's SSL vhost and adds its domain to /etc/hosts.
WordPress and its database
-w creates the database and installs WordPress; -dbf imports an existing dump into it.
Your code in place
-cr clones the main repo into the site folder, and -pr clones more, like a theme and a plugin, where each belongs.
Wizards for setup and cleanup
--wizard asks for everything step by step, and --remove-wizard removes a site with its database, vhost and certificate.
Rather not remember flags? It asks.
devmagic --wizard walks through a site question by question. This is it, its own words, with made-up answers.
Commands to start from.
A complete site
devmagic -d local.spellbook.test -c -cf -w -dbn spellbook -t SpellbookFrom a dump, with a theme repo
devmagic -d local.shop.test -c -cf -w -dbn shop -dbf ~/dumps/shop.sql -pr 'git@github.com:spellbook/theme.git{to}/var/www/local.shop.test/wp-content/themes'The guided way
devmagic --wizardRemove a site
devmagic -d local.spellbook.test --removeWhat it needs
Ubuntu or Debian with Bash 4 or newer.
- Apache with mod_ssl and mod_rewrite
- MySQL or MariaDB
- PHP 7.4 or newer, with php-mysql
- curl, git and OpenSSL
- Recommended: WP-CLI and Composer
Good to know
Does it work with devmagic-panel?
Yes. The panel lists the sites devmagic makes, keeps their vhosts as they are, and can reissue their certificates and manage their hosts lines.
When do I need -ci?
Once per machine. It makes the local certificate authority that signs your sites' certificates and adds it to the system's trusted store. Firefox keeps its own list, so import it there once by hand.
Which domains should I use?
Names that never exist on the internet, like local.spellbook.test or shop.localhost. The command builder on this site takes the same local names as devmagic-panel.