README
Introduction #
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 OpenLiteSpeed/NGINX-PHP and MariaDB.
Features #
- Easy install, literally just run the script
- Everything is in containers, no bloat on the host OS
- CPU and memory limitations
- Switchable stacks between Nginx/PHP to/from OpenLiteSpeed
- Site-wide or login only basic auth and/or IP whitelisted protection
- Secure NGINX/PHP configurations
- PHP/LSPHP 8 is now the default version
- Daily backups with customizations
- Restore apps
- Clone an already existing app
- Automatic Redis configuration for Nginx/PHP and OpenLiteSpeed
- FastCGI cache with nginx-helper plugin by rtCamp
- System health checks with notifications by email or Matrx webhooks.
- Development mode includes the tools code-server (with WPCS and Xdebug), BrowserSync, and demyx helper plugin
- Browse Demyx file system using code-server (with capabilities of executing demyx commands inside the container and a full fledge terminal using oh-my-zsh)
Requirements #
- Linux with BA$H and Docker installed (YMMV)
- 1gb RAM (minimum)
- 25gb disk space (minimum)
- Ports 80, 443, and 587 are open
- That’s it!
Installation #
The install script makes it easy to install Demyx with little-to-no modifications.
# 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
After the install script is finish, you will see an output similar to this.
# demyx motd
===========================================================
[DEMYX] https://demyx.sh
===========================================================
Welcome to Demyx! Please report any bugs you see.
- Docs https://demyx.sh/kb
- Bugs https://demyx.sh/issues
- Changelog https://demyx.sh/changelog
- Discussions https://demyx.sh/discussions
- IRC https://demyx.sh/irc
- Discord https://demyx.sh/discord
===========================================================
[DEMYX - INFO] System Information
===========================================================
Build 2023-09-16-21:54:56
Version 1.4.0
Hostname demo
IP 127.0.0.1
Apps 2
Backups 4.0K
Disk Used 6.1G
Disk Total 48.3G
Disk Total % 13%
Memory Used 430
Memory Total 1976
Uptime 2:44
Load Average 0.09 0.12 0.05
Running Containers 9
Dead Containers 0
It is recommended to update two environment variables, DEMYX_DOMAIN
and DEMYX_EMAIL
, after the install is finished by running the command: demyx host edit
. The command will execute nano, once you are done, save and exit. The host helper script will automatically restart the Demyx container.
DEMYX_DOMAIN
– requires a valid domain in order to use Demyx Browser and Traefik’s dashboardDEMYX_EMAIL
– requires a valid email address so Traefik can issue SSL certificates
For more information on configuring the rest of the environment variables, please go to Getting Started > Environment Variables.
To create your first app, simply run one command. To see more demyx run
options, please see the reference link below.
# Create a basic WordPress app
demyx run your-domain.tld
# Create a WordPress app with FASTCGI cache and Redis
demyx run your-domain.tld --cache --redis
Reference: Main > demyx run.
Upgrading #
Running demyx host upgrade
will take care of everything but if you are migrating from 1.3.x to 1.4.0, then continue reading this.
# Update Demyx image
docker pull demyx/demyx
# Update host helper script
docker run -t --rm -v /usr/local/bin:/tmp --user=root --entrypoint=bash demyx/demyx -c 'cp -f /etc/demyx/host.sh /tmp/demyx; chmod +x /tmp/demyx'
# Restart Demyx and use updated image
demyx host restart
# Demyx has to fully initialize first so wait until you
# see actual log output before running the last command
demyx log main -sf
# Start the upgrade process
demyx host upgrade
Version 1.4.0 will export and import all app’s databases in order to use the updated MariaDB image. Otherwise the MariaDB container will not start up again due to mismatch of MariaDB versions. Before you run the commands above, you MUST backup all apps first and/or take a snapshot of your machine if available AND run the upgrade in non-peak hours. Tested the upgrade process several times on a DigitalOcean droplet that hasn’t been upgraded in over a year, but YMMV. If anything does not go as expected, then please join us in either on Discord or IRC for quicker help than email or GitHub’s discussions.
# demyx log demo.tld -d
2023-09-17 1:33:32 0 [Note] InnoDB: Completed initialization of buffer pool
2023-09-17 1:33:32 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
2023-09-17 1:33:32 0 [ERROR] InnoDB: Upgrade after a crash is not supported. The redo log was created with MariaDB 10.6.8. You must start up and shut down MariaDB 10.7 or earlier.
2023-09-17 1:33:32 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2023-09-17 1:33:32 0 [Note] InnoDB: Starting shutdown...
2023-09-17 1:33:32 0 [ERROR] Plugin 'InnoDB' init function returned error.
2023-09-17 1:33:32 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2023-09-17 1:33:32 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-09-17 1:33:32 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2023-09-17 1:33:32 0 [ERROR] Aborting
After you run the upgrade and are still having issues with the database when no one is around to help, please run the commands below. For further help, drop a line in any of our channels.
# Clone repo
git clone https://github.com/demyxsh/mariadb.git
# Downgrade Alpine version
sed -i "s|FROM alpine.*|FROM alpine:3.16|g" mariadb/Dockerfile
# Build the image
docker build -t demyx/mariadb mariadb
# Use custom mariadb image
demyx compose all up -d
# Dump old db format
demyx backup all -d
# Pull current version of mariadb
demyx pull mariadb
# Dump db and use new format
# Sorry, demyx restore doesn't have an "all" command
demyx restore domain1.tld -d
demyx restore domain2.tld -d
demyx restore domain3.tld -d
...
Upgrading to 1.8.2 #
Due to a lot of changes with Docker, there had to be a lot of fixes/workarounds made in order to ease the burden of upgrading. Follow these steps for a smooth transition.
# Update the demyx image to the latest version
docker pull demyx/demyx
# Update the host helper script
docker run -t --rm \
-v /usr/local/bin:/tmp \
--user=root \
--entrypoint=bash \
demyx/demyx -c 'cp -f /etc/demyx/host.sh /tmp/demyx; chmod +x /tmp/demyx'
# Use the latest version of demyx
demyx host restart
# Force the upgrade
demyx host upgrade -f
Conclusion #
Need further help or just want to hangout and chat, we have multiple channels for you to visit. To show support for this project, please consider buying coffee.
- Email – [email protected]
- Discussions – https://demyx.sh/discussions
Join us on Discord for latest news, faster support, or just chill.
Support this project by buying coffee (please).