Elgg is an open-source social networking platform that can be used to create customized social networks. In this tutorial, we will explain how to install Elgg on Debian latest version.
Before beginning the installation process, make sure that you have:
Before proceeding with the installation process, you should update your system to ensure that all packages and dependencies are up-to-date.
sudo apt update
sudo apt upgrade
Elgg requires a LAMP stack to run (Linux, Apache, MySQL, PHP). If you don't have it installed, install it by running the following command:
sudo apt install apache2 mysql-server mysql-client php libapache2-mod-php php-mysql php-curl php-gd php-xml php-mbstring php-intl
Create a new MySQL database and user for Elgg. Log in to your MySQL server by running the following command:
sudo mysql -u root -p
Create a new database and user with the following commands:
CREATE DATABASE elgg_db;
GRANT ALL PRIVILEGES ON elgg_db.* TO 'elgg_user'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
Remember to replace "elgg_db," "elgg_user," and "password" with your preferred names.
Download the latest version of Elgg from their official website or use the following command:
wget https://elgg.org/getelgg.php?forward=elgg-3.3.10.zip
Extract the downloaded file to your Apache document root:
sudo unzip elgg-3.3.10.zip -d /var/www/html/
Rename the extracted directory:
sudo mv /var/www/html/elgg-* /var/www/html/elgg
Adjust the ownership of the elgg directory:
sudo chown -R www-data:www-data /var/www/html/elgg/
Create a new configuration file by copying the sample configuration file:
sudo cp /var/www/html/elgg/engine/settings.example.php /var/www/html/elgg/engine/settings.php
Edit the settings.php file:
sudo nano /var/www/html/elgg/engine/settings.php
Set your site URL:
$CONFIG->wwwroot = "http://yourdomain.com/elgg";
Set your database details:
$CONFIG->dbuser = 'elgg_user';
$CONFIG->dbpass = 'password';
$CONFIG->dbname = 'elgg_db';
Save the file and exit.
Enable the Apache rewrite module:
sudo a2enmod rewrite
Restart the Apache service:
sudo service apache2 restart
Create a new Apache configuration file:
sudo nano /etc/apache2/sites-available/elgg.conf
Add the following content:
<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/html/elgg
<Directory /var/www/html/elgg>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/elgg_error.log
CustomLog ${APACHE_LOG_DIR}/elgg_access.log combined
</VirtualHost>
Replace "yourdomain.com" with your actual domain.
Save the file and exit.
Enable the new configuration:
sudo a2ensite elgg.conf
Restart Apache once again:
sudo service apache2 restart
Congratulations! You have successfully installed and configured Elgg on Debian latest version. You can now access your Elgg site by visiting your site URL in your web browser.
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!