Getting started
What the devmagic CLI does, how to install it in one line, and your first local WordPress site with trusted HTTPS.
The devmagic CLI, the devmagic command, makes a local WordPress site on
Ubuntu or Debian in one run: a certificate from your own local certificate
authority, an Apache SSL vhost, a hosts line, a database and WordPress. It can
also import a database dump, clone your repos into the site, and remove a site
again. It is a set of Bash scripts; nothing runs in the background.
Install
curl -fsSL https://webtimeless.cloud/devmagic-cli.sh | bash
Run it as your own user, not root. It downloads the newest release, checks it
against its .sha256, and runs its install.sh, which asks for sudo when it
needs it and offers to install missing packages. The command ends up in
/usr/local/bin/devmagic, its code in /usr/local/share/devmagic.
To read the installer first, or pick a release:
curl -fsSLO https://github.com/PetyoLazarov92/devmagic/releases/latest/download/get.sh
bash get.sh --dry-run # download and check, install nothing
bash get.sh --version v1.1.0 # a given release
It needs Apache with mod_ssl and mod_rewrite, MySQL or MariaDB, PHP 7.4 or newer with php-mysql, curl, git and OpenSSL. WP-CLI and Composer are recommended.
Your first site
Once per machine, make the local certificate authority that signs your sites' certificates. It goes into the system's trusted store; browsers may need it too, see Certificates.
devmagic -d local.spellbook.test -ci
Then make a site: a certificate (-c), the Apache SSL vhost and hosts line
(-cf), and WordPress with its database (-w):
devmagic -d local.spellbook.test -c -cf -w -dbn spellbook -t Spellbook
Open https://local.spellbook.test. Its files are in
/var/www/local.spellbook.test, its vhost is
/etc/apache2/sites-available/local.spellbook.test-ssl.conf, and its
certificate is in /etc/ssl/localcerts/local.spellbook.test.
Rather answer questions than remember flags? devmagic --wizard asks for
everything step by step.
Use names that stay local
Pick a name that can never exist on the internet: local.*, *.test or
*.localhost, like local.spellbook.test or shop.localhost. The command
builder on the home page and devmagic-panel take the same names.
With devmagic-panel
devmagic-panel lists the sites devmagic makes as sites made by hand: it keeps their vhosts as they are, and can reissue their certificates and manage their hosts lines. Both can live on one machine.