Updated 2022-04-21 – Demyx 1.4.0
First of all, what the heck is Demyx?
Demyx is a Docker image that automates and manages WordPress installations. Traefik for reverse proxy with Lets Encrypt SSL/TLS. WordPress sites are powered by NGINX, PHP, and MariaDB.https://demyx.sh
Step 1. DigitalOcean
Now that’s out of the way, this article will show you a step-by-step guide on how to use Demyx. I’ve tested this briefly on Debian, Ubuntu, and CentOS; all works fine but CentOS needs some minor tweaks. I have Alpine Linux on all my servers so of course it 100% works. I’ll be using DigitalOcean for this guide, using their pre-made Docker droplet in the marketplace running Ubuntu 18.04 x64.
Step 2. Install
Run this command to run the install script. It will download all the necessary Docker images that Demyx uses. After it downloads the images, please fill out the prompts. After you install, you will see my own MOTD (Message of the Day).
Notice on the screenshot below that I’ve enabled Traefik dashboard and code-server. You can see/edit the credentials via:
demyx host edit. See Step 6 for more details.
# Install demyx and ping home bash -c "$(curl -sL https://demyx.sh/install)" # Install demyx without pinging home wget https://demyx.sh/install; bash install --no-ping
Step 3. WordPress
Demyx is preconfigured to always use HTTPS. The MOTD the available stacks you can use, for this example, I will be using a regular WordPress install. Don’t know what Bedrock is? Visit their site: https://roots.io/bedrock/.
- —stack=bedrock – WordPress running Root’s Bedrock nginx-php stack
- —stack=nginx-php – WordPress running default stack
- —stack=ols – WordPress running OpenLiteSpeed stack
- —stack=ols-bedrock – WordPress running Root’s Bedrock in OpenLiteSpeed stack
# Creating a regular WordPress site demyx run demo.demyx.sh # Creating a Bedrock site demyx run demo.demyx.sh --stack=bedrock
After the site installs, you will be presented with a table of useful information. To see all of the site’s settings/variables:
demyx info demo.demyx.sh.
Step 4. Congratulations!
YAY! You made your first Demyx app! Notice how we didn’t touch a single Docker command? That’s because it was to make my life easier and now it can make yours a little better too!
Step 5. Create more sites
Step 6. Bonus
But wait, there’s more! Demyx comes packed with features that’s available in the help menu. I will be showing you some notable ones.
This is disabled by default; during install, it prompted you to enable it. Don’t worry if you set it to false. You can always enable it via
demyx host edit; demyx host restart; demyx refresh traefik. Traefik has HTTP auth enabled by default, you can find the credentials in the Demyx config file. Traefik also supports IP whitelisting by changing
DEMYX_HOST_IP to your IP then rerun the commands from above, supports multiple IPs by CSV format. You can also change the subdomain of the dashboard.
# demyx host edit DEMYX_HOST_TRAEFIK_DASHBOARD=true DEMYX_HOST_TRAEFIK_DASHBOARD_DOMAIN=traefik
The Demyx file browser is enabled by default, powered by code-server. Just like with Traefik, it supports IP whitelisting. You can disable it, change the subdomain value, and password. See below for variables.
If you do decide to change the generated password, then PLEASE PLEASE PLEASE use a strong password. The file browser has a terminal and it also can execute Docker and Demyx commands.
# demyx host edit DEMYX_HOST_CODE=true DEMYX_HOST_CODE_DOMAIN=code DEMYX_HOST_CODE_PASSWORD=<generated password here>
ctop is htop, but for containers! If you look at the screenshot, you can see all running containers. The ctop binary is included in the Demyx image.
# Execute docker command into demyx demyx shell ctop
code-server and browser-sync
Demyx has a feature that will turn a WordPress site into development mode. It replaces the current WordPress container with a modified code-server and spins up a browser-sync container. The code-server container has xDebug and WordPress Coding Standard installed to help you during development.
# Enable development mode demyx config demo.demyx.sh --dev # Disable development mode demyx config demo.demyx.sh --dev=false
Demyx comes shipped with phpMyAdmin that’s auto configured when running.
# Enable phpMyAdmin demyx config demo.demyx.sh --pma # Disable phpMyAdmin demyx config demo.demyx.sh --pma=false
Demyx comes with a preconfigured OpenSSH image that has root and password authentication disabled. Only accessible via public key.
# Enable SFTP demyx config demo.demyx.sh --sftp # Disable SFTP demyx config demo.demyx.sh --sftp=false
Step 8. Conclusion
Demyx has a bunch of features that’s too long to list in this article so feel free to explore the help menu. If you have anymore questions, then please come join me in my channel at Freenode: #demyx.Buy me a coffee Become a Patron!