Before you begin, you will need:
Ensure your server is up to date by running the following command:
sudo apk update && sudo apk upgrade
MODX requires a LAMP stack to run. Let's install it now.
sudo apk add apache2 mysql mysql-client php8 php8-apache2 php8-mysqli php8-json
Edit the Apache config file.
sudo nano /etc/apache2/httpd.conf
Find the following section:
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
Replace it with:
<Directory />
Options FollowSymLinks
AllowOverride All
Require all denied
</Directory>
Save and close the file.
Head over to https://modx.com/download/ and download the latest version of MODX.
Unzip it:
unzip modx-<version>.zip -d /var/www/localhost/htdocs/
Log in to MySQL:
mysql -u root -p
Create a new database and user:
CREATE DATABASE modx;
CREATE USER 'modxuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON modx.* TO 'modxuser'@'localhost';
FLUSH PRIVILEGES;
Replace password
with a strong password.
Open your web browser and navigate to http://your-server-ip-address/setup/
.
Follow the on-screen instructions to complete the installation process.
During the installation, you will be prompted to enter your database details.
modx
modxuser
<your-password>
localhost
Once the installation is complete, remove the setup
directory:
sudo rm -rf /var/www/localhost/htdocs/setup/
Edit the Apache config file again:
sudo nano /etc/apache2/httpd.conf
Find the following line:
#LoadModule rewrite_module lib/httpd/modules/mod_rewrite.so
Uncomment it, save the file and exit.
Restart Apache:
sudo service apache2 restart
Open your web browser and navigate to http://your-server-ip-address/
.
You should see the MODX homepage.
Congratulations, you have successfully installed MODX on Alpine Linux Latest!
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!